Lua Console: Print an error message when not opening the console because :debug hasn't been run.
This commit is contained in:
parent
7dc25fff1f
commit
7d04389f47
1 changed files with 4 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
#include "game_config.hpp"
|
||||
#include "game_errors.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "play_controller.hpp"
|
||||
#include "resources.hpp" //for help fetching lua kernel pointers
|
||||
#include "scripting/plugins/manager.hpp" //needed for the WHICH_KERNEL version of display
|
||||
#include "scripting/game_lua_kernel.hpp" //needed for the WHICH_KERNEL version of display
|
||||
|
@ -685,6 +686,9 @@ void lua_interpreter::controller::search(int direction)
|
|||
void lua_interpreter::display(lua_kernel_base * lk) {
|
||||
#ifndef ALWAYS_HAVE_LUA_CONSOLE
|
||||
if(!game_config::debug) {
|
||||
display_chat_manager& chat_man = resources::controller->get_display().get_chat_manager();
|
||||
const std::string& message = _("The lua console can only be used in debug mode! (Run ':debug' first)");
|
||||
chat_man.add_chat_message(time(nullptr), _("lua console"), 0, message, events::chat_handler::MESSAGE_PRIVATE, false);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue