forked from mirror/openmw-tes3mp
add ability to check if a window is on the stack (to see if we're in the main menu)
This commit is contained in:
parent
f85679db93
commit
1bf36c686c
3 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,7 @@ namespace MWBase
|
|||
///< can be anywhere in the stack
|
||||
|
||||
virtual MWGui::GuiMode getMode() const = 0;
|
||||
virtual bool containsMode(MWGui::GuiMode) const = 0;
|
||||
|
||||
virtual bool isGuiMode() const = 0;
|
||||
|
||||
|
|
|
@ -965,6 +965,14 @@ MWGui::GuiMode WindowManager::getMode() const
|
|||
return mGuiModes.back();
|
||||
}
|
||||
|
||||
bool WindowManager::containsMode(GuiMode mode) const
|
||||
{
|
||||
if(mGuiModes.empty())
|
||||
return false;
|
||||
|
||||
return std::find(mGuiModes.begin(), mGuiModes.end(), mode) != mGuiModes.end();
|
||||
}
|
||||
|
||||
std::map<int, MWMechanics::Stat<float> > WindowManager::getPlayerSkillValues()
|
||||
{
|
||||
return mPlayerSkillValues;
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace MWGui
|
|||
virtual void removeGuiMode(GuiMode mode); ///< can be anywhere in the stack
|
||||
|
||||
virtual GuiMode getMode() const;
|
||||
virtual bool containsMode(GuiMode mode) const;
|
||||
|
||||
virtual bool isGuiMode() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue