Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9872


Ignore:
Timestamp:
Dec 5, 2013, 8:46:18 PM (10 years ago)
Author:
jo
Message:

Making the countdown speed configurable.

Location:
code/branches/levelMichael
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/levelMichael/data/levels/Spacefight.oxw

    r9870 r9872  
    6464 <OverlayGroup name="spacefightHUD" scale = "1, 1">
    6565 <CountDown
    66      position  = "0.49, 0.05"
    67      pickpoint = "0.0, 0.0"
    68      font      = "ShareTechMono"
    69      textsize  = 0.06
    70      colour    = "1.0, 1.0, 1.0, 1.0"
    71      align     = "right"                 
    72      counter   = "10.0"
    73      active    = "false"
     66     position    = "0.49, 0.05"
     67     pickpoint   = "0.0, 0.0"
     68     font        = "ShareTechMono"
     69     textsize    = 0.06
     70     colour      = "1.0, 1.0, 1.0, 1.0"
     71     align       = "right"                 
     72     counter     = "10.0"
     73     speedfactor = "2.0"
     74     active      = "false"
    7475  >
    7576      <events>
  • code/branches/levelMichael/src/modules/overlays/hud/CountDown.cc

    r9870 r9872  
    3535        <OverlayGroup name="spacefightHUD" scale = "1, 1">
    3636          <CountDown
    37               position  = "0.49, 0.05"
    38               pickpoint = "0.0, 0.0"
    39               font      = "ShareTechMono"
    40               textsize  = 0.06
    41               colour    = "1.0, 1.0, 1.0, 1.0"
    42               align     = "right"                 
    43               counter   = "10.0"
    44               active    = "false"
     37              position    = "0.49, 0.05"
     38              pickpoint   = "0.0, 0.0"
     39              font        = "ShareTechMono"
     40              textsize    = 0.06
     41              colour      = "1.0, 1.0, 1.0, 1.0"
     42              align       = "right"                 
     43              counter     = "10.0"
     44              speedfactor = "1.0"
     45              active      = "false"
    4546           >
    4647            <events>
     
    8283        SUPER(CountDown, XMLPort, xmlelement, mode);
    8384        XMLPortParam(CountDown, "counter", setCounter, getCounter, xmlelement, mode).defaultValues(10);
     85        XMLPortParam(CountDown, "speedfactor", setSpeed, getSpeed, xmlelement, mode).defaultValues(1);
    8486    }
    8587   
     
    9799            else
    98100            {
    99                 this->counter_ -= dt;
     101                this->counter_ -= dt*speed_;
    100102                this->setCaption(multi_cast<std::string>((int)this->counter_)); //TODO: evtl. initialize with +0.5f
    101103            }
  • code/branches/levelMichael/src/modules/overlays/hud/CountDown.h

    r9870 r9872  
    5252            inline float getCounter() const
    5353                { return this->counter_; }
     54            inline void setSpeed(float value)
     55                { this->speed_ = value; }
     56            inline float getSpeed() const
     57                { return this->speed_; }
     58               
    5459        protected:
    5560
     
    5762            PlayerInfo* owner_;
    5863            float counter_;
     64            float speed_;
    5965            bool hasStopped_;
    6066    };
Note: See TracChangeset for help on using the changeset viewer.