diff --git a/binaries/data/mods/public/gui/common/color.js b/binaries/data/mods/public/gui/common/color.js index 289912ed5c..9ee7c7f116 100644 --- a/binaries/data/mods/public/gui/common/color.js +++ b/binaries/data/mods/public/gui/common/color.js @@ -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) diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index 4d36a0edc0..05b89cf3da 100644 --- a/binaries/data/mods/public/gui/session/messages.js +++ b/binaries/data/mods/public/gui/session/messages.js @@ -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)),