本文整理汇总了C++中interpreter::Runtime::getContext方法的典型用法代码示例。如果您正苦于以下问题:C++ Runtime::getContext方法的具体用法?C++ Runtime::getContext怎么用?C++ Runtime::getContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interpreter::Runtime
的用法示例。
在下文中一共展示了Runtime::getContext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
context.getInputManager().setGuiMode(mDialogue);
}
示例2: operator
MWWorld::Ptr operator() (Interpreter::Runtime& runtime) const
{
MWScript::InterpreterContext& context
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
return context.getReference();
}
示例3: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context
= static_cast<InterpreterContext&> (runtime.getContext());
context.getWorld().toggleCollisionMode();
}
示例4: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWScript::InterpreterContext& context
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWWorld::Ptr ptr = context.getWorld().getPtr (id, false);
if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
{
// health is a special case
Interpreter::Type_Integer value =
MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
runtime.push (value);
return;
}
Interpreter::Type_Integer value =
MWWorld::Class::get (ptr).getCreatureStats (ptr).mDynamic[mIndex].
getCurrent();
runtime.push (value);
}
示例5: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
MWWorld::Ptr ptr = context.getReference();
context.executeActivation();
}
示例6: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
MWWorld::Ptr ptr = context.getReference();
runtime.push (MWBase::Environment::get().getWindowManager()->readPressedButton());
}
示例7: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context
= static_cast<InterpreterContext&> (runtime.getContext());
bool enabled = MWBase::Environment::get().getMechanicsManager()->toggleAI();
context.report (enabled ? "AI -> On" : "AI -> Off");
}
示例8: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context
= static_cast<InterpreterContext&> (runtime.getContext());
bool enabled = MWBase::Environment::get().getWorld()->toggleCollisionMode();
context.report (enabled ? "Collision -> On" : "Collision -> Off");
}
示例9: execute
virtual void execute(Interpreter::Runtime &runtime)
{
bool state = MWBase::Environment::get().getWindowManager()->toggleGui();
runtime.getContext().report(state ? "GUI -> On" : "GUI -> Off");
if (!state)
{
while (MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_None) // don't use isGuiMode, or we get an infinite loop for modal message boxes!
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
}
示例10: execute
virtual void execute (Interpreter::Runtime& runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
bool enabled =
MWBase::Environment::get().getWorld()->toggleRenderMode (MWWorld::World::Render_CollisionDebug);
context.report (enabled ?
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
}
示例11: execute
virtual void execute(Interpreter::Runtime &runtime)
{
InterpreterContext& context =
static_cast<InterpreterContext&> (runtime.getContext());
MWBase::World *world =
MWBase::Environment::get().getWorld();
if (world->toggleVanityMode(sActivate)) {
context.report(sActivate ? "Vanity Mode -> On" : "Vanity Mode -> Off");
sActivate = !sActivate;
} else {
context.report("Vanity Mode -> No");
}
}
示例12: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
if (!ptr.getRefData().isEnabled())
return;
if (!ptr.getClass().isActor())
{
const std::string error = "Warning: \"forcegreeting\" command works only for actors.";
runtime.getContext().report(error);
Log(Debug::Warning) << error;
return;
}
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, ptr);
}
示例13: execute
virtual void execute (Interpreter::Runtime& runtime)
{
MWWorld::Ptr ptr = R()(runtime);
MWScript::InterpreterContext& context
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
std::string file = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
std::string text = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop();
MWBase::Environment::get().getSoundManager()->say (ptr, file);
if (MWBase::Environment::get().getWindowManager ()->getSubtitlesEnabled())
context.messageBox (text);
}
示例14: execute
virtual void execute (Interpreter::Runtime& runtime)
{
runtime.push (static_cast<InterpreterContext&> (
runtime.getContext()).hasBeenActivated());
}
示例15: execute
virtual void execute (Interpreter::Runtime& runtime)
{
bool enabled = MWBase::Environment::get().getMechanicsManager()->toggleAI();
runtime.getContext().report (enabled ? "AI -> On" : "AI -> Off");
}