Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions builtin/mainmenu/settings/dlg_settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ end


local change_keys = {
query_text = "Change keys",
query_text = "Controls",
requires = {
keyboard_mouse = true,
},
get_formspec = function(self, avail_w)
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,
on_submit = function(self, fields)
if fields.btn_change_keys then
Expand Down
2 changes: 1 addition & 1 deletion builtin/settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
# Smooths rotation of camera, also called look or mouse smoothing. 0 to disable.
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
cinematic_camera_smoothing (Camera smoothing in cinematic mode) float 0.7 0.0 0.99
Expand Down
3 changes: 1 addition & 2 deletions minetest.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# type: float min: 0 max: 0.99
# 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
# cinematic_camera_smoothing = 0.7

Expand Down Expand Up @@ -3604,4 +3604,3 @@
# See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h
# type: key
# keymap_decrease_viewing_range_min = -

45 changes: 6 additions & 39 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4375,41 +4375,6 @@ void Game::showPauseMenu()
"- touch&drag, tap 2nd finger\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

float ypos = simple_singleplayer_mode ? 0.7f : 0.1f;
Expand All @@ -4434,14 +4399,16 @@ void Game::showPauseMenu()
}
#endif
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_key_config;"
<< strgettext("Change Keys") << "]";
<< strgettext("Controls") << "]";
#endif
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_menu;"
<< strgettext("Exit to Menu") << "]";
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
<< strgettext("Exit to OS") << "]"
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]"
<< "textarea[0.4,0.25;3.9,6.25;;" << PROJECT_NAME_C " " VERSION_STRING "\n"
<< strgettext("Exit to OS") << "]";
#ifdef HAVE_TOUCHSCREENGUI
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"
<< strgettext("Game info:") << "\n";
const std::string &address = client->getAddressName();
Expand Down
2 changes: 1 addition & 1 deletion src/settings_translation_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fake_function() {
gettext("Camera smoothing");
gettext("Smooths rotation of camera, also called look or mouse smoothing. 0 to disable.");
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("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");
Expand Down