Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

trying to adjust interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10133 r10139  
    232232
    233233  // widget handling
     234  /*
    234235  this->electronicWidget = new OrxGui::GLGuiEnergyWidgetVertical();
    235236  this->electronicWidget->setDisplayedName(std::string(this->getClassName()) + " Electronics:");
     
    249250    State::getPlayer()->hud().setEnergyWidget(this->electronicWidget);
    250251  }
     252  */
     253  this->electronicWidget = NULL;
     254  this->shieldWidget = NULL;
    251255
    252256  //add events to the eventlist
     
    392396  this->secWeaponMan.showCrosshair();
    393397  this->toList( OM_GROUP_01 );
     398  dynamic_cast <OrxGui::GLGuiEnergyWidgetVertical*> (State::getPlayer()->hud().getArmorWidget())->setDisplayedName("Armor");
    394399  //dynamic_cast<Element2D*>(this->secWeaponMan.getFixedTarget())->setVisibility( true);
    395400  //this->attachCamera();
     
    10141019void SpaceShip::updateElectronicWidget()
    10151020{
    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  }
    10201036}
    10211037
    10221038void SpaceShip::updateShieldWidget()
    10231039{
    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}
Note: See TracChangeset for help on using the changeset viewer.