mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 00:52:43 +00:00
Remove workaround from 4055c564e9 / D1184 and display hotkey strings too if the hotkey is unassigned.
Differential Revision: https://code.wildfiregames.com/D1200 Reviewed By: mimo This was SVN commit r20777.
This commit is contained in:
@@ -146,7 +146,9 @@ function colorizeHotkey(text, hotkey)
|
||||
let key = Engine.ConfigDB_GetValue("user", "hotkey." + hotkey);
|
||||
|
||||
if (!key || key.toLowerCase() == "unused")
|
||||
return "";
|
||||
key = sprintf(translate("Unassigned hotkey: %(hotkeyName)s"), {
|
||||
"hotkeyName": hotkey
|
||||
});
|
||||
|
||||
return sprintf(text, {
|
||||
"hotkey": coloredText("\\[" + key + "]", g_HotkeyColor)
|
||||
|
||||
@@ -568,22 +568,6 @@ function updateTutorial(notification)
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO temporary should be removed once D1180 is done
|
||||
for (let i = 0; i < notification.instructions.length; ++i)
|
||||
{
|
||||
let item = notification.instructions[i];
|
||||
if (typeof item == "string")
|
||||
continue;
|
||||
if (item.hotkey.length == 1)
|
||||
{
|
||||
let key = Engine.ConfigDB_GetValue("user", "hotkey." + item.hotkey[0]);
|
||||
if (!key || key.toLowerCase() == "unused")
|
||||
notification.instructions[i]= item.text.replace("%(hotkey)s", "{hotkey " + item.hotkey[0] + " undefined}");
|
||||
}
|
||||
else
|
||||
error("Several hotkeys per instruction item is not yet supported, needs D1180.");
|
||||
}
|
||||
// end of temporary
|
||||
let notificationText =
|
||||
notification.instructions.reduce((instructions, item) =>
|
||||
instructions + (typeof item == "string" ? translate(item) : colorizeHotkey(translate(item.text), item.hotkey)),
|
||||
|
||||
Reference in New Issue
Block a user