Changeset 10748 in orxonox.OLD for branches/presentation/src
- Timestamp:
- Jun 20, 2007, 10:11:59 PM (17 years ago)
- Location:
- branches/presentation/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/util/hud.cc
r10744 r10748 58 58 this->resX = 1; 59 59 this->resY = 1; 60 this->leftHit = NULL; 61 this->rightHit = NULL; 62 this->ifinit = true; 60 63 61 64 this->init(); … … 72 75 delete this->inputLine; 73 76 delete this->notifier; 74 delete this->leftHit;75 delete this->rightHit;77 //delete this->leftHit; 78 //delete this->rightHit; 76 79 77 80 delete this->_radar; … … 133 136 this->leftHit->loadImageFromFile("textures/gui/gui_hitbar.png"); 134 137 this->leftHit->setParent2D(this->middleRect); 135 this->leftHit->shiftDir2D(0.5);138 136 139 137 140 this->rightHit = new OrxGui::GLGuiImage(); … … 438 441 this->leftHit->show(); 439 442 this->rightHit->show(); 443 hitBarCount = 0.33; 444 } 445 446 void Hud::tick(float dt) 447 { 448 449 if (this->playmode == FirstPerson && this->leftHit != NULL) 450 { 451 if (this->ifinit) 452 { 453 this->leftHit->shiftDir2D(3.1416); 454 this->ifinit = false; 455 } 456 if (this->leftHit->isVisible()) 457 hitBarCount -= dt; 458 if (hitBarCount < 0) 459 { 460 hitBarCount = 0; 461 this->leftHit->hide(); 462 this->rightHit->hide(); 463 } 464 } 440 465 } 441 466 … … 502 527 this->leftHit->setRelCoor2D(0, 0); 503 528 this->leftHit->setWidgetSize(this->resX/9, this->resX/3); 504 this->leftHit-> show();529 this->leftHit->hide(); 505 530 this->rightHit->setRelCoor2D(this->resX/3, 0); 506 531 this->rightHit->setWidgetSize(this->resX/9, this->resX/3); … … 509 534 this->barSocket->setWidgetSize(overlayWidth, overlayWidth); 510 535 this->barSocket->setRelCoor2D(this->resX - overlayWidth, 0); 511 this->barSocket-> hide();536 this->barSocket->show(); 512 537 513 538 //this->middleRect->show(); -
branches/presentation/src/util/hud.h
r10744 r10748 52 52 void getHit(); 53 53 54 void tick(float dt); 55 54 56 void setBackGround(); 55 57 void setEnergyWidget(OrxGui::GLGuiWidget* widget); … … 101 103 unsigned int resX; 102 104 unsigned int resY; 105 106 float hitBarCount; 103 107 104 108 Hud::Playmode playmode; … … 115 119 OrxGui::GLGuiRadar* _radar; 116 120 PNode* radarCenterNode; 121 122 bool ifinit; 117 123 118 124 OrxGui::GLGuiWidget* rightRect; -
branches/presentation/src/world_entities/creatures/fps_player.cc
r10744 r10748 328 328 } 329 329 330 /*330 331 331 if( this->bFire2 ) 332 332 { … … 353 353 { 354 354 this->changeZoom = true; 355 } */356 if( this->bFire2 )355 } 356 /*if( this->bFire2 ) 357 357 { 358 358 if( this->changeZoom ) … … 378 378 this->changeZoom = true; 379 379 this->changingZoom = false; 380 } 381 382 this->getWeaponManager().tick(time);380 }*/ 381 382 /*this->getWeaponManager().tick(time); 383 383 if( this->bFire) 384 384 { 385 385 this->getWeaponManager().fire(); 386 } 386 }*/ 387 Playable::tick(time); 387 388 388 389 … … 448 449 else 449 450 speed = 100; 451 452 velocity.normalize(); 450 453 velocity *= speed; 451 454 -
branches/presentation/src/world_entities/playable.cc
r10618 r10748 451 451 if (this->bFire) 452 452 weaponMan.fire(); 453 454 if (currentPlayer != NULL) 455 currentPlayer->hud().tick(dt); 453 456 } 454 457
Note: See TracChangeset
for help on using the changeset viewer.