mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 17:59:56 +00:00
splitting off console output from messageBox channel
This commit is contained in:
parent
f52e6bd5ef
commit
125319c441
7 changed files with 40 additions and 24 deletions
|
@ -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");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -18,21 +18,23 @@ namespace Interpreter
|
|||
|
||||
virtual float getLocalFloat (int index) const = 0;
|
||||
|
||||
virtual void setLocalShort (int index, int value) = 0;
|
||||
virtual void setLocalShort (int index, int value) = 0;
|
||||
|
||||
virtual void setLocalLong (int index, int value) = 0;
|
||||
virtual void setLocalLong (int index, int value) = 0;
|
||||
|
||||
virtual void setLocalFloat (int index, float value) = 0;
|
||||
|
||||
|
||||
virtual void messageBox (const std::string& message,
|
||||
const std::vector<std::string>& buttons) = 0;
|
||||
|
||||
const std::vector<std::string>& buttons) = 0;
|
||||
|
||||
void messageBox (const std::string& message)
|
||||
{
|
||||
std::vector<std::string> empty;
|
||||
messageBox (message, empty);
|
||||
}
|
||||
|
||||
|
||||
virtual void report (const std::string& message) = 0;
|
||||
|
||||
virtual bool menuMode() = 0;
|
||||
|
||||
virtual int getGlobalShort (const std::string& name) const = 0;
|
||||
|
@ -41,31 +43,29 @@ namespace Interpreter
|
|||
|
||||
virtual float getGlobalFloat (const std::string& name) const = 0;
|
||||
|
||||
virtual void setGlobalShort (const std::string& name, int value) = 0;
|
||||
virtual void setGlobalShort (const std::string& name, int value) = 0;
|
||||
|
||||
virtual void setGlobalLong (const std::string& name, int value) = 0;
|
||||
virtual void setGlobalLong (const std::string& name, int value) = 0;
|
||||
|
||||
virtual void setGlobalFloat (const std::string& name, float value) = 0;
|
||||
|
||||
virtual void setGlobalFloat (const std::string& name, float value) = 0;
|
||||
|
||||
virtual bool isScriptRunning (const std::string& name) const = 0;
|
||||
|
||||
|
||||
virtual void startScript (const std::string& name) = 0;
|
||||
|
||||
|
||||
virtual void stopScript (const std::string& name) = 0;
|
||||
|
||||
|
||||
virtual float getDistance (const std::string& name, const std::string& id = "") const
|
||||
= 0;
|
||||
|
||||
= 0;
|
||||
|
||||
virtual float getSecondsPassed() const = 0;
|
||||
|
||||
|
||||
virtual bool isDisabled (const std::string& id = "") const = 0;
|
||||
|
||||
|
||||
virtual void enable (const std::string& id = "") = 0;
|
||||
|
||||
virtual void disable (const std::string& id = "") = 0;
|
||||
|
||||
virtual void disable (const std::string& id = "") = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue