Remove controls listed in the pause menu (no touchscreen) (#13282)

This commit is contained in:
Zughy 2024-01-05 21:10:07 +01:00 committed by GitHub
parent 15f73258fd
commit c2c8d4d410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 45 deletions

@ -47,13 +47,13 @@ end
local change_keys = { local change_keys = {
query_text = "Change Keys", query_text = "Controls",
requires = { requires = {
keyboard_mouse = true, keyboard_mouse = true,
}, },
get_formspec = function(self, avail_w) get_formspec = function(self, avail_w)
local btn_w = math.min(avail_w, 3) local btn_w = math.min(avail_w, 3)
return ("button[0,0;%f,0.8;btn_change_keys;%s]"):format(btn_w, fgettext("Change Keys")), 0.8 return ("button[0,0;%f,0.8;btn_change_keys;%s]"):format(btn_w, fgettext("Controls")), 0.8
end, end,
on_submit = function(self, fields) on_submit = function(self, fields)
if fields.btn_change_keys then if fields.btn_change_keys then

@ -90,7 +90,7 @@
# Smooths rotation of camera, also called look or mouse smoothing. 0 to disable. # Smooths rotation of camera, also called look or mouse smoothing. 0 to disable.
camera_smoothing (Camera smoothing) float 0.0 0.0 0.99 camera_smoothing (Camera smoothing) float 0.0 0.0 0.99
# Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Change Keys. # Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Controls.
# #
# Requires: keyboard_mouse # Requires: keyboard_mouse
cinematic_camera_smoothing (Camera smoothing in cinematic mode) float 0.7 0.0 0.99 cinematic_camera_smoothing (Camera smoothing in cinematic mode) float 0.7 0.0 0.99

@ -22,7 +22,7 @@
# type: float min: 0 max: 0.99 # type: float min: 0 max: 0.99
# camera_smoothing = 0.0 # camera_smoothing = 0.0
# Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Change Keys. # Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Controls.
# type: float min: 0 max: 0.99 # type: float min: 0 max: 0.99
# cinematic_camera_smoothing = 0.7 # cinematic_camera_smoothing = 0.7
@ -3636,4 +3636,3 @@
# See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h # See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h
# type: key # type: key
# keymap_decrease_viewing_range_min = - # keymap_decrease_viewing_range_min = -

@ -4457,41 +4457,6 @@ void Game::showPauseMenu()
"- touch&drag, tap 2nd finger\n" "- touch&drag, tap 2nd finger\n"
" --> place single item to slot\n" " --> place single item to slot\n"
); );
#else
static const std::string control_text_template = strgettext("Controls:\n"
"- %s: move forwards\n"
"- %s: move backwards\n"
"- %s: move left\n"
"- %s: move right\n"
"- %s: jump/climb up\n"
"- %s: dig/punch/use\n"
"- %s: place/use\n"
"- %s: sneak/climb down\n"
"- %s: drop item\n"
"- %s: inventory\n"
"- Mouse: turn/look\n"
"- Mouse wheel: select item\n"
"- %s: chat\n"
);
char control_text_buf[600];
porting::mt_snprintf(control_text_buf, sizeof(control_text_buf), control_text_template.c_str(),
GET_KEY_NAME(keymap_forward),
GET_KEY_NAME(keymap_backward),
GET_KEY_NAME(keymap_left),
GET_KEY_NAME(keymap_right),
GET_KEY_NAME(keymap_jump),
GET_KEY_NAME(keymap_dig),
GET_KEY_NAME(keymap_place),
GET_KEY_NAME(keymap_sneak),
GET_KEY_NAME(keymap_drop),
GET_KEY_NAME(keymap_inventory),
GET_KEY_NAME(keymap_chat)
);
std::string control_text = std::string(control_text_buf);
str_formspec_escape(control_text);
#endif #endif
float ypos = simple_singleplayer_mode ? 0.7f : 0.1f; float ypos = simple_singleplayer_mode ? 0.7f : 0.1f;
@ -4516,14 +4481,16 @@ void Game::showPauseMenu()
} }
#endif #endif
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_key_config;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_key_config;"
<< strgettext("Change Keys") << "]"; << strgettext("Controls") << "]";
#endif #endif
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_menu;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_menu;"
<< strgettext("Exit to Menu") << "]"; << strgettext("Exit to Menu") << "]";
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;" os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
<< strgettext("Exit to OS") << "]" << strgettext("Exit to OS") << "]";
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]" #ifdef HAVE_TOUCHSCREENGUI
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n" os << "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]";
#endif
os << "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n"
<< "\n" << "\n"
<< strgettext("Game info:") << "\n"; << strgettext("Game info:") << "\n";
const std::string &address = client->getAddressName(); const std::string &address = client->getAddressName();

@ -8,7 +8,7 @@ fake_function() {
gettext("Camera smoothing"); gettext("Camera smoothing");
gettext("Smooths rotation of camera, also called look or mouse smoothing. 0 to disable."); gettext("Smooths rotation of camera, also called look or mouse smoothing. 0 to disable.");
gettext("Camera smoothing in cinematic mode"); gettext("Camera smoothing in cinematic mode");
gettext("Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Change Keys."); gettext("Smooths rotation of camera when in cinematic mode, 0 to disable. Enter cinematic mode by using the key set in Controls.");
gettext("Build inside player"); gettext("Build inside player");
gettext("If enabled, you can place nodes at the position (feet + eye level) where you stand.\nThis is helpful when working with nodeboxes in small areas."); gettext("If enabled, you can place nodes at the position (feet + eye level) where you stand.\nThis is helpful when working with nodeboxes in small areas.");
gettext("Aux1 key for climbing/descending"); gettext("Aux1 key for climbing/descending");