mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 12:09:41 +00:00
WakeUpPc instruction
This commit is contained in:
parent
044ab3d2b6
commit
0c6ad13364
7 changed files with 31 additions and 2 deletions
|
@ -226,6 +226,7 @@ namespace MWBase
|
|||
virtual bool getRestEnabled() = 0;
|
||||
|
||||
virtual bool getPlayerSleeping() = 0;
|
||||
virtual void wakeUpPlayer() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace MWGui
|
|||
{
|
||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
||||
mProgressBar.setVisible (false);
|
||||
mWindowManager.popGuiMode ();
|
||||
mWindowManager.removeGuiMode (GM_Rest);
|
||||
mWaiting = false;
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
@ -215,4 +215,11 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
void WaitDialog::wakeUp ()
|
||||
{
|
||||
mSleeping = false;
|
||||
mWaiting = false;
|
||||
stopWaiting();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace MWGui
|
|||
void bedActivated() { setCanRest(true); }
|
||||
|
||||
bool getSleeping() { return mWaiting && mSleeping; }
|
||||
void wakeUp();
|
||||
|
||||
protected:
|
||||
MyGUI::TextBox* mDateTimeText;
|
||||
|
|
|
@ -956,6 +956,11 @@ bool WindowManager::getPlayerSleeping ()
|
|||
return mWaitDialog->getSleeping();
|
||||
}
|
||||
|
||||
void WindowManager::wakeUpPlayer()
|
||||
{
|
||||
mWaitDialog->wakeUp();
|
||||
}
|
||||
|
||||
void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
|
||||
{
|
||||
mMap->addVisitedLocation (name, x, y);
|
||||
|
|
|
@ -209,6 +209,7 @@ namespace MWGui
|
|||
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||
|
||||
virtual bool getPlayerSleeping();
|
||||
virtual void wakeUpPlayer();
|
||||
|
||||
private:
|
||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||
|
|
|
@ -205,5 +205,6 @@ op 0x200019e: PlaceAtMe Explicit
|
|||
op 0x200019f: GetPcSleep
|
||||
op 0x20001a0: ShowMap
|
||||
op 0x20001a1: FillMap
|
||||
opcodes 0x20001a2-0x3ffffff unused
|
||||
op 0x20001a2: WakeUpPc
|
||||
opcodes 0x20001a3-0x3ffffff unused
|
||||
|
||||
|
|
|
@ -31,6 +31,16 @@ namespace MWScript
|
|||
}
|
||||
};
|
||||
|
||||
class OpWakeUpPc : public Interpreter::Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager ()->wakeUpPlayer();
|
||||
}
|
||||
};
|
||||
|
||||
class OpXBox : public Interpreter::Opcode0
|
||||
{
|
||||
public:
|
||||
|
@ -261,6 +271,7 @@ namespace MWScript
|
|||
const int opcodeDontSaveObject = 0x2000153;
|
||||
const int opcodeToggleVanityMode = 0x2000174;
|
||||
const int opcodeGetPcSleep = 0x200019f;
|
||||
const int opcodeWakeUpPc = 0x20001a2;
|
||||
|
||||
void registerExtensions (Compiler::Extensions& extensions)
|
||||
{
|
||||
|
@ -286,6 +297,7 @@ namespace MWScript
|
|||
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
||||
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
||||
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
|
||||
extensions.registerInstruction ("wakeuppc", "", opcodeWakeUpPc);
|
||||
}
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
|
@ -307,6 +319,7 @@ namespace MWScript
|
|||
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
||||
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
||||
interpreter.installSegment5 (opcodeGetPcSleep, new OpGetPcSleep);
|
||||
interpreter.installSegment5 (opcodeWakeUpPc, new OpWakeUpPc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue