Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6868


Ignore:
Timestamp:
May 10, 2010, 1:23:04 PM (14 years ago)
Author:
sfluecki
Message:

nochma test?

Location:
code/branches/hudelements/src/modules/overlays/hud
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc

    r6865 r6868  
    7272        this->wasOutOfView_ = true; // Ensure the material is changed right the first time..
    7373
    74         setFont("Monofur");
    75         setTextSize(0.05f);
    76         setNavMarkerSize(0.05f);
    77         setAimMarkerSize(0.04f);
     74
    7875*/
    7976/*
     
    8683       
    8784       
     85        setFont("Monofur");
     86        setTextSize(0.05f);
     87        setNavMarkerSize(0.05f);
     88//         setAimMarkerSize(0.04f);
    8889    }
    8990
     
    110111    void HUDNavigation::setFont(const std::string& font)
    111112    {
    112         if (this->navText_ && !font.empty())
    113             this->navText_->setFontName(font);
     113        fontName_ = font;
     114        if(!activeObjectList_.empty())
     115        {
     116          for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable)
     117           {
     118              if (tempRadarViewable->second.second && !fontName_.empty())
     119                tempRadarViewable->second.second->setFontName(fontName_);
     120           }
     121        }
    114122    }
    115123
    116124    const std::string& HUDNavigation::getFont() const
    117125    {
    118         if (this->navText_)
    119             return this->navText_->getFontName();
    120         else
    121             return BLANKSTRING;
     126        return fontName_;
    122127    }
    123128
    124129    void HUDNavigation::setTextSize(float size)
    125130    {
    126         if (this->navText_ && size >= 0.0f)
    127             this->navText_->setCharHeight(size);
     131      textSize_ = size;
     132      if(!activeObjectList_.empty())
     133        {
     134          for(tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable)
     135            {
     136              if (tempRadarViewable->second.second && size >= 0.0f)
     137                tempRadarViewable->second.second->setCharHeight(size);
     138            }
     139        }   
    128140    }
    129141
    130142    float HUDNavigation::getTextSize() const
    131143    {
    132         if (this->navText_)
    133             return this->navText_->getCharHeight();
    134         else
    135             return 0.0f;
     144      return textSize_;
    136145    }
    137146
  • code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h

    r6865 r6868  
    5757         inline float getRadarSensitivity() const{}
    5858         inline void radarTick(float dt) {}
     59         
    5960
    6061    private:
    6162
     63       
     64     
    6265        void sizeChanged();
    6366        void angleChanged() { }
     
    104107        activeObjectListType::iterator tempRadarViewable;
    105108       
     109        std::string fontName_;
     110        int textSize_;
     111       
    106112    };
    107113   
Note: See TracChangeset for help on using the changeset viewer.