mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-10 07:13:53 +00:00
added GetButtonPressed function
This commit is contained in:
parent
058822b676
commit
aded4608c0
@ -108,4 +108,5 @@ op 0x2000133: Journal
|
||||
op 0x2000134: SetJournalIndex
|
||||
op 0x2000135: GetJournalIndex
|
||||
op 0x2000136: GetPCCell
|
||||
opcodes 0x2000137-0x3ffffff unused
|
||||
op 0x2000137: GetButtonPressed
|
||||
opcodes 0x2000138-0x3ffffff unused
|
||||
|
@ -52,6 +52,21 @@ namespace MWScript
|
||||
}
|
||||
};
|
||||
|
||||
class OpGetButtonPressed : public Interpreter::Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
InterpreterContext& context =
|
||||
static_cast<InterpreterContext&> (runtime.getContext());
|
||||
|
||||
MWWorld::Ptr ptr = context.getReference();
|
||||
|
||||
runtime.push (context.getWindowManager().readPressedButton());
|
||||
}
|
||||
};
|
||||
|
||||
const int opcodeEnableBirthMenu = 0x200000e;
|
||||
const int opcodeEnableClassMenu = 0x200000f;
|
||||
const int opcodeEnableNameMenu = 0x2000010;
|
||||
@ -63,6 +78,7 @@ namespace MWScript
|
||||
const int opcodeEnableStatsMenu = 0x2000016;
|
||||
const int opcodeEnableRest = 0x2000017;
|
||||
const int opcodeShowRestMenu = 0x2000018;
|
||||
const int opcodeGetButtonPressed = 0x2000137;
|
||||
|
||||
void registerExtensions (Compiler::Extensions& extensions)
|
||||
{
|
||||
@ -82,6 +98,8 @@ namespace MWScript
|
||||
extensions.registerInstruction ("enablelevelupmenu", "", opcodeEnableRest);
|
||||
|
||||
extensions.registerInstruction ("showrestmenu", "", opcodeShowRestMenu);
|
||||
|
||||
extensions.registerFunction ("getbuttonpressed", 'l', "", opcodeGetButtonPressed);
|
||||
}
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
@ -115,6 +133,8 @@ namespace MWScript
|
||||
|
||||
interpreter.installSegment5 (opcodeShowRestMenu,
|
||||
new OpShowDialogue (MWGui::GM_Rest));
|
||||
|
||||
interpreter.installSegment5 (opcodeGetButtonPressed, new OpGetButtonPressed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user