forked from mirror/openmw-tes3mp
implemented GetPCSleep
This commit is contained in:
parent
bf5e30b24f
commit
be44810623
6 changed files with 27 additions and 1 deletions
|
@ -222,6 +222,8 @@ namespace MWBase
|
||||||
|
|
||||||
virtual void enableRest() = 0;
|
virtual void enableRest() = 0;
|
||||||
virtual bool getRestEnabled() = 0;
|
virtual bool getRestEnabled() = 0;
|
||||||
|
|
||||||
|
virtual bool getPlayerSleeping() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ namespace MWGui
|
||||||
|
|
||||||
void bedActivated() { setCanRest(true); }
|
void bedActivated() { setCanRest(true); }
|
||||||
|
|
||||||
|
bool getSleeping() { return mWaiting && mSleeping; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MyGUI::TextBox* mDateTimeText;
|
MyGUI::TextBox* mDateTimeText;
|
||||||
MyGUI::TextBox* mRestText;
|
MyGUI::TextBox* mRestText;
|
||||||
|
|
|
@ -946,3 +946,8 @@ void WindowManager::loadingDone ()
|
||||||
{
|
{
|
||||||
mLoadingScreen->loadingDone ();
|
mLoadingScreen->loadingDone ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WindowManager::getPlayerSleeping ()
|
||||||
|
{
|
||||||
|
return mWaitDialog->getSleeping();
|
||||||
|
}
|
||||||
|
|
|
@ -204,6 +204,8 @@ namespace MWGui
|
||||||
virtual void enableRest() { mRestAllowed = true; }
|
virtual void enableRest() { mRestAllowed = true; }
|
||||||
virtual bool getRestEnabled() { return mRestAllowed; }
|
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||||
|
|
||||||
|
virtual bool getPlayerSleeping();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||||
HUD *mHud;
|
HUD *mHud;
|
||||||
|
|
|
@ -202,5 +202,6 @@ op 0x200019b: PlaceItem
|
||||||
op 0x200019c: PlaceAtPc
|
op 0x200019c: PlaceAtPc
|
||||||
op 0x200019d: PlaceAtMe
|
op 0x200019d: PlaceAtMe
|
||||||
op 0x200019e: PlaceAtMe Explicit
|
op 0x200019e: PlaceAtMe Explicit
|
||||||
opcodes 0x200019f-0x3ffffff unused
|
op 0x200019f: GetPcSleep
|
||||||
|
opcodes 0x20001a0-0x3ffffff unused
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <components/interpreter/opcodes.hpp>
|
#include <components/interpreter/opcodes.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
|
@ -20,6 +21,16 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
namespace Misc
|
namespace Misc
|
||||||
{
|
{
|
||||||
|
class OpGetPcSleep : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
runtime.push (MWBase::Environment::get().getWindowManager ()->getPlayerSleeping());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class OpXBox : public Interpreter::Opcode0
|
class OpXBox : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -249,6 +260,7 @@ namespace MWScript
|
||||||
const int opcodeTogglePathgrid = 0x2000146;
|
const int opcodeTogglePathgrid = 0x2000146;
|
||||||
const int opcodeDontSaveObject = 0x2000153;
|
const int opcodeDontSaveObject = 0x2000153;
|
||||||
const int opcodeToggleVanityMode = 0x2000174;
|
const int opcodeToggleVanityMode = 0x2000174;
|
||||||
|
const int opcodeGetPcSleep = 0x200019f;
|
||||||
|
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
|
@ -273,6 +285,7 @@ namespace MWScript
|
||||||
extensions.registerInstruction ("dontsaveobject", "", opcodeDontSaveObject);
|
extensions.registerInstruction ("dontsaveobject", "", opcodeDontSaveObject);
|
||||||
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
||||||
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
||||||
|
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
@ -293,6 +306,7 @@ namespace MWScript
|
||||||
interpreter.installSegment5 (opcodeToggleWater, new OpToggleWater);
|
interpreter.installSegment5 (opcodeToggleWater, new OpToggleWater);
|
||||||
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
||||||
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
||||||
|
interpreter.installSegment5 (opcodeGetPcSleep, new OpGetPcSleep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue