1
0
mirror of https://github.com/luanti-org/luanti.git synced 2026-01-01 10:45:32 +01:00

Show proper default key name in reset tooltip on keybindings menu (#16777)

* implement 'core.scancode_to_keyname()' and use it to fix something

* fix whitespaces and fix another thing

* ._.

* lol

* rename to get_key_description

* add case for keybindings whose defaults are not bound

* apply y5nw's suggestions

* lmao I'm so dumb
This commit is contained in:
CrazyladMT
2025-12-30 05:58:52 -05:00
committed by GitHub
parent 3b30e131ce
commit 975699a950
3 changed files with 20 additions and 0 deletions

View File

@@ -616,6 +616,14 @@ local function get_formspec(dialogdata)
if show_reset then
local default = comp.setting.default
if comp.setting.type == "key" then
default = (default ~= "")
and core.get_key_description(default)
--~ Indicates that the action does not have a corresponding keybinding.
or fgettext_ne("Not bound")
end
local reset_tooltip = default and
fgettext("Reset setting to default ($1)", tostring(default)) or
fgettext("Reset setting to default")