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

fix Russian keybinding localization error #1250

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions addons/keybinding/XEH_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -165,25 +165,13 @@ private _supportedKeys = [
DIK_XBOX_RIGHT_THUMB
];

_supportedKeys = _supportedKeys apply {
// strip away additional quote marks
// Turkish keyboard which has a double quotes key (41), will throw an error in parseSimpleArray

private _formatedKeyname = format ["[%1]", keyName _x];
private _keyName = if (_formatedKeyname != "[""""""]") then {
(parseSimpleArray _formatedKeyname) select 0;
} else {
"''"
};

[str _x, _keyName]
};
_supportedKeys = _supportedKeys apply {[str _x, KEY_NAME(_x)]};

GVAR(keyNamesHash) = [_supportedKeys] call CBA_fnc_hashCreate;

// manually add mouse key localizations to our inofficial DIK codes
{
[GVAR(keyNamesHash), str (_x select 0), parseSimpleArray format ["[%1]", keyName (_x select 1)] select 0] call CBA_fnc_hashSet;
[GVAR(keyNamesHash), str (_x select 0), KEY_NAME(_x select 1)] call CBA_fnc_hashSet;
} forEach [
[0xF0, 0x10000], // LMB
[0xF1, 0x10081], // RMB
Expand Down
1 change: 1 addition & 0 deletions addons/keybinding/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@
#define NAMESPACE_NULL objNull
#define HASH_NULL ([] call CBA_fnc_hashCreate)
#define KEYBIND_NULL [0, [false, false, false]]
#define KEY_NAME(x) (call {private _s = keyName (x); _s select [1, count _s - 2]})