mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-30 00:28:08 -04:00
enableRestMenu & enableLevelupMenu
This commit is contained in:
parent
9cf1cbc89b
commit
896428c129
@ -219,6 +219,9 @@ namespace MWBase
|
|||||||
|
|
||||||
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total) = 0;
|
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total) = 0;
|
||||||
virtual void loadingDone() = 0;
|
virtual void loadingDone() = 0;
|
||||||
|
|
||||||
|
virtual void enableRest() = 0;
|
||||||
|
virtual bool getRestEnabled() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ WindowManager::WindowManager(
|
|||||||
, mGarbageDialogs()
|
, mGarbageDialogs()
|
||||||
, mShown(GW_ALL)
|
, mShown(GW_ALL)
|
||||||
, mAllowed(newGame ? GW_None : GW_ALL)
|
, mAllowed(newGame ? GW_None : GW_ALL)
|
||||||
|
, mRestAllowed(newGame ? false : true)
|
||||||
, mShowFPSLevel(fpsLevel)
|
, mShowFPSLevel(fpsLevel)
|
||||||
, mFPS(0.0f)
|
, mFPS(0.0f)
|
||||||
, mTriangleCount(0)
|
, mTriangleCount(0)
|
||||||
|
@ -200,6 +200,9 @@ namespace MWGui
|
|||||||
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total);
|
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total);
|
||||||
virtual void loadingDone();
|
virtual void loadingDone();
|
||||||
|
|
||||||
|
virtual void enableRest() { mRestAllowed = true; }
|
||||||
|
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||||
HUD *mHud;
|
HUD *mHud;
|
||||||
@ -260,6 +263,8 @@ namespace MWGui
|
|||||||
allow() and disableAll().
|
allow() and disableAll().
|
||||||
*/
|
*/
|
||||||
GuiWindow mAllowed;
|
GuiWindow mAllowed;
|
||||||
|
// is the rest window allowed?
|
||||||
|
bool mRestAllowed;
|
||||||
|
|
||||||
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
|
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
|
||||||
|
|
||||||
|
@ -548,8 +548,11 @@ namespace MWInput
|
|||||||
|
|
||||||
void InputManager::rest()
|
void InputManager::rest()
|
||||||
{
|
{
|
||||||
if (!mWindows.isGuiMode ())
|
if (!mWindows.getRestEnabled () || mWindows.isGuiMode ())
|
||||||
mWindows.pushGuiMode (MWGui::GM_Rest);
|
return;
|
||||||
|
|
||||||
|
/// \todo check if resting is currently allowed (enemies nearby?)
|
||||||
|
mWindows.pushGuiMode (MWGui::GM_Rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::screenshot()
|
void InputManager::screenshot()
|
||||||
|
@ -30,6 +30,16 @@ namespace MWScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OpEnableRest : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager()->enableRest();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class OpShowDialogue : public Interpreter::Opcode0
|
class OpShowDialogue : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
MWGui::GuiMode mDialogue;
|
MWGui::GuiMode mDialogue;
|
||||||
@ -146,12 +156,8 @@ opcodeEnableStatsReviewMenu);
|
|||||||
interpreter.installSegment5 (opcodeEnableStatsMenu,
|
interpreter.installSegment5 (opcodeEnableStatsMenu,
|
||||||
new OpEnableWindow (MWGui::GW_Stats));
|
new OpEnableWindow (MWGui::GW_Stats));
|
||||||
|
|
||||||
/* Not done yet. Enabling rest mode is not really a gui
|
|
||||||
issue, it's a gameplay issue.
|
|
||||||
|
|
||||||
interpreter.installSegment5 (opcodeEnableRest,
|
interpreter.installSegment5 (opcodeEnableRest,
|
||||||
new OpEnableDialogue (MWGui::GM_Rest));
|
new OpEnableRest ());
|
||||||
*/
|
|
||||||
|
|
||||||
interpreter.installSegment5 (opcodeShowRestMenu,
|
interpreter.installSegment5 (opcodeShowRestMenu,
|
||||||
new OpShowDialogue (MWGui::GM_Rest));
|
new OpShowDialogue (MWGui::GM_Rest));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user