Changeset 10139 in orxonox.OLD for branches/playability/src/util
- Timestamp:
- Dec 22, 2006, 12:21:38 AM (18 years ago)
- Location:
- branches/playability/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/util/hud.cc
r10120 r10139 65 65 this->subscribeEvent(ES_ALL, SDLK_TAB); 66 66 67 this->shipValuesBox = new OrxGui::GLGuiBox(OrxGui::Vertical); 68 this->shipValuesBox->setBackgroundTexture("maps/gui_container_background.png"); 67 this->shipValuesBox = NULL; 69 68 } 70 69 … … 79 78 80 79 delete this->_radar; 80 delete this->shipValuesBox; 81 81 82 // delete what has to be deleted here 82 83 } … … 98 99 void Hud::setEnergyWidget(OrxGui::GLGuiWidget* widget) 99 100 { 101 if (this->shipValuesBox == NULL) 102 this->createShipValuesBox(); 100 103 // decopple old widget 101 104 if (this->energyWidget != NULL) … … 107 110 if (this->energyWidget != NULL) 108 111 { 109 this->energyWidget->show(); 110 this->energyWidget->shiftDir2D(270); 112 //this->energyWidget->shiftDir2D(270); 111 113 dynamic_cast<OrxGui::GLGuiEnergyWidgetVertical*> (this->energyWidget)->setDisplayedName("Electronics"); 112 114 this->shipValuesBox->pack(this->energyWidget); 115 this->energyWidget->show(); 113 116 /* this->energyWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png"); 114 117 this->energyWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ … … 120 123 void Hud::setShiledWidget(OrxGui::GLGuiWidget* widget) 121 124 { 125 if (this->shipValuesBox == NULL) 126 this->createShipValuesBox(); 122 127 // decopple old widget 123 128 if (this->shieldWidget != NULL) … … 129 134 if (this->shieldWidget != NULL) 130 135 { 136 //this->shieldWidget->shiftDir2D(270); 137 this->shipValuesBox->pack(this->shieldWidget); 131 138 this->shieldWidget->show(); 132 this->shieldWidget->shiftDir2D(270);133 this->shipValuesBox->pack(this->shieldWidget);134 139 /* this->shieldWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png"); 135 140 this->shieldWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ 136 141 } 142 else 143 printf("schild im hud nicht uebergeben!!!!!!!!!!!!!!!!!!!!!!!!!"); 137 144 138 145 this->updateResolution(); … … 141 148 void Hud::setArmorWidget(OrxGui::GLGuiWidget* widget) 142 149 { 150 if (this->shipValuesBox == NULL) 151 this->createShipValuesBox(); 152 143 153 // decopple old widget 144 154 if (this->armorWidget != NULL) … … 150 160 if (this->armorWidget != NULL) 151 161 { 162 //this->armorWidget->shiftDir2D(270); 163 this->shipValuesBox->pack(this->armorWidget); 152 164 this->armorWidget->show(); 153 this->armorWidget->shiftDir2D(270);154 //this->shipValuesBox->pack(this->armorWidget);155 165 /* this->armorWidget->frontMaterial().setDiffuseMap("hud_energy_bar.png"); 156 166 this->armorWidget->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);*/ … … 272 282 if (this->shipValuesBox != NULL) 273 283 { 274 this->shipValuesBox->setAbsCoor2D(0. 8 * this->resX, 0.85* this->resY);284 this->shipValuesBox->setAbsCoor2D(0.2 * this->resX, 0.4 * this->resY); 275 285 this->shipValuesBox->setWidgetSize(.4 * this->resX, 0.1 * this->resY); 276 286 } 287 else 288 createShipValuesBox(); 277 289 278 290 … … 309 321 // this->inputLine->select(); 310 322 } 311 312 313 } 314 315 323 } 324 325 void 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 40 40 void setShiledWidget(OrxGui::GLGuiWidget* widget); 41 41 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 42 46 void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL); 43 47 … … 55 59 private: 56 60 void updateResolution(); 61 void createShipValuesBox(); 57 62 58 63 private:
Note: See TracChangeset
for help on using the changeset viewer.