mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 11:06:43 +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,
|
ConsoleInterpreterContext (Console& console, MWWorld::Environment& environment,
|
||||||
MWWorld::Ptr reference);
|
MWWorld::Ptr reference);
|
||||||
|
|
||||||
|
virtual void report (const std::string& message);
|
||||||
};
|
};
|
||||||
|
|
||||||
ConsoleInterpreterContext::ConsoleInterpreterContext (Console& console,
|
ConsoleInterpreterContext::ConsoleInterpreterContext (Console& console,
|
||||||
|
@ -26,6 +28,11 @@ namespace MWGui
|
||||||
mConsole (console)
|
mConsole (console)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
void ConsoleInterpreterContext::report (const std::string& message)
|
||||||
|
{
|
||||||
|
mConsole.printOK (message);
|
||||||
|
}
|
||||||
|
|
||||||
bool Console::compile (const std::string& cmd, Compiler::Output& output)
|
bool Console::compile (const std::string& cmd, Compiler::Output& output)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace MWScript
|
||||||
|
|
||||||
bool enabled = context.getWorld().toggleCollisionMode();
|
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);
|
mEnvironment.mWindowManager->messageBox (message, buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InterpreterContext::report (const std::string& message)
|
||||||
|
{
|
||||||
|
messageBox (message);
|
||||||
|
}
|
||||||
|
|
||||||
bool InterpreterContext::menuMode()
|
bool InterpreterContext::menuMode()
|
||||||
{
|
{
|
||||||
return mEnvironment.mWindowManager->isGuiMode();
|
return mEnvironment.mWindowManager->isGuiMode();
|
||||||
|
|
|
@ -57,9 +57,13 @@ namespace MWScript
|
||||||
virtual void setLocalFloat (int index, float value);
|
virtual void setLocalFloat (int index, float value);
|
||||||
|
|
||||||
using Interpreter::Context::messageBox;
|
using Interpreter::Context::messageBox;
|
||||||
|
|
||||||
virtual void messageBox (const std::string& message,
|
virtual void messageBox (const std::string& message,
|
||||||
const std::vector<std::string>& buttons);
|
const std::vector<std::string>& buttons);
|
||||||
|
|
||||||
|
virtual void report (const std::string& message);
|
||||||
|
///< By default echo via messageBox.
|
||||||
|
|
||||||
virtual bool menuMode();
|
virtual bool menuMode();
|
||||||
|
|
||||||
virtual int getGlobalShort (const std::string& name) const;
|
virtual int getGlobalShort (const std::string& name) const;
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace MWScript
|
||||||
bool enabled =
|
bool enabled =
|
||||||
context.getWorld().toggleRenderMode (MWWorld::World::Render_CollisionDebug);
|
context.getWorld().toggleRenderMode (MWWorld::World::Render_CollisionDebug);
|
||||||
|
|
||||||
context.messageBox (enabled ?
|
context.report (enabled ?
|
||||||
"Collsion Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
"Collsion Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace MWScript
|
||||||
|
|
||||||
bool enabled = context.getWorld().toggleSky();
|
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);
|
messageBox (message, empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void report (const std::string& message) = 0;
|
||||||
|
|
||||||
virtual bool menuMode() = 0;
|
virtual bool menuMode() = 0;
|
||||||
|
|
||||||
virtual int getGlobalShort (const std::string& name) const = 0;
|
virtual int getGlobalShort (const std::string& name) const = 0;
|
||||||
|
@ -67,5 +69,3 @@ namespace Interpreter
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue