1
0

Make the console message height configurable

This commit is contained in:
Maksym H 2023-03-05 18:41:31 +01:00
parent 896b90f600
commit 314968723d
4 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)) {

View File

@ -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