|
|
|
@ -207,6 +207,29 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class OpToggleVanityMode : public Interpreter::Opcode0
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
|
{
|
|
|
|
|
InterpreterContext& context =
|
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
|
|
MWBase::World *world =
|
|
|
|
|
MWBase::Environment::get().getWorld();
|
|
|
|
|
|
|
|
|
|
bool value = !world->isVanityEnabled();
|
|
|
|
|
if (world->toggleVanityMode(value, true)) {
|
|
|
|
|
context.report(
|
|
|
|
|
(value) ? "Vanity Mode -> On" : "Vanity Mode -> Off"
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
context.report("Vanity Mode -> No");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const int opcodeXBox = 0x200000c;
|
|
|
|
|
const int opcodeOnActivate = 0x200000d;
|
|
|
|
|
const int opcodeActivate = 0x2000075;
|
|
|
|
@ -222,6 +245,7 @@ namespace MWScript
|
|
|
|
|
const int opcodeToggleWater = 0x2000144;
|
|
|
|
|
const int opcodeTogglePathgrid = 0x2000146;
|
|
|
|
|
const int opcodeDontSaveObject = 0x2000153;
|
|
|
|
|
const int opcodeToggleVanityMode = 0x2000174;
|
|
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
|
{
|
|
|
|
@ -244,6 +268,8 @@ namespace MWScript
|
|
|
|
|
extensions.registerInstruction ("togglepathgrid", "", opcodeTogglePathgrid);
|
|
|
|
|
extensions.registerInstruction ("tpg", "", opcodeTogglePathgrid);
|
|
|
|
|
extensions.registerInstruction ("dontsaveobject", "", opcodeDontSaveObject);
|
|
|
|
|
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
|
|
|
|
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
@ -263,6 +289,7 @@ namespace MWScript
|
|
|
|
|
interpreter.installSegment5 (opcodeTogglePathgrid, new OpTogglePathgrid);
|
|
|
|
|
interpreter.installSegment5 (opcodeToggleWater, new OpToggleWater);
|
|
|
|
|
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
|
|
|
|
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|