splitting off console output from messageBox channel

actorid
Marc Zinnschlag 14 years ago
parent f52e6bd5ef
commit 125319c441

@ -17,6 +17,8 @@ namespace MWGui
ConsoleInterpreterContext (Console& console, MWWorld::Environment& environment,
MWWorld::Ptr reference);
virtual void report (const std::string& message);
};
ConsoleInterpreterContext::ConsoleInterpreterContext (Console& console,
@ -26,6 +28,11 @@ namespace MWGui
mConsole (console)
{}
void ConsoleInterpreterContext::report (const std::string& message)
{
mConsole.printOK (message);
}
bool Console::compile (const std::string& cmd, Compiler::Output& output)
{
try

@ -48,7 +48,7 @@ namespace MWScript
bool enabled = context.getWorld().toggleCollisionMode();
context.messageBox (enabled ? "Collsion -> On" : "Collision -> Off");
context.report (enabled ? "Collsion -> On" : "Collision -> Off");
}
};

@ -110,6 +110,11 @@ namespace MWScript
mEnvironment.mWindowManager->messageBox (message, buttons);
}
void InterpreterContext::report (const std::string& message)
{
messageBox (message);
}
bool InterpreterContext::menuMode()
{
return mEnvironment.mWindowManager->isGuiMode();

@ -57,9 +57,13 @@ namespace MWScript
virtual void setLocalFloat (int index, float value);
using Interpreter::Context::messageBox;
virtual void messageBox (const std::string& message,
const std::vector<std::string>& buttons);
virtual void report (const std::string& message);
///< By default echo via messageBox.
virtual bool menuMode();
virtual int getGlobalShort (const std::string& name) const;

@ -102,7 +102,7 @@ namespace MWScript
bool enabled =
context.getWorld().toggleRenderMode (MWWorld::World::Render_CollisionDebug);
context.messageBox (enabled ?
context.report (enabled ?
"Collsion Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
}
};

@ -24,7 +24,7 @@ namespace MWScript
bool enabled = context.getWorld().toggleSky();
context.messageBox (enabled ? "Sky -> On" : "Sky -> Off");
context.report (enabled ? "Sky -> On" : "Sky -> Off");
}
};

@ -33,6 +33,8 @@ namespace Interpreter
messageBox (message, empty);
}
virtual void report (const std::string& message) = 0;
virtual bool menuMode() = 0;
virtual int getGlobalShort (const std::string& name) const = 0;
@ -67,5 +69,3 @@ namespace Interpreter
}
#endif

Loading…
Cancel
Save