- Timestamp:
- Jun 21, 2007, 5:20:30 AM (18 years ago)
- Location:
- branches/presentation/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/util/hud.cc
r10764 r10766 34 34 35 35 #include "tools/camera.h" 36 #include "multi_type.h" 36 37 37 38 … … 155 156 this->rightHit->setParent2D(this->middleRect); 156 157 158 this->healthText = new OrxGui::GLGuiText(); 159 this->healthText->setParent2D(this->barSocket); 160 161 this->shieldText = new OrxGui::GLGuiText(); 162 this->shieldText->setParent2D(this->barSocket); 163 157 164 158 165 this->leftRect->setParent2D(this); … … 218 225 this->shieldWidget->setBackgroundColor(Color(0,0,0,0)); 219 226 this->shieldWidget->setForegroundTexture("textures/gui/gui_element_background_faded.png"); 220 this->shieldWidget->setForegroundColor(Color(1,1,0, 1));227 this->shieldWidget->setForegroundColor(Color(1,1,0,0.5)); 221 228 dynamic_cast<OrxGui::GLGuiBar*>(this->shieldWidget)->setChangedValueColor(Color(1,0,0,0.2)); 222 this->shieldWidget->setWidgetSize(150, 20);229 this->shieldWidget->setWidgetSize(150,40); 223 230 this->shieldWidget->setRelDir2D(180); 224 231 this->shieldWidget->setParent2D(this->barSocket); 232 233 this->shieldText->setTextSize(50); 234 this->shieldText->setChangedTextColor(Color::white); 235 this->shieldText->setForegroundColor(Color(1,1,0,1)); 236 this->shieldText->setBackgroundTexture(Texture()); 237 this->shieldText->setBackgroundColor(Color(0,0,0,0)); 238 MultiType val(dynamic_cast<OrxGui::GLGuiBar*>(this->shieldWidget)->value()); 239 val.setType(MT_INT); 240 this->shieldText->setText(val.getString()); 225 241 } 226 242 else … … 274 290 this->healthWidget->setRelDir2D(180); 275 291 this->healthWidget->setParent2D(this->barSocket); 292 293 this->healthText->setTextSize(80); 294 this->healthText->setChangedTextColor(Color::white); 295 this->healthText->setForegroundColor(Color::red); 296 this->healthText->setBackgroundTexture(Texture()); 297 this->healthText->setBackgroundColor(Color(0,0,0,0)); 298 MultiType val(dynamic_cast<OrxGui::GLGuiBar*>(this->healthWidget)->value()); 299 val.setType(MT_INT); 300 this->healthText->setText(val.getString()); 276 301 } 277 302 else … … 494 519 void Hud::getHit() 495 520 { 496 printf("Got hit!\n");497 521 this->leftHit->show(); 498 522 this->rightHit->show(); … … 710 734 else 711 735 this->barSocket->hide(); 712 713 this->healthWidget->setRelCoor2D(50,70);714 this->healthWidget->show();715 736 if (this->shieldWidget) 716 737 { 717 this->shieldWidget->setRelCoor2D(40,110); 718 this->shieldWidget->show(); 738 this->shieldWidget->setRelCoor2D(40,overlayWidth/2+10); 739 if (!this->hidden) 740 this->shieldWidget->show(); 741 else 742 this->shieldWidget->hide(); 743 this->shieldText->setRelCoor2D(overlayWidth/2-30,overlayWidth/2-60); 744 if (!this->hidden) 745 this->shieldText->show(); 746 else 747 this->shieldText->hide(); 719 748 } 749 this->healthWidget->setRelCoor2D(40,overlayWidth/2); 750 if (!this->hidden) 751 this->healthWidget->show(); 752 else 753 this->healthWidget->hide(); 754 this->healthText->setRelCoor2D(overlayWidth/2-50,overlayWidth/2-20); 755 if (!this->hidden) 756 this->healthText->show(); 757 else 758 this->healthText->hide(); 759 720 760 } 721 761 … … 742 782 createShipValuesBox(); 743 783 */ 744 784 if (this->playmode != FirstPerson ) 785 { 745 786 std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget; 746 787 Vector2D pos = Vector2D(overlayWidth, 0.4*this->resY); … … 800 841 //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName()); 801 842 } 843 } 844 else 845 { 846 std::list<OrxGui::GLGuiEnergyWidgetVertical*>::iterator weaponWidget; 847 Vector2D pos = Vector2D(overlayWidth, 0.4*this->resY); 848 float largestWidgetSizeX = 0; 849 850 for (weaponWidget = this->weaponsWidgetsPrim.begin(); weaponWidget != this->weaponsWidgetsPrim.end(); weaponWidget++) 851 { 852 (*weaponWidget)->setParent2D(this->barSocket); 853 (*weaponWidget)->setRelCoor2D(overlayWidth/2, 0); 854 //(*weaponWidget)->setAbsCoor2D(0,100); 855 if (!this->hidden) 856 (*weaponWidget)->show(); 857 else 858 (*weaponWidget)->hide(); 859 //printf("update thing %s::%s\n", (*weaponWidget)->getClassCName(), (*weaponWidget)->getName()); 860 } 861 } 802 862 803 863 } -
branches/presentation/src/util/hud.h
r10764 r10766 114 114 OrxGui::GLGuiWidget* healthWidget; 115 115 OrxGui::GLGuiWidget* implantWidget; 116 OrxGui::GLGuiText* energyText; 116 OrxGui::GLGuiText* healthText; 117 OrxGui::GLGuiText* shieldText; 117 118 118 119 OrxGui::GLGuiNotifier* notifier;
Note: See TracChangeset
for help on using the changeset viewer.