Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10486 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 29, 2007, 6:51:25 PM (18 years ago)
Author:
muellmic
Message:

weapons now set their gui- icon when mounted

Location:
branches/playability/src/world_entities/weapons
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/weapons/acid_launcher.cc

    r10419 r10486  
    3232
    3333#include "util/loading/factory.h"
     34
     35#include "elements/glgui_energywidgetvertical.h"
    3436
    3537
     
    122124void AcidLauncher::tick(float dt)
    123125{
     126  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     127  {
     128    this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png");
     129    this->isEnergyWidgetInitialized = true;
     130  }
     131
    124132  if (!Weapon::tickW(dt))
    125133    return;
  • branches/playability/src/world_entities/weapons/heavy_blaster.cc

    r10485 r10486  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315CREATE_FACTORY(HeavyBlaster);
     
    259261  glPopMatrix();
    260262}
     263
     264void HeavyBlaster::tick(float dt)
     265{
     266  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     267  {
     268    this->energyWidget->setDisplayedImage("textures/gui/gui_heavy_bolt.png");
     269    this->setEnergyWidgetInitialized(true);
     270  }
     271}
  • branches/playability/src/world_entities/weapons/heavy_blaster.h

    r10368 r10486  
    2929    virtual void fire();
    3030
     31    virtual void tick(float dt);
     32
    3133    virtual void draw() const;
    3234
  • branches/playability/src/world_entities/weapons/light_blaster.cc

    r10484 r10486  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315CREATE_FACTORY(LightBlaster);
     
    123125}
    124126
    125 
    126127void LightBlaster::fire()
    127128{
     
    173174    static_cast<StaticModel*>(this->getModel())->draw();
    174175  glPopMatrix();
     176
    175177}
     178
     179void LightBlaster::tick(float dt)
     180{
     181  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     182  {
     183    this->energyWidget->setDisplayedImage("textures/gui/gui_light_bolt.png");
     184    this->setEnergyWidgetInitialized(true);
     185  }
     186}
  • branches/playability/src/world_entities/weapons/light_blaster.h

    r10368 r10486  
    2626    virtual void fire();
    2727
     28    virtual void tick(float dt);
     29
    2830    virtual void draw() const;
    2931
  • branches/playability/src/world_entities/weapons/medium_blaster.cc

    r10485 r10486  
    1010
    1111#include "loading/fast_factory.h"
     12
     13#include "elements/glgui_energywidgetvertical.h"
    1214
    1315//
     
    138140}
    139141
     142
    140143/**
    141144 *  this activates the weapon
     
    172175  glPopMatrix();
    173176}
     177
     178void MediumBlaster::tick(float dt)
     179{
     180  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     181  {
     182    this->energyWidget->setDisplayedImage("textures/gui/gui_medium_bold.png");
     183    this->setEnergyWidgetInitialized(true);
     184  }
     185}
  • branches/playability/src/world_entities/weapons/medium_blaster.h

    r10368 r10486  
    2626    virtual void fire();
    2727
     28    virtual void tick(float dt);
     29
    2830    virtual void draw() const;
    2931
  • branches/playability/src/world_entities/weapons/spike_thrower.cc

    r10419 r10486  
    3434
    3535#include "util/loading/factory.h"
     36
     37#include "elements/glgui_energywidgetvertical.h"
    3638
    3739
     
    125127void SpikeThrower::tick(float dt)
    126128{
     129  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     130  {
     131    this->energyWidget->setDisplayedImage("textures/gui/gui_spikeball.png");
     132    this->isEnergyWidgetInitialized = true;
     133  }
     134
    127135  if (!Weapon::tickW(dt))
    128136    return;
  • branches/playability/src/world_entities/weapons/swarm_launcher.cc

    r10419 r10486  
    3333
    3434#include "util/loading/factory.h"
     35
     36#include "elements/glgui_energywidgetvertical.h"
    3537
    3638
     
    141143
    142144  this->setAbsDirSoft(quat, 5);
     145
     146  if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized)
     147  {
     148    this->energyWidget->setDisplayedImage("textures/gui/gui_swarm_missiles.png");
     149    this->setEnergyWidgetInitialized(true);
     150  }
    143151}
    144152
  • branches/playability/src/world_entities/weapons/weapon.cc

    r10443 r10486  
    154154
    155155  this->energyWidget = NULL;
     156  isEnergyWidgetInitialized = false;
    156157
    157158  // set this object to be synchronized over network
  • branches/playability/src/world_entities/weapons/weapon.h

    r10443 r10486  
    190190    inline int getPreferedSlot() { return this->preferedSlot; }
    191191
     192    inline void setEnergyWidgetInitialized(bool b) {this->isEnergyWidgetInitialized = b;};
     193
    192194
    193195  protected:
     
    207209
    208210    void setPreferedSlot(int slot, int side) { this->preferedSlot = slot; this->preferedSide = side; }
     211
     212    //gui
     213    OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
     214    bool  isEnergyWidgetInitialized;
    209215
    210216
     
    238244    float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
    239245
    240     OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
     246    //OrxGui::GLGuiEnergyWidgetVertical* energyWidget;
    241247
    242248    PNode*               defaultTarget;                    //!< A target for targeting Weapons.
Note: See TracChangeset for help on using the changeset viewer.