diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index ca5223a18..38ea74a57 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -743,3 +743,79 @@ void WindowManager::executeInConsole (const std::string& path) { mConsole->executeFile (path); } + +void WindowManager::wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) +{ + mFPS = fps; + mTriangleCount = triangleCount; + mBatchCount = batchCount; +} + +MyGUI::Gui* WindowManager::getGui() const { return mGui; } + +MWGui::DialogueWindow* WindowManager::getDialogueWindow() { return mDialogueWindow; } +MWGui::ContainerWindow* WindowManager::getContainerWindow() { return mContainerWindow; } +MWGui::InventoryWindow* WindowManager::getInventoryWindow() { return mInventoryWindow; } +MWGui::BookWindow* WindowManager::getBookWindow() { return mBookWindow; } +MWGui::ScrollWindow* WindowManager::getScrollWindow() { return mScrollWindow; } +MWGui::CountDialog* WindowManager::getCountDialog() { return mCountDialog; } +MWGui::ConfirmationDialog* WindowManager::getConfirmationDialog() { return mConfirmationDialog; } +MWGui::TradeWindow* WindowManager::getTradeWindow() { return mTradeWindow; } +MWGui::SpellWindow* WindowManager::getSpellWindow() { return mSpellWindow; } +MWGui::Console* WindowManager::getConsole() { return mConsole; } + +bool WindowManager::isAllowed (GuiWindow wnd) const +{ + return mAllowed & wnd; +} + +void WindowManager::allow (GuiWindow wnd) +{ + mAllowed = (GuiWindow)(mAllowed | wnd); + updateVisible(); +} + +void WindowManager::disallowAll() +{ + mAllowed = GW_None; + updateVisible(); +} + +void WindowManager::toggleVisible (GuiWindow wnd) +{ + mShown = (mShown & wnd) ? (GuiWindow) (mShown & ~wnd) : (GuiWindow) (mShown | wnd); + updateVisible(); +} + +bool WindowManager::isGuiMode() const +{ + return !mGuiModes.empty(); +} + +MWGui::GuiMode WindowManager::getMode() const +{ + if (mGuiModes.empty()) + throw std::runtime_error ("getMode() called, but there is no active mode"); + + return mGuiModes.back(); +} + +std::map > WindowManager::getPlayerSkillValues() +{ + return mPlayerSkillValues; +} + +std::map > WindowManager::getPlayerAttributeValues() +{ + return mPlayerAttributes; +} + +WindowManager::SkillList WindowManager::getPlayerMinorSkills() +{ + return mPlayerMinorSkills; +} + +WindowManager::SkillList WindowManager::getPlayerMajorSkills() +{ + return mPlayerMajorSkills; +} diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index 69a9717dd..60fc63c8c 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -100,61 +100,34 @@ namespace MWGui void popGuiMode(); void removeGuiMode(GuiMode mode); ///< can be anywhere in the stack - GuiMode getMode() const - { - if (mGuiModes.empty()) - throw std::runtime_error ("getMode() called, but there is no active mode"); - return mGuiModes.back(); - } + GuiMode getMode() const; - bool isGuiMode() const { return !mGuiModes.empty(); } + bool isGuiMode() const; - void toggleVisible(GuiWindow wnd) - { - mShown = (mShown & wnd) ? (GuiWindow) (mShown & ~wnd) : (GuiWindow) (mShown | wnd); - updateVisible(); - } + void toggleVisible(GuiWindow wnd); // Disallow all inventory mode windows - void disallowAll() - { - mAllowed = GW_None; - updateVisible(); - } + void disallowAll(); // Allow one or more windows - void allow(GuiWindow wnd) - { - mAllowed = (GuiWindow)(mAllowed | wnd); - updateVisible(); - } + void allow(GuiWindow wnd); - bool isAllowed(GuiWindow wnd) const - { - return mAllowed & wnd; - } + bool isAllowed(GuiWindow wnd) const; - MWGui::DialogueWindow* getDialogueWindow() {return mDialogueWindow;} - MWGui::ContainerWindow* getContainerWindow() {return mContainerWindow;} - MWGui::InventoryWindow* getInventoryWindow() {return mInventoryWindow;} - MWGui::BookWindow* getBookWindow() {return mBookWindow;} - MWGui::ScrollWindow* getScrollWindow() {return mScrollWindow;} - MWGui::CountDialog* getCountDialog() {return mCountDialog;} - MWGui::ConfirmationDialog* getConfirmationDialog() {return mConfirmationDialog;} - MWGui::TradeWindow* getTradeWindow() {return mTradeWindow;} - MWGui::SpellWindow* getSpellWindow() {return mSpellWindow;} - MWGui::Console* getConsole() {return mConsole;} + MWGui::DialogueWindow* getDialogueWindow(); + MWGui::ContainerWindow* getContainerWindow(); + MWGui::InventoryWindow* getInventoryWindow(); + MWGui::BookWindow* getBookWindow(); + MWGui::ScrollWindow* getScrollWindow(); + MWGui::CountDialog* getCountDialog(); + MWGui::ConfirmationDialog* getConfirmationDialog(); + MWGui::TradeWindow* getTradeWindow(); + MWGui::SpellWindow* getSpellWindow(); + MWGui::Console* getConsole(); - MyGUI::Gui* getGui() const { return mGui; } + MyGUI::Gui* getGui() const; - void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) - { - mFPS = fps; - mTriangleCount = triangleCount; - mBatchCount = batchCount; - } - -// MWMechanics::DynamicStat getValue(const std::string& id); + void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount); ///< Set value for the given ID. void setValue (const std::string& id, const MWMechanics::Stat& value); @@ -211,10 +184,10 @@ namespace MWGui void onFrame (float frameDuration); - std::map > getPlayerSkillValues() { return mPlayerSkillValues; } - std::map > getPlayerAttributeValues() { return mPlayerAttributes; } - SkillList getPlayerMinorSkills() { return mPlayerMinorSkills; } - SkillList getPlayerMajorSkills() { return mPlayerMajorSkills; } + std::map > getPlayerSkillValues(); + std::map > getPlayerAttributeValues(); + SkillList getPlayerMinorSkills(); + SkillList getPlayerMajorSkills(); /** * Fetches a GMST string from the store, if there is no setting with the given