Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5757


Ignore:
Timestamp:
Sep 20, 2009, 9:58:59 PM (15 years ago)
Author:
dafrick
Message:

Fixed issues with GUI. The problem was, that the Owner of the GUIOverlay is set properly only after it is constructed and thus was NULL. Now the player gets updated whenever toggleVisibility is called. Also getOwner() no longer returns a PlayerInfo* it returns a ControllableEntity*, so that had to be adjusted to as well.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/overlays/hudtemplates3.oxo

    r5695 r5757  
    9696    />
    9797
     98    <GUIOverlay
     99      name = "QuestGUI"
     100      guiname = "QuestGUI"
     101    />
     102
    98103  </OverlayGroup>
    99104</Template>
  • code/trunk/src/modules/overlays/GUIOverlay.cc

    r5738 r5757  
    3737#include "core/XMLPort.h"
    3838#include "infos/PlayerInfo.h"
     39#include "worldentities/ControllableEntity.h"
    3940
    4041namespace orxonox
     
    6263        SUPER(GUIOverlay, changedVisibility);
    6364
     65        //Setting player now.
     66        GUIManager::getInstance().setPlayer(this->guiName_, (orxonox_cast<ControllableEntity*>(this->getOwner()))->getPlayer());
     67
    6468        if (this->isVisible())
    6569        {
     
    8387    {
    8488        this->guiName_ = name;
    85         GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner()));
     89        GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner())); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well.
    8690    }
    8791}
Note: See TracChangeset for help on using the changeset viewer.