Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9965 in orxonox.OLD for branches/playability/src/util


Ignore:
Timestamp:
Nov 28, 2006, 11:54:34 PM (18 years ago)
Author:
marcscha
Message:

Modifications to ship, HUD,.. see changelog

Location:
branches/playability/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/util/hud.cc

    r9869 r9965  
    4545  //this->setSize2D(
    4646  this->weaponManager = NULL;
     47  this->weaponManagerSecondary = NULL;
    4748  this->energyWidget = NULL;
    4849  this->shieldWidget = NULL;
     
    118119{}
    119120
    120 void Hud::setWeaponManager(WeaponManager* weaponMan)
     121void Hud::setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec)
    121122{
    122123  if (this->weaponManager != NULL)
     
    133134  }
    134135
     136  if (this->weaponManagerSecondary != NULL)
     137  {
     138    for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++)
     139    {
     140      Weapon* weapon = this->weaponManagerSecondary->getWeapon(i);
     141      if (weapon != NULL)
     142      {
     143        weapon->getEnergyWidget()->hide();
     144        this->weaponsWidgets.remove(weapon->getEnergyWidget());
     145      }
     146    }
     147  }
     148
    135149  this->weaponManager = weaponMan;
     150  this->weaponManagerSecondary = weaponManSec;
    136151
    137152  this->updateWeaponManager();
     
    164179      }
    165180    }
     181
     182  if (this->weaponManagerSecondary != NULL)
     183    for (unsigned int i = 0; i < this->weaponManagerSecondary->getSlotCount(); i++)
     184    {
     185      Weapon* weapon = this->weaponManagerSecondary->getWeapon(i);
     186      if (weapon != NULL)
     187      {
     188        //PRINTF(0)("WEAPON %s::%s in Slots\n", weapon->getClassCName(), weapon->getName());
     189        weapon->getEnergyWidget()->show();
     190        weapon->getEnergyWidget()->setBackgroundColor(Color(.8,.2,.11, 0.1));
     191        weapon->getEnergyWidget()->setFrontColor(Color( .2,.5,.7,.6));
     192        //      weapon->getEnergyWidget()->frontMaterial().setTransparency(.6);
     193        this->weaponsWidgets.push_back(weapon->getEnergyWidget());
     194      }
     195    }
     196
    166197  this->updateResolution();
     198
    167199}
    168200
  • branches/playability/src/util/hud.h

    r9869 r9965  
    3939  void setShiledWidget(OrxGui::GLGuiWidget* widget);
    4040  void setArmorWidget(OrxGui::GLGuiWidget* widget);
    41   void setWeaponManager(WeaponManager* weaponMan);
     41  void setWeaponManager(WeaponManager* weaponMan, WeaponManager* weaponManSec = NULL);
    4242
    4343  void addWeaponWidget(OrxGui::GLGuiWidget* widget);
     
    6868
    6969  WeaponManager*           weaponManager;
     70  WeaponManager*           weaponManagerSecondary;
    7071
    7172  std::list<OrxGui::GLGuiWidget*> weaponsWidgets; //!< WeaponWidgets will be displayed one after another
Note: See TracChangeset for help on using the changeset viewer.