Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10139 in orxonox.OLD for branches/playability/src/world_entities


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

trying to adjust interface

Location:
branches/playability/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/elements/glgui_energywidgetvertical.cc

    r10120 r10139  
    2929    //   this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget");
    3030
    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);
    3737    this->pack(&this->_name);
    3838    this->pack(&this->_valueText);
     
    4444
    4545    this->setBackgroundTexture(Texture());
    46     this->setBackgroundColor(Color(.5,.5,.5,0));
     46    this->setBackgroundColor(Color(.5,.5,.5,0.5));
    4747
    4848    //this->_name.setBackgroundTexture(Texture());
  • 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}
  • branches/playability/src/world_entities/world_entity.cc

    r10120 r10139  
    752752  {
    753753    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);
    757757
    758758    this->updateHealthWidget();
Note: See TracChangeset for help on using the changeset viewer.