diff options
author | Ezhh <owlecho@live.com> | 2017-01-29 16:10:17 +0000 |
---|---|---|
committer | Zeno- <kde.psych@gmail.com> | 2017-01-30 02:10:17 +1000 |
commit | 0c9189d10989f85cd5148107b643dc17a49c06ff (patch) | |
tree | d534d5780f470d9e53596fff9827b6d0438c05ec | |
parent | 707e27b5c26b6c082abbd2f385a976c5bc8964fe (diff) | |
download | minetest-0c9189d10989f85cd5148107b643dc17a49c06ff.tar.gz minetest-0c9189d10989f85cd5148107b643dc17a49c06ff.tar.bz2 minetest-0c9189d10989f85cd5148107b643dc17a49c06ff.zip |
Add console height setting (#5136)
-rw-r--r-- | builtin/settingtypes.txt | 3 | ||||
-rw-r--r-- | minetest.conf.example | 4 | ||||
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/game.cpp | 3 |
4 files changed, 10 insertions, 1 deletions
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 581eef315..c81dde7de 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -477,6 +477,9 @@ fall_bobbing_amount (Fall bobbing) float 0.0 # - pageflip: quadbuffer based 3d. 3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside,pageflip +# In-game chat console height, between 0.1 (10%) and 1.0 (100%). +console_height (Console height) float 1.0 0.1 1.0 + # In-game chat console background color (R,G,B). console_color (Console color) string (0,0,0) diff --git a/minetest.conf.example b/minetest.conf.example index 642b028c7..5c7533e93 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -548,6 +548,10 @@ # type: enum values: none, anaglyph, interlaced, topbottom, sidebyside, pageflip # 3d_mode = none +# In-game chat console height, between 0.1 (10%) and 1.0 (100%). +# type: float +# console_height = 1.0 + # In-game chat console background color (R,G,B). # type: string # console_color = (0,0,0) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index e154a63c8..84046f61c 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -138,6 +138,7 @@ void set_default_settings(Settings *settings) settings->setDefault("cloud_radius", "12"); settings->setDefault("menu_clouds", "true"); settings->setDefault("opaque_water", "false"); + settings->setDefault("console_height", "1.0"); settings->setDefault("console_color", "(0,0,0)"); settings->setDefault("console_alpha", "200"); settings->setDefault("selectionbox_color", "(0,0,0)"); diff --git a/src/game.cpp b/src/game.cpp index 4b4597a7a..1cb054cab 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2627,7 +2627,8 @@ void Game::processKeyInput(VolatileRunFlags *flags, } else if (wasKeyDown(KeyType::CMD)) { openConsole(0.2, L"/"); } else if (wasKeyDown(KeyType::CONSOLE)) { - openConsole(1); + openConsole(core::clamp( + g_settings->getFloat("console_height"), 0.1f, 1.0f)); } else if (wasKeyDown(KeyType::FREEMOVE)) { toggleFreeMove(statustext_time); } else if (wasKeyDown(KeyType::JUMP)) { |