Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10139 in orxonox.OLD for branches/playability/src/util


Ignore:
Timestamp:
Dec 22, 2006, 12:21:38 AM (18 years ago)
Author:
muellmic
Message:

trying to adjust interface

Location:
branches/playability/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/util/hud.cc

    r10120 r10139  
    6565  this->subscribeEvent(ES_ALL, SDLK_TAB);
    6666
    67   this->shipValuesBox = new OrxGui::GLGuiBox(OrxGui::Vertical);
    68   this->shipValuesBox->setBackgroundTexture("maps/gui_container_background.png");
     67  this->shipValuesBox = NULL;
    6968}
    7069
     
    7978
    8079  delete this->_radar;
     80  delete this->shipValuesBox;
     81
    8182  // delete what has to be deleted here
    8283}
     
    9899void Hud::setEnergyWidget(OrxGui::GLGuiWidget* widget)
    99100{
     101  if (this->shipValuesBox == NULL)
     102    this->createShipValuesBox();
    100103  // decopple old widget
    101104  if (this->energyWidget != NULL)
     
    107110  if (this->energyWidget != NULL)
    108111  {
    109     this->energyWidget->show();
    110     this->energyWidget->shiftDir2D(270);
     112    //this->energyWidget->shiftDir2D(270);
    111113    dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->energyWidget)->setDisplayedName("Electronics");
    112114    this->shipValuesBox->pack(this->energyWidget);
     115    this->energyWidget->show();
    113116    /*    this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
    114117        this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
     
    120123void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget)
    121124{
     125  if (this->shipValuesBox == NULL)
     126    this->createShipValuesBox();
    122127  // decopple old widget
    123128  if (this->shieldWidget != NULL)
     
    129134  if (this->shieldWidget != NULL)
    130135  {
     136    //this->shieldWidget->shiftDir2D(270);
     137    this->shipValuesBox->pack(this->shieldWidget);
    131138    this->shieldWidget->show();
    132     this->shieldWidget->shiftDir2D(270);
    133     this->shipValuesBox->pack(this->shieldWidget);
    134139    /*    this->shieldWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
    135140        this->shieldWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
    136141  }
     142  else
     143    printf("schild im hud nicht uebergeben!!!!!!!!!!!!!!!!!!!!!!!!!");
    137144
    138145  this->updateResolution();
     
    141148void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget)
    142149{
     150  if (this->shipValuesBox == NULL)
     151    this->createShipValuesBox();
     152
    143153// decopple old widget
    144154  if (this->armorWidget != NULL)
     
    150160  if (this->armorWidget != NULL)
    151161  {
     162    //this->armorWidget->shiftDir2D(270);
     163    this->shipValuesBox->pack(this->armorWidget);
    152164    this->armorWidget->show();
    153     this->armorWidget->shiftDir2D(270);
    154     //this->shipValuesBox->pack(this->armorWidget);
    155165    /*    this->armorWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png");
    156166        this->armorWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/
     
    272282  if (this->shipValuesBox != NULL)
    273283  {
    274     this->shipValuesBox->setAbsCoor2D(0.8 * this->resX, 0.85 * this->resY);
     284    this->shipValuesBox->setAbsCoor2D(0.2 * this->resX, 0.4 * this->resY);
    275285    this->shipValuesBox->setWidgetSize(.4 * this->resX, 0.1 * this->resY);
    276286  }
     287  else
     288    createShipValuesBox();
    277289
    278290
     
    309321  //  this->inputLine->select();
    310322  }
    311 
    312 
    313 }
    314 
    315 
     323}
     324
     325void Hud::createShipValuesBox()
     326{
     327  this->shipValuesBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
     328  //this->shipValuesBox->setWidgetSize(1000,500);
     329  //this->shipValuesBox->setBackgroundTexture("maps/gui_container_background.png");
     330  this->shipValuesBox->setBackgroundTexture(Texture());
     331  this->shipValuesBox->setBackgroundColor(Color(0,0,1,0.5));
     332  this->shipValuesBox->setVisibility(true);
     333}
     334
     335
  • branches/playability/src/util/hud.h

    r10111 r10139  
    4040  void setShiledWidget(OrxGui::GLGuiWidget* widget);
    4141  void setArmorWidget(OrxGui::GLGuiWidget* widget);
     42  inline OrxGui::GLGuiWidget* getEnergyWidget() {return this->energyWidget;};
     43  inline OrxGui::GLGuiWidget* getShieldWidget() {return this->shieldWidget;};
     44  inline OrxGui::GLGuiWidget* getArmorWidget() {return this->armorWidget;};
     45
    4246  void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL);
    4347
     
    5559  private:
    5660    void updateResolution();
     61    void createShipValuesBox();
    5762
    5863private:
Note: See TracChangeset for help on using the changeset viewer.