diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 11b63bae4..5302205f1 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -702,6 +702,9 @@ fall_bobbing_amount (Fall bobbing factor) float 0.03 # In-game chat console height, between 0.1 (10%) and 1.0 (100%). console_height (Console height) float 0.6 0.1 1.0 +# In-game chat message console height, between 0.1 (10%) and 1.0 (100%). +console_message_height (Console message height) float 0.25 0.1 1.0 + # In-game chat console background color (R,G,B). console_color (Console color) string (0,0,0) diff --git a/multicraft.conf.example b/multicraft.conf.example index 6804047f1..87a631ca0 100644 --- a/multicraft.conf.example +++ b/multicraft.conf.example @@ -809,6 +809,10 @@ # type: float min: 0.1 max: 1 # console_height = 0.6 +# In-game chat message console height, between 0.1 (10%) and 1.0 (100%). +# type: float min: 0.1 max: 1 +# console_message_height = 0.25 + # In-game chat console background color (R,G,B). # type: string # console_color = (0,0,0) diff --git a/src/client/game.cpp b/src/client/game.cpp index 1bb408785..de73ec1cf 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1935,12 +1935,12 @@ void Game::processKeyInput() m_game_ui->toggleChat(); else #endif - openConsole(0.2, L""); + openConsole(core::clamp(g_settings->getFloat("console_message_height"), 0.1f, 1.0f), L""); } else if (wasKeyDown(KeyType::CMD)) { - openConsole(0.2, L"/"); + openConsole(core::clamp(g_settings->getFloat("console_message_height"), 0.1f, 1.0f), L"/"); } else if (wasKeyDown(KeyType::CMD_LOCAL)) { if (client->modsLoaded()) - openConsole(0.2, L"."); + openConsole(core::clamp(g_settings->getFloat("console_message_height"), 0.1f, 1.0f), L"."); else m_game_ui->showStatusText(wgettext("Client side scripting is disabled")); } else if (wasKeyDown(KeyType::CONSOLE)) { diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 90fc2aa9e..2bba96fb8 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -223,6 +223,7 @@ void set_default_settings() settings->setDefault("menu_clouds", "true"); settings->setDefault("opaque_water", "false"); settings->setDefault("console_height", "0.6"); + settings->setDefault("console_message_height", "0.25"); settings->setDefault("console_color", "(0,0,0)"); settings->setDefault("console_alpha", "200"); settings->setDefault("formspec_fullscreen_bg_color", "(0,0,0)"); @@ -654,6 +655,7 @@ void set_default_settings() } else if (x_inches >= 7.0) { settings->setDefault("device_is_tablet", "true"); settings->setDefault("recent_chat_messages", "8"); + settings->setDefault("console_message_height", "0.4"); } if (x_inches <= 4.5) { @@ -685,6 +687,7 @@ void set_default_settings() if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { settings->setDefault("device_is_tablet", "true"); settings->setDefault("recent_chat_messages", "8"); + settings->setDefault("console_message_height", "0.4"); } // Set the size of the elements depending on the screen size