Changeset 10139 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 22, 2006, 12:21:38 AM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/elements/glgui_energywidgetvertical.cc
r10120 r10139 29 29 // this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget"); 30 30 31 32 33 this->_bar.setSize2D(100, 30);34 this->_name.setRelCoor2D(200,0);35 this-> _valueText.setRelCoor2D(22,0);36 31 //this->_bar.setSize2D(100, 30); 32 //this->_bar.setRelCoor2D(-10,0); 33 //this->_name.setRelCoor2D(20,0); 34 //this->_valueText.setRelCoor2D(,0); 35 this->shiftDir2D(270); 36 this->setOrientation(OrxGui::Horizontal); 37 37 this->pack(&this->_name); 38 38 this->pack(&this->_valueText); … … 44 44 45 45 this->setBackgroundTexture(Texture()); 46 this->setBackgroundColor(Color(.5,.5,.5,0 ));46 this->setBackgroundColor(Color(.5,.5,.5,0.5)); 47 47 48 48 //this->_name.setBackgroundTexture(Texture()); -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10133 r10139 232 232 233 233 // widget handling 234 /* 234 235 this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 235 236 this->electronicWidget->setDisplayedName(std::string(this->getClassName()) + " Electronics:"); … … 249 250 State::getPlayer()->hud().setEnergyWidget(this->electronicWidget); 250 251 } 252 */ 253 this->electronicWidget = NULL; 254 this->shieldWidget = NULL; 251 255 252 256 //add events to the eventlist … … 392 396 this->secWeaponMan.showCrosshair(); 393 397 this->toList( OM_GROUP_01 ); 398 dynamic_cast <OrxGui::GLGuiEnergyWidgetVertical*> (State::getPlayer()->hud().getArmorWidget())->setDisplayedName("Armor"); 394 399 //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true); 395 400 //this->attachCamera(); … … 1014 1019 void SpaceShip::updateElectronicWidget() 1015 1020 { 1016 this->electronicWidget->setMaximum(this->electronicMax); 1017 this->electronicWidget->setValue(this->electronicCur); 1018 if (this->hasPlayer()) 1019 this->electronicWidget->show(); 1021 if (this->electronicWidget != NULL) 1022 { //if it exists already: update it 1023 this->electronicWidget->setMaximum(this->electronicMax); 1024 this->electronicWidget->setValue(this->electronicCur); 1025 } 1026 else 1027 { //create the widget 1028 this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 1029 this->electronicWidget->setDisplayedName("Electronics:"); 1030 //this->electronicWidget->setSize2D(100,20); 1031 //this->electronicWidget->setAbsCoor2D(150,200); 1032 this->updateElectronicWidget(); 1033 if (this->hasPlayer()) 1034 State::getPlayer()->hud().setEnergyWidget(this->electronicWidget); 1035 } 1020 1036 } 1021 1037 1022 1038 void SpaceShip::updateShieldWidget() 1023 1039 { 1024 this->shieldWidget->setMaximum(this->shieldMax); 1025 this->shieldWidget->setValue(this->shieldCur); 1026 if (this->hasPlayer()) 1027 this->shieldWidget->show(); 1028 } 1040 if (this->shieldWidget != NULL) 1041 { 1042 this->shieldWidget->setMaximum(this->shieldMax); 1043 this->shieldWidget->setValue(this->shieldCur);; 1044 } 1045 else 1046 { 1047 this->shieldWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 1048 this->shieldWidget->setDisplayedName("Shield:"); 1049 //his->shieldWidget->setSize2D(100,20); 1050 //this->shieldWidget->setAbsCoor2D(200,200); 1051 this->updateShieldWidget(); 1052 if (this->hasPlayer()) 1053 State::getPlayer()->hud().setShiledWidget(this->shieldWidget); 1054 } 1055 } -
branches/playability/src/world_entities/world_entity.cc
r10120 r10139 752 752 { 753 753 this->healthWidget = new OrxGui::GLGuiEnergyWidgetVertical(); 754 this->healthWidget->setDisplayedName(" Electronics");755 this->healthWidget->setSize2D(30,400);756 this->healthWidget->setAbsCoor2D(100,200);754 this->healthWidget->setDisplayedName("Health"); 755 //this->healthWidget->setSize2D(100,20); 756 //this->healthWidget->setAbsCoor2D(100,200); 757 757 758 758 this->updateHealthWidget();
Note: See TracChangeset
for help on using the changeset viewer.