mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Merge remote-tracking branch 'potatoesmaster/pinning'
This commit is contained in:
commit
e9521dc8f1
4 changed files with 15 additions and 2 deletions
|
@ -94,16 +94,20 @@ namespace MWGui
|
|||
mGuiMode = mode;
|
||||
switch(mode) {
|
||||
case GM_Container:
|
||||
setPinButtonVisible(false);
|
||||
mMainWidget->setCoord(mPositionContainer);
|
||||
break;
|
||||
case GM_Companion:
|
||||
setPinButtonVisible(false);
|
||||
mMainWidget->setCoord(mPositionCompanion);
|
||||
break;
|
||||
case GM_Barter:
|
||||
setPinButtonVisible(false);
|
||||
mMainWidget->setCoord(mPositionBarter);
|
||||
break;
|
||||
case GM_Inventory:
|
||||
default:
|
||||
setPinButtonVisible(true);
|
||||
mMainWidget->setCoord(mPositionInventory);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -373,6 +373,7 @@ namespace MWGui
|
|||
{
|
||||
mMap->setVisible(mMap->pinned());
|
||||
mStatsWindow->setVisible(mStatsWindow->pinned());
|
||||
mInventoryWindow->setGuiMode(GM_None);
|
||||
mInventoryWindow->setVisible(mInventoryWindow->pinned());
|
||||
mSpellWindow->setVisible(mSpellWindow->pinned());
|
||||
|
||||
|
@ -1127,6 +1128,9 @@ namespace MWGui
|
|||
|
||||
void WindowManager::toggleVisible (GuiWindow wnd)
|
||||
{
|
||||
if (getMode() != GM_Inventory)
|
||||
return;
|
||||
|
||||
mShown = (mShown & wnd) ? (GuiWindow) (mShown & ~wnd) : (GuiWindow) (mShown | wnd);
|
||||
updateVisible();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
namespace MWGui
|
||||
{
|
||||
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
|
||||
: WindowBase(parLayout), mPinned(false), mVisible(false)
|
||||
: WindowBase(parLayout), mPinned(false)
|
||||
{
|
||||
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
|
||||
mPinButton = window->getSkinWidget ("Button");
|
||||
|
@ -24,4 +24,9 @@ namespace MWGui
|
|||
|
||||
onPinToggled();
|
||||
}
|
||||
|
||||
void WindowPinnableBase::setPinButtonVisible(bool visible)
|
||||
{
|
||||
mPinButton->setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ namespace MWGui
|
|||
public:
|
||||
WindowPinnableBase(const std::string& parLayout);
|
||||
bool pinned() { return mPinned; }
|
||||
void setPinButtonVisible(bool visible);
|
||||
|
||||
private:
|
||||
void onPinButtonClicked(MyGUI::Widget* _sender);
|
||||
|
@ -21,7 +22,6 @@ namespace MWGui
|
|||
|
||||
MyGUI::Widget* mPinButton;
|
||||
bool mPinned;
|
||||
bool mVisible;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue