Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2495


Ignore:
Timestamp:
Dec 17, 2008, 4:05:25 AM (15 years ago)
Author:
rgrieder
Message:

Added stats overlay. "OverlayGroup toggleVisibility Stats" will do what it says.

Location:
code/branches/presentation
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/OrxonoxPrereqs.h

    r2493 r2495  
    194194
    195195    class Scores;
     196    class CreateLines;
     197    class Scoreboard;
     198    class Stats;
    196199
    197200    // collision
  • code/branches/presentation/src/orxonox/objects/gametypes/Gametype.cc

    r2494 r2495  
    3535#include "core/CoreIncludes.h"
    3636#include "core/ConfigValueIncludes.h"
    37 #include "core/Loader.h"
    38 #include "core/XMLFile.h"
     37#include "core/Template.h"
     38#include "core/Core.h"
     39#include "overlays/OverlayGroup.h"
    3940#include "objects/infos/PlayerInfo.h"
    4041#include "objects/infos/Bot.h"
     
    6869        this->addBots(this->numberOfBots_);
    6970
    70         this->statsOverlay_ = 0;
    71 
    7271        setConfigValues();
    7372
    7473        // load the corresponding score board
    75         //this->statsOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/" + this->statsOverlayName_);
    76         //Loader::open(statsOverlay_);
    77         //this->setGametype(this);
     74        if (Core::showsGraphics() && this->scoreboardTemplate_ != "")
     75        {
     76            this->scoreboard_ = new OverlayGroup(this);
     77            this->scoreboard_->addTemplate(this->scoreboardTemplate_);
     78            this->scoreboard_->setGametype(this);
     79        }
     80        else
     81            this->scoreboard_ = 0;
    7882    }
    7983
     
    8488        SetConfigValue(bForceSpawn_, false);
    8589        SetConfigValue(numberOfBots_, 0);
    86         SetConfigValue(statsOverlayName_, "stats.oxo");
     90        SetConfigValue(scoreboardTemplate_, "defaultScoreboard");
    8791    }
    8892
     
    118122    void Gametype::playerEntered(PlayerInfo* player)
    119123    {
    120         this->players_[player] = PlayerState::Joined;
     124        this->players_[player].state_ = PlayerState::Joined;
    121125
    122126        std::string message = player->getName() + " entered the game";
     
    127131    void Gametype::playerLeft(PlayerInfo* player)
    128132    {
    129         std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(player);
     133        std::map<PlayerInfo*, Player>::iterator it = this->players_.find(player);
    130134        if (it != this->players_.end())
    131135        {
     
    188192        if (victim && victim->getPlayer())
    189193        {
    190             std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.find(victim->getPlayer());
     194            std::map<PlayerInfo*, Player>::iterator it = this->players_.find(victim->getPlayer());
    191195            if (it != this->players_.end())
    192196            {
    193                 it->second = PlayerState::Dead;
     197                it->second.state_ = PlayerState::Dead;
     198                it->second.killed_++;
     199
     200                // Reward killer
     201                if (killer)
     202                {
     203                    std::map<PlayerInfo*, Player>::iterator itKiller = this->players_.find(killer->getPlayer());
     204                    if (itKiller != this->players_.end())
     205                    {
     206                        this->playerScored(itKiller->second);
     207                    }
     208                    else
     209                        COUT(2) << "Warning: Killing Pawn was not in the playerlist" << std::endl;
     210                }
    194211
    195212                ControllableEntity* entity = this->defaultControllableEntity_.fabricate(victim->getCreator());
     
    211228    }
    212229
    213     void Gametype::playerScored(PlayerInfo* player)
    214     {
     230    void Gametype::playerScored(Player& player)
     231    {
     232        player.frags_++;
    215233    }
    216234
     
    234252    void Gametype::assignDefaultPawnsIfNeeded()
    235253    {
    236         for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     254        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    237255        {
    238256            if (!it->first->getControllableEntity())
    239257            {
    240                 it->second = PlayerState::Dead;
     258                it->second.state_ = PlayerState::Dead;
    241259
    242260                if (!it->first->isReadyToSpawn() || !this->gtinfo_.bStarted_)
     
    249267                        spawn->spawn(entity);
    250268                        it->first->startControl(entity);
    251                         it->second = PlayerState::Dead;
     269                        it->second.state_ = PlayerState::Dead;
    252270                    }
    253271                    else
     
    284302                    bool allplayersready = true;
    285303                    bool hashumanplayers = false;
    286                     for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     304                    for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    287305                    {
    288306                        if (!it->first->isReadyToSpawn())
     
    303321    void Gametype::spawnPlayersIfRequested()
    304322    {
    305         for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     323        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    306324            if (it->first->isReadyToSpawn() || this->bForceSpawn_)
    307325                this->spawnPlayer(it->first);
     
    310328    void Gametype::spawnDeadPlayersIfRequested()
    311329    {
    312         for (std::map<PlayerInfo*, PlayerState::Enum>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
    313             if (it->second == PlayerState::Dead)
     330        for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
     331            if (it->second.state_ == PlayerState::Dead)
    314332                if (it->first->isReadyToSpawn() || this->bForceSpawn_)
    315333                    this->spawnPlayer(it->first);
     
    322340        {
    323341            player->startControl(spawnpoint->spawn());
    324             this->players_[player] = PlayerState::Alive;
     342            this->players_[player].state_ = PlayerState::Alive;
    325343        }
    326344        else
  • code/branches/presentation/src/orxonox/objects/gametypes/Gametype.h

    r2492 r2495  
    5353    }
    5454
     55    struct Player
     56    {
     57        PlayerInfo* info_;
     58        PlayerState::Enum state_;
     59        int frags_;
     60        int killed_;
     61    };
     62
    5563    class _OrxonoxExport Gametype : public BaseObject, public Tickable
    5664    {
    5765        friend class PlayerInfo;
    58         friend class ClassIdentifier<Gametype>;
    5966
    6067        public:
     
    8289            virtual void playerChangedName(PlayerInfo* player);
    8390
    84             virtual void playerScored(PlayerInfo* player);
     91            virtual void playerScored(Player& player);
    8592
    8693            virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
     
    8895            virtual void pawnPostSpawn(Pawn* pawn);
    8996
    90             inline const std::map<PlayerInfo*, PlayerState::Enum>& getPlayers() const
     97            inline const std::map<PlayerInfo*, Player>& getPlayers() const
    9198                { return this->players_; }
    9299
     
    104111            inline unsigned int getNumberOfPlayers() const
    105112                { return this->players_.size(); }
    106 
    107             inline std::string getPlayersName() const
    108                 { return "StatsBot77"; }
    109 
    110             inline unsigned int getPlayersFrags() const
    111                 { return 123; }
    112113
    113114        private:
     
    131132            unsigned int numberOfBots_;
    132133
    133             std::map<PlayerInfo*, PlayerState::Enum> players_;
     134            std::map<PlayerInfo*, Player> players_;
    134135            std::set<SpawnPoint*> spawnpoints_;
    135136            SubclassIdentifier<ControllableEntity> defaultControllableEntity_;
    136137
    137             XMLFile* statsOverlay_;
     138            OverlayGroup* scoreboard_;
    138139
    139140            // Config Values
    140             std::string statsOverlayName_;
     141            std::string scoreboardTemplate_;
    141142    };
    142143}
  • code/branches/presentation/src/orxonox/overlays/stats/CreateLines.cc

    • Property svn:eol-style set to native
    r2492 r2495  
    3939#include "core/ConfigValueIncludes.h"
    4040
     41#include "overlays/OverlayText.h"
     42#include "overlays/stats/Stats.h"
     43
    4144namespace orxonox
    4245{
    43     CreateFactory(CreateLines);
    44 
    4546    /**
    4647        @brief Constructor: Creates a line.
    4748    */
    48     CreateLines::CreateLines(BaseObject* creator)
    49         : OrxonoxOverlay(creator)
     49    CreateLines::CreateLines(float leftOffset, float topOffset, float width, float height)
    5050    {
    51         RegisterObject(CreateLines);
     51        playerNameText_ = new OverlayText(0);
     52        playerNameText_->setTextSize(0.04);
     53        playerNameText_->setColour(ColourValue(0, 0.75, 0.2, 1));
     54        playerNameText_->setPosition(Vector2(0.1, topOffset + 0.01));
     55
     56        scoreText_ = new OverlayText(0);
     57        scoreText_->setTextSize(0.04);
     58        scoreText_->setColour(ColourValue(0, 0.75, 0.2, 1));
     59        scoreText_->setPosition(Vector2(0.6, topOffset + 0.01));
     60
     61        deathsText_ = new OverlayText(0);
     62        deathsText_->setTextSize(0.04);
     63        deathsText_->setColour(ColourValue(0, 0.75, 0.2, 1));
     64        deathsText_->setPosition(Vector2(0.8, topOffset + 0.01));
     65
     66        background_ = new Stats(0);
     67        background_->setPosition(Vector2(leftOffset, topOffset));
     68        background_->setSize(Vector2(width, height));
    5269    }
    5370
    54     /**
    55         @brief Initializes the lines.
    56     */
    57     void CreateLines::XMLPort(Element& xmlElement, XMLPort::Mode mode)
     71    CreateLines::~CreateLines()
    5872    {
    59         SUPER(CreateLines, XMLPort, xmlElement, mode);
     73        delete this->playerNameText_;
     74        delete this->scoreText_;
     75        delete this->deathsText_;
     76        delete this->background_;
     77    }
     78
     79    void CreateLines::setPlayerName(const std::string& str)
     80    {
     81        this->playerNameText_->setCaption(str);
     82    }
     83
     84    void CreateLines::setScore(const std::string& str)
     85    {
     86        this->scoreText_->setCaption(str);
     87    }
     88
     89    void CreateLines::setDeaths(const std::string& str)
     90    {
     91        this->deathsText_->setCaption(str);
     92    }
     93
     94    void CreateLines::setVisibility(bool visible)
     95    {
     96        this->scoreText_->setVisible(visible);
     97        this->deathsText_->setVisible(visible);
     98        this->playerNameText_->setVisible(visible);
     99        this->background_->setVisible(visible);
    60100    }
    61101
     
    63103        @brief Ensures that the number of OverlayElements is equal to numberOfColumns.
    64104    */
    65     void CreateLines::setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex) {
     105    //void CreateLines::setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex) {
    66106
    67         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
     107    //    Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
    68108
    69         unsigned int colIndex = 0;
     109    //    unsigned int colIndex = 0;
    70110
    71         while (textColumns_.size() < numberOfColumns) {
     111    //    while (textColumns_.size() < numberOfColumns)
     112    //    {
     113    //        Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex)));
     114    //        textColumns_.push_back(tempTextArea);
     115    //        this->background_->addChild(tempTextArea);
    72116
    73             Ogre::TextAreaOverlayElement* tempTextArea = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "StatsLineTextArea" + getName() + convertToString(lineIndex) + convertToString(colIndex)));
    74             textColumns_.push_back(tempTextArea);
    75             this->background_->addChild(tempTextArea);
     117    //        colIndex++;
     118    //    }
    76119
    77             colIndex++;
     120    //    while (textColumns_.size() > numberOfColumns)
     121    //    {
     122    //        this->background_->_removeChild(textColumns_.back());
     123    //        ovMan->destroyOverlayElement(textColumns_.back());
     124    //        textColumns_.pop_back();
     125    //    }
     126    //}
    78127
    79         }
     128    //void CreateLines::alignColumn(int columnIndex, float leftOffset, float topOffset)
     129    //{
     130    //    this->textColumns_[columnIndex]->setPosition(leftOffset, topOffset);
     131    //}
    80132
    81         while (textColumns_.size() > numberOfColumns) {
    82 
    83             this->background_->_removeChild(textColumns_.back());
    84             ovMan->destroyOverlayElement(textColumns_.back());
    85             textColumns_.pop_back();
    86 
    87         }
    88 
    89     }
    90 
    91     void CreateLines::alignColumn(int columnIndex, float leftOffset, float topOffset) {
    92 
    93         this->textColumns_[columnIndex]->setPosition(leftOffset, topOffset);
    94 
    95     }
    96 
    97     void CreateLines::setColumnText(int columnIndex, std::string columnText) {
    98 
    99         this->textColumns_[columnIndex]->setCaption(columnText);
    100 
    101     }
    102 
     133    //void CreateLines::setColumnText(int columnIndex, std::string columnText)
     134    //{
     135    //    this->textColumns_[columnIndex]->setCaption(columnText);
     136    //}
    103137}
  • code/branches/presentation/src/orxonox/overlays/stats/CreateLines.h

    • Property svn:eol-style set to native
    r2492 r2495  
    4040namespace orxonox
    4141{
    42     class _OrxonoxExport CreateLines : public OrxonoxOverlay
     42    class _OrxonoxExport CreateLines
    4343    {
    4444
    4545    public: // functions
    46         CreateLines(BaseObject* creator);
    47         virtual ~CreateLines() {}
     46        CreateLines(float, float, float, float);
     47        virtual ~CreateLines();
    4848
    49         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     49        void setPlayerName(const std::string&);
     50        void setScore(const std::string&);
     51        void setDeaths(const std::string&);
    5052
    51         void setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex);
    52         void alignColumn(int columnIndex, float leftOffset, float topOffset);
    53         void setColumnText(int columnIndex, std::string columnText);
     53        void setVisibility(bool);
     54
     55        //void setNumberOfColumns(unsigned int numberOfColumns, unsigned int lineIndex);
     56        //void alignColumn(int columnIndex, float leftOffset, float topOffset);
     57        //void setColumnText(int columnIndex, std::string columnText);
    5458
    5559    private: // functions
    5660
    5761    private: // variables
    58         std::vector<Ogre::TextAreaOverlayElement*> textColumns_;
     62        //std::vector<OverlayText*> textColumns_;
     63        OverlayText* playerNameText_;
     64        OverlayText* scoreText_;
     65        OverlayText* deathsText_;
     66
     67        Stats* background_;
    5968
    6069    };
  • code/branches/presentation/src/orxonox/overlays/stats/Scoreboard.cc

    • Property svn:eol-style set to native
    r2492 r2495  
    3939#include "core/ConfigValueIncludes.h"
    4040#include "objects/gametypes/Gametype.h"
     41#include "objects/infos/PlayerInfo.h"
    4142#include "CreateLines.h"
    4243
     
    5253    {
    5354        RegisterObject(Scoreboard);
    54 
    55         createlines_ = new CreateLines(this);
    56         // this->gametype_ = new Gametype(this);
     55        this->setGametype(creator->getGametype());
    5756    }
    5857
     
    6463        SUPER(Scoreboard, XMLPort, xmlElement, mode);
    6564
    66         printLines();
     65        COUT(0) << "XMLPort executed." << std::endl;
     66    }
    6767
    68         COUT(0) << "XMLPort executed." << std::endl;
     68    void Scoreboard::changedVisibility()
     69    {
     70        SUPER(Scoreboard, changedVisibility);
    6971
     72        for (unsigned int i = 0; i < this->lines_.size(); ++i)
     73            this->lines_[i]->setVisibility(this->isVisible());
    7074    }
    7175
     
    7377        @brief Prints the scoreboard on the screen.
    7478    */
    75     void Scoreboard::printLines() {
     79    void Scoreboard::tick(float dt)
     80    {
     81        const std::map<PlayerInfo*, Player>& playerList = this->getGametype()->getPlayers();
    7682
    77         numberOfColumns = 2;
    78         // numberOfLines = this->gametype_->getNumberOfPlayers();
    79         numberOfLines = 3;
    80         topOffset = 0.1;
    81         lineSpacing = 0.1;
    82 
    83         for (unsigned int i = 0; i < numberOfLines; i++) {
    84 
    85             columnIndex = 0;
    86             leftOffset = 0.1;
    87 
    88             this->createlines_->setNumberOfColumns(numberOfColumns, i);
    89 
    90             // columnText = this->gametype_->getPlayersName();
    91             columnText = "PlayerName";
    92             this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
    93             this->createlines_->setColumnText(columnIndex, columnText);
    94 
    95             columnIndex++;
    96             leftOffset = leftOffset + 0.3;
    97 
    98             // columnText = this->gametype_->getPlayersFrags();
    99             columnText = "PlayerFrags";
    100             this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
    101             this->createlines_->setColumnText(columnIndex, columnText);
    102 
    103             topOffset = topOffset + lineSpacing;
    104 
     83        const float topOffset  = 0.2;
     84        const float leftOffset = 0.075;
     85        const float distance   = 0.01;
     86        const float width      = 0.85;
     87        const float height     = 0.05;
     88        while (playerList.size() > this->lines_.size())
     89        {
     90            // create new lines
     91            this->lines_.push_back(new CreateLines(leftOffset, topOffset + (distance + height) * lines_.size(), width, height));
     92        }
     93        while (playerList.size() < this->lines_.size())
     94        {
     95            // destroy lines
     96            delete this->lines_.back();
     97            this->lines_.pop_back();
    10598        }
    10699
     100        // update board
     101
     102        unsigned int index = 0;
     103        for (std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)
     104        {
     105            this->lines_[index]->setPlayerName(omni_cast<std::string>(it->first->getName()));
     106            this->lines_[index]->setScore(omni_cast<std::string>(it->second.frags_));
     107            this->lines_[index]->setDeaths(omni_cast<std::string>(it->second.killed_));
     108            index++;
     109        }
     110
     111        //numberOfColumns = 2;
     112        //numberOfLines = 3;
     113        //topOffset = 0.1;
     114        //lineSpacing = 0.1;
     115
     116        //for (unsigned int i = 0; i < this->lines_.size(); ++i)
     117        //{
     118        //    columnIndex = 0;
     119        //    leftOffset = 0.1;
     120
     121        //    this->createlines_->setNumberOfColumns(numberOfColumns, i);
     122
     123        //    // columnText = this->gametype_->getPlayersName();
     124        //    columnText = "PlayerName";
     125        //    this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
     126        //    this->createlines_->setColumnText(columnIndex, columnText);
     127
     128        //    columnIndex++;
     129        //    leftOffset = leftOffset + 0.3;
     130
     131        //    // columnText = this->gametype_->getPlayersFrags();
     132        //    columnText = "PlayerFrags";
     133        //    this->createlines_->alignColumn(columnIndex, topOffset, leftOffset);
     134        //    this->createlines_->setColumnText(columnIndex, columnText);
     135
     136        //    topOffset = topOffset + lineSpacing;
     137        //}
    107138    }
    108 
    109139}
  • code/branches/presentation/src/orxonox/overlays/stats/Scoreboard.h

    • Property svn:eol-style set to native
    r2492 r2495  
    4040namespace orxonox
    4141{
    42     class _OrxonoxExport Scoreboard : public OrxonoxOverlay
     42    class _OrxonoxExport Scoreboard : public OrxonoxOverlay, public Tickable
    4343    {
    4444
    4545    public: // functions
    4646        Scoreboard(BaseObject* creator);
    47         ~Scoreboard() {}
     47        virtual ~Scoreboard() {}
    4848
    4949        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
     50        virtual void tick(float dt);
    5051
    5152        inline void setGametype(Gametype* gt)
     
    5960            { return this->createlines_; }
    6061
     62        virtual void changedVisibility();
     63
    6164    private: // functions
    6265        void printLines();
    6366
    6467    private: // variables
     68        std::vector<CreateLines*> lines_;
     69
    6570        unsigned int numberOfColumns;
    6671        unsigned int numberOfLines;
  • code/branches/presentation/src/orxonox/overlays/stats/Stats.cc

    r2492 r2495  
    5656
    5757        this->setConfigValues();
     58
     59        // create overlay and elements
     60        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
     61
     62        // create BorderPanel
     63        this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel" + getUniqueNumberString()));
     64        //this->statsOverlayBorder_->setMaterialName("StatsCenter");
     65        this->statsOverlayBorder_->setBorderSize(0.003, 16 * 0.003);
     66        this->statsOverlayBorder_->setBorderMaterialName("StatsBorder");
     67        this->statsOverlayBorder_->setTopBorderUV(0.49, 0.0, 0.51, 0.5);
     68        this->statsOverlayBorder_->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5);
     69        this->statsOverlayBorder_->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5);
     70        this->statsOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
     71        this->statsOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
     72        this->statsOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
     73        this->statsOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
     74        this->statsOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
     75
     76        background_->addChild(statsOverlayBorder_);
     77
     78        // create noise
     79        //this->statsOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "StatsNoise" + getUniqueNumberString()));
     80        //this->statsOverlayNoise_->setPosition(0,0);
     81        //this->statsOverlayNoise_->setMaterialName("StatsNoiseSmall");
     82        // comment following line to disable noise
     83        //background_->addChild(this->statsOverlayNoise_);
     84    }
     85
     86    Stats::~Stats()
     87    {
     88        if (this->isInitialized())
     89        {
     90            Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
     91            ovMan->destroyOverlayElement(this->statsOverlayBorder_);
     92            //ovMan->destroyOverlayElement(this->statsOverlayNoise_);
     93        }
    5894    }
    5995
     
    72108    {
    73109        OrxonoxOverlay::XMLPort(xmlElement, mode);
    74 
    75         // create overlay and elements
    76         Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
    77 
    78         // create BorderPanel
    79         this->statsOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "StatsBorderPanel"));
    80         this->statsOverlayBorder_->setMaterialName("StatsCenter");
    81         this->statsOverlayBorder_->setBorderSize(0.02, 0.02, 0.02, 0.02);
    82         this->statsOverlayBorder_->setBorderMaterialName("StatsBorder");
    83         this->statsOverlayBorder_->setTopBorderUV(0.49, 0.0, 0.51, 0.5);
    84         this->statsOverlayBorder_->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5);
    85         this->statsOverlayBorder_->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5);
    86         this->statsOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
    87         this->statsOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
    88         this->statsOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
    89         this->statsOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
    90         this->statsOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
    91 
    92         background_->addChild(statsOverlayBorder_);
    93 
    94         // create noise
    95         this->statsOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "StatsNoise"));
    96         this->statsOverlayNoise_->setPosition(0,0);
    97         this->statsOverlayNoise_->setMaterialName("StatsNoiseSmall");
    98         // comment following line to disable noise
    99         background_->addChild(this->statsOverlayNoise_);
    100 
    101110    }
    102111
     
    106115
    107116            // this creates a flickering effect (extracts exactly 80% of the texture at a random location)
    108             float uRand = (rand() & 1023) / 1023.0f * 0.2f;
    109             float vRand = (rand() & 1023) / 1023.0f * 0.2f;
    110             this->statsOverlayNoise_->setUV(uRand, vRand, 7.5f + uRand, 7.5f + vRand);
     117            //float uRand = (rand() & 1023) / 1023.0f * 0.2f;
     118            //float vRand = (rand() & 1023) / 1023.0f * 0.2f;
     119            //this->statsOverlayNoise_->setUV(uRand, vRand, 7.5f + uRand, 7.5f + vRand);
    111120    }
    112121
  • code/branches/presentation/src/orxonox/overlays/stats/Stats.h

    r2492 r2495  
    4646    public: // functions
    4747        Stats(BaseObject* creator);
    48         virtual ~Stats(){}
     48        virtual ~Stats();
    4949
    5050        void setConfigValues();
  • code/branches/presentation/visual_studio/vc8/orxonox.vcproj

    r2492 r2495  
    429429                                        </File>
    430430                                        <File
     431                                                RelativePath="..\..\src\orxonox\objects\weaponSystem\WeaponPack.cc"
     432                                                >
     433                                        </File>
     434                                        <File
    431435                                                RelativePath="..\..\src\orxonox\objects\weaponSystem\WeaponSet.cc"
    432436                                                >
     
    445449                                                <File
    446450                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\munitions\LaserGunMunition.cc"
     451                                                        >
     452                                                        <FileConfiguration
     453                                                                Name="Debug|Win32"
     454                                                                >
     455                                                                <Tool
     456                                                                        Name="VCCLCompilerTool"
     457                                                                />
     458                                                        </FileConfiguration>
     459                                                        <FileConfiguration
     460                                                                Name="Release|Win32"
     461                                                                >
     462                                                                <Tool
     463                                                                        Name="VCCLCompilerTool"
     464                                                                />
     465                                                        </FileConfiguration>
     466                                                </File>
     467                                        </Filter>
     468                                        <Filter
     469                                                Name="weapons"
     470                                                >
     471                                                <File
     472                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\LaserGun.cc"
     473                                                        >
     474                                                        <FileConfiguration
     475                                                                Name="Debug|Win32"
     476                                                                >
     477                                                                <Tool
     478                                                                        Name="VCCLCompilerTool"
     479                                                                />
     480                                                        </FileConfiguration>
     481                                                        <FileConfiguration
     482                                                                Name="Release|Win32"
     483                                                                >
     484                                                                <Tool
     485                                                                        Name="VCCLCompilerTool"
     486                                                                />
     487                                                        </FileConfiguration>
     488                                                </File>
     489                                                <File
     490                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\Missile.cc"
    447491                                                        >
    448492                                                        <FileConfiguration
     
    465509                                        </Filter>
    466510                                        <Filter
    467                                                 Name="weapons"
    468                                                 >
    469                                                 <File
    470                                                         RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\LaserGun.cc"
     511                                                Name="projectiles"
     512                                                >
     513                                                <File
     514                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\BillboardProjectile.cc"
    471515                                                        >
    472516                                                        <FileConfiguration
    473517                                                                Name="Debug|Win32"
    474                                                                 ExcludedFromBuild="true"
    475518                                                                >
    476519                                                                <Tool
     
    480523                                                        <FileConfiguration
    481524                                                                Name="Release|Win32"
    482                                                                 ExcludedFromBuild="true"
    483525                                                                >
    484526                                                                <Tool
     
    488530                                                </File>
    489531                                                <File
    490                                                         RelativePath="..\..\src\orxonox\objects\weaponSystem\weapons\Missile.cc"
     532                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\ParticleProjectile.cc"
    491533                                                        >
    492534                                                        <FileConfiguration
    493535                                                                Name="Debug|Win32"
    494                                                                 ExcludedFromBuild="true"
    495536                                                                >
    496537                                                                <Tool
     
    500541                                                        <FileConfiguration
    501542                                                                Name="Release|Win32"
    502                                                                 ExcludedFromBuild="true"
    503543                                                                >
    504544                                                                <Tool
     
    507547                                                        </FileConfiguration>
    508548                                                </File>
    509                                         </Filter>
    510                                         <Filter
    511                                                 Name="projectiles"
    512                                                 >
    513                                                 <File
    514                                                         RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\BillboardProjectile.cc"
     549                                                <File
     550                                                        RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\Projectile.cc"
    515551                                                        >
    516552                                                        <FileConfiguration
    517553                                                                Name="Debug|Win32"
    518                                                                 ExcludedFromBuild="true"
    519554                                                                >
    520555                                                                <Tool
     
    524559                                                        <FileConfiguration
    525560                                                                Name="Release|Win32"
    526                                                                 ExcludedFromBuild="true"
    527561                                                                >
    528562                                                                <Tool
     
    531565                                                        </FileConfiguration>
    532566                                                </File>
    533                                                 <File
    534                                                         RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\ParticleProjectile.cc"
    535                                                         >
    536                                                         <FileConfiguration
    537                                                                 Name="Debug|Win32"
    538                                                                 ExcludedFromBuild="true"
    539                                                                 >
    540                                                                 <Tool
    541                                                                         Name="VCCLCompilerTool"
    542                                                                 />
    543                                                         </FileConfiguration>
    544                                                         <FileConfiguration
    545                                                                 Name="Release|Win32"
    546                                                                 ExcludedFromBuild="true"
    547                                                                 >
    548                                                                 <Tool
    549                                                                         Name="VCCLCompilerTool"
    550                                                                 />
    551                                                         </FileConfiguration>
    552                                                 </File>
    553                                                 <File
    554                                                         RelativePath="..\..\src\orxonox\objects\weaponSystem\projectiles\Projectile.cc"
    555                                                         >
    556                                                         <FileConfiguration
    557                                                                 Name="Debug|Win32"
    558                                                                 ExcludedFromBuild="true"
    559                                                                 >
    560                                                                 <Tool
    561                                                                         Name="VCCLCompilerTool"
    562                                                                 />
    563                                                         </FileConfiguration>
    564                                                         <FileConfiguration
    565                                                                 Name="Release|Win32"
    566                                                                 ExcludedFromBuild="true"
    567                                                                 >
    568                                                                 <Tool
    569                                                                         Name="VCCLCompilerTool"
    570                                                                 />
    571                                                         </FileConfiguration>
    572                                                 </File>
    573567                                        </Filter>
    574568                                </Filter>
    575569                                <Filter
     570                                        Name="collisionShapes"
     571                                        >
     572                                        <File
     573                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\BoxCollisionShape.cc"
     574                                                >
     575                                        </File>
     576                                        <File
     577                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\CollisionShape.cc"
     578                                                >
     579                                        </File>
     580                                        <File
     581                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\CompoundCollisionShape.cc"
     582                                                >
     583                                        </File>
     584                                        <File
     585                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\ConeCollisionShape.cc"
     586                                                >
     587                                        </File>
     588                                        <File
     589                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\PlaneCollisionShape.cc"
     590                                                >
     591                                        </File>
     592                                        <File
     593                                                RelativePath="..\..\src\orxonox\objects\collisionshapes\SphereCollisionShape.cc"
     594                                                >
     595                                        </File>
     596                                </Filter>
     597                                <Filter
     598                                        Name="items"
     599                                        >
     600                                        <File
     601                                                RelativePath="..\..\src\orxonox\objects\items\Engine.cc"
     602                                                >
     603                                        </File>
     604                                        <File
     605                                                RelativePath="..\..\src\orxonox\objects\items\Item.cc"
     606                                                >
     607                                        </File>
     608                                        <File
     609                                                RelativePath="..\..\src\orxonox\objects\items\MultiStateEngine.cc"
     610                                                >
     611                                        </File>
     612                                </Filter>
     613                                <Filter
    576614                                        Name="quest"
    577615                                        >
     
    642680                                        <File
    643681                                                RelativePath="..\..\src\orxonox\objects\quest\Rewardable.cc"
    644                                                 >
    645                                         </File>
    646                                 </Filter>
    647                                 <Filter
    648                                         Name="collisionShapes"
    649                                         >
    650                                         <File
    651                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\BoxCollisionShape.cc"
    652                                                 >
    653                                         </File>
    654                                         <File
    655                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\CollisionShape.cc"
    656                                                 >
    657                                         </File>
    658                                         <File
    659                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\CompoundCollisionShape.cc"
    660                                                 >
    661                                         </File>
    662                                         <File
    663                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\ConeCollisionShape.cc"
    664                                                 >
    665                                         </File>
    666                                         <File
    667                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\PlaneCollisionShape.cc"
    668                                                 >
    669                                         </File>
    670                                         <File
    671                                                 RelativePath="..\..\src\orxonox\objects\collisionshapes\SphereCollisionShape.cc"
    672                                                 >
    673                                         </File>
    674                                 </Filter>
    675                                 <Filter
    676                                         Name="items"
    677                                         >
    678                                         <File
    679                                                 RelativePath="..\..\src\orxonox\objects\items\Engine.cc"
    680                                                 >
    681                                         </File>
    682                                         <File
    683                                                 RelativePath="..\..\src\orxonox\objects\items\Item.cc"
    684                                                 >
    685                                         </File>
    686                                         <File
    687                                                 RelativePath="..\..\src\orxonox\objects\items\MultiStateEngine.cc"
    688682                                                >
    689683                                        </File>
     
    843837                                        >
    844838                                        <File
     839                                                RelativePath="..\..\src\orxonox\overlays\stats\CreateLines.cc"
     840                                                >
     841                                        </File>
     842                                        <File
     843                                                RelativePath="..\..\src\orxonox\overlays\stats\Scoreboard.cc"
     844                                                >
     845                                        </File>
     846                                        <File
    845847                                                RelativePath="..\..\src\orxonox\overlays\stats\Stats.cc"
    846848                                                >
     
    14761478                                        Name="stats"
    14771479                                        >
     1480                                        <File
     1481                                                RelativePath="..\..\src\orxonox\overlays\stats\CreateLines.h"
     1482                                                >
     1483                                        </File>
     1484                                        <File
     1485                                                RelativePath="..\..\src\orxonox\overlays\stats\Scoreboard.h"
     1486                                                >
     1487                                        </File>
    14781488                                        <File
    14791489                                                RelativePath="..\..\src\orxonox\overlays\stats\Stats.h"
Note: See TracChangeset for help on using the changeset viewer.