mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 15:45:33 +00:00
Issue #294: show/hide HUD elements based on allowed windows
This commit is contained in:
parent
738e107b52
commit
3cba884f59
3 changed files with 9 additions and 5 deletions
|
@ -222,6 +222,11 @@ void WindowManager::updateVisible()
|
||||||
else
|
else
|
||||||
mToolTips->enterGuiMode();
|
mToolTips->enterGuiMode();
|
||||||
|
|
||||||
|
setMinimapVisibility((allowed & GW_Map) && !map->pinned());
|
||||||
|
setWeaponVisibility((allowed & GW_Inventory) && !mInventoryWindow->pinned());
|
||||||
|
setSpellVisibility((allowed & GW_Magic)); /// \todo add pin state when spells window is implemented
|
||||||
|
setHMSVisibility((allowed & GW_Stats) && !mStatsWindow->pinned());
|
||||||
|
|
||||||
// If in game mode, don't show anything.
|
// If in game mode, don't show anything.
|
||||||
if (gameMode)
|
if (gameMode)
|
||||||
return;
|
return;
|
||||||
|
@ -560,12 +565,13 @@ bool WindowManager::getFullHelp() const
|
||||||
|
|
||||||
void WindowManager::setWeaponVisibility(bool visible)
|
void WindowManager::setWeaponVisibility(bool visible)
|
||||||
{
|
{
|
||||||
hud->weapBox->setVisible(visible);
|
hud->setBottomLeftVisibility(hud->health->getVisible(), visible, hud->spellBox->getVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::setSpellVisibility(bool visible)
|
void WindowManager::setSpellVisibility(bool visible)
|
||||||
{
|
{
|
||||||
hud->spellBox->setVisible(visible);
|
hud->setBottomLeftVisibility(hud->health->getVisible(), hud->weapBox->getVisible(), visible);
|
||||||
|
hud->setBottomRightVisibility(visible, hud->minimapBox->getVisible());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::setMouseVisible(bool visible)
|
void WindowManager::setMouseVisible(bool visible)
|
||||||
|
|
|
@ -263,9 +263,6 @@ namespace MWGui
|
||||||
the start of the game, when windows are enabled one by one
|
the start of the game, when windows are enabled one by one
|
||||||
through script commands. You can manipulate this through using
|
through script commands. You can manipulate this through using
|
||||||
allow() and disableAll().
|
allow() and disableAll().
|
||||||
|
|
||||||
The setting should also affect visibility of certain HUD
|
|
||||||
elements, but this is not done yet.
|
|
||||||
*/
|
*/
|
||||||
GuiWindow allowed;
|
GuiWindow allowed;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace MWGui
|
||||||
public:
|
public:
|
||||||
WindowPinnableBase(const std::string& parLayout, WindowManager& parWindowManager);
|
WindowPinnableBase(const std::string& parLayout, WindowManager& parWindowManager);
|
||||||
void setVisible(bool b);
|
void setVisible(bool b);
|
||||||
|
bool pinned() { return mPinned; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName);
|
void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName);
|
||||||
|
|
Loading…
Reference in a new issue