Skip to content

Commit

Permalink
Fix Cyrillic input for Action Button binding (#180)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Фиксит привязку экшн-кнопки, если была кириллица при вводе

fixes #160
В префах только визуальный баг, оно потом корректно показывается

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
fix: Фиксит привязку экшн-кнопки, если была кириллица при вводе
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
larentoun authored Apr 20, 2024
1 parent 80f6e8b commit 14e4c5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modular_bandastation/cyrillic_fixes/code/cyrillic_fixes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GLOBAL_LIST_INIT(ru_key_to_en_key, list(

#define MAX_HOTKEY_SLOTS 3

/datum/preference_middleware/keybindings/set_keybindings(list/params)
/datum/preference_middleware/keybindings/set_keybindings(list/params, mob/user)
var/keybind_name = params["keybind_name"]

if (isnull(GLOB.keybindings_by_name[keybind_name]))
Expand Down Expand Up @@ -42,6 +42,12 @@ GLOBAL_LIST_INIT(ru_key_to_en_key, list(
preferences.key_bindings[keybind_name] = hotkeys
preferences.key_bindings_by_key = preferences.get_key_bindings_by_key(preferences.key_bindings)

user.client.update_special_keybinds()

return TRUE

#undef MAX_HOTKEY_SLOTS

/datum/tgui_input_keycombo/set_entry(entry)
entry = convert_ru_key_to_en_key(entry) || entry
. = ..()

0 comments on commit 14e4c5d

Please sign in to comment.