Merge pull request #356 from lethosor/disable-console

Allow console to be disabled by setting an environment variable
develop
expwnent 2014-11-02 03:31:35 -05:00
commit 4b7c4f8c4b
1 changed files with 6 additions and 3 deletions

@ -1027,12 +1027,15 @@ bool Core::Init()
cerr << "Initializing Console.\n";
// init the console.
bool is_text_mode = false;
if(init && init->display.flag.is_set(init_display_flags::TEXT))
bool is_text_mode = (init && init->display.flag.is_set(init_display_flags::TEXT));
if (is_text_mode || getenv("DFHACK_DISABLE_CONSOLE"))
{
is_text_mode = true;
con.init(true);
cerr << "Console is not available. Use dfhack-run to send commands.\n";
if (!is_text_mode)
{
cout << "Console disabled.\n";
}
}
else if(con.init(false))
cerr << "Console is running.\n";