Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2008, 7:00:59 PM (16 years ago)
Author:
rgrieder
Message:

some adjustment to the default value setting in the overlay files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/hud/HUDBar.h

    r1626 r1627  
    6060    };
    6161
     62
    6263    class _OrxonoxExport HUDBar : public OrxonoxOverlay
    6364    {
     
    6869        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
    6970
    70         virtual void setValue(float value);
    7171        void clearColours();
    7272
    73         inline void setRightToLeft(bool r2l)
    74         { this->right2Left_ = r2l; this->setValue(this->value_); }
    75         inline bool getRightToLeft() const
    76         { return this->right2Left_; }
    77         inline float getValue() const
    78         { return this->value_; }
     73        void setRightToLeft(bool r2l) { this->right2Left_ = r2l; this->valueChanged(); }
     74        bool getRightToLeft() const   { return this->right2Left_; }
     75
     76        void setValue(float value)    { this->value_ = clamp(value, 0.0f, 1.0f); this->valueChanged(); }
     77        float getValue() const        { return this->value_; }
     78
     79        void setAutoColour(bool val)  { this->autoColour_ = val; this->valueChanged(); }
     80        bool getAutoColour() const    { return this->autoColour_; }
     81
     82    protected:
     83        virtual void valueChanged();
    7984
    8085    private:
     
    9196        std::vector<BarColour*> barColours_;
    9297
    93         float barWidth_s;
    94         float barHeight_s;
    95         float barOffsetLeft_s;
    96         float barOffsetTop_s;
    97 
    9898        static unsigned int materialcount_s;
    9999    };
Note: See TracChangeset for help on using the changeset viewer.