Give all tabs hotkeyTooltips

Removes the manual hotkey tooltips from summary and gamesetup in favor
of the general one.

Based on patch By: ffffffff
Reviewed By: Freagarach
Comments By: elexis, Stan
Differential Revision: D1264
This was SVN commit r25872.
This commit is contained in:
bb 2021-08-28 10:36:14 +00:00
parent 080cae147e
commit 5b41b982f9
3 changed files with 6 additions and 21 deletions

View File

@ -60,7 +60,10 @@ function placeTabButtons(categoriesData, horizontal, buttonSize, spacing, onPres
size.rbottom = 0;
}
button.size = size;
button.tooltip = categoriesData[category].tooltip || "";
button.tooltip = (categoriesData[category].tooltip ? categoriesData[category].tooltip + "\n" : "") +
(g_TabHorizontal ?
colorizeHotkey(translate("Scroll down or use %(hotkey)s to move a tab right."), "tab.next") + "\n" + colorizeHotkey(translate("Scroll up or use %(hotkey)s to move a tab left."), "tab.prev"):
colorizeHotkey(translate("Scroll down or use %(hotkey)s to move a tab down."), "tab.next") + "\n" + colorizeHotkey(translate("Scroll up or use %(hotkey)s to move a tab up."), "tab.prev"));
let categoryNum = +category;
button.onPress = () => { onPress(categoryNum); };

View File

@ -10,10 +10,7 @@ class GameSettingTabs
this.settingsTabButtonsFrame = Engine.GetGUIObjectByName("settingTabButtonsFrame");
for (let tab in g_GameSettingsLayout)
g_GameSettingsLayout[tab].tooltip =
sprintf(this.ToggleTooltip, { "name": g_GameSettingsLayout[tab].label }) +
colorizeHotkey("\n" + this.HotkeyNextTooltip, this.ConfigNameHotkeyNext) +
colorizeHotkey("\n" + this.HotkeyPreviousTooltip, this.ConfigNameHotkeyPrevious);
g_GameSettingsLayout[tab].tooltip = sprintf(this.ToggleTooltip, { "name": g_GameSettingsLayout[tab].label });
setupWindow.registerLoadHandler(this.onLoad.bind(this));
Engine.SetGlobalHotkey("cancel", "Press", selectPanel);
@ -76,18 +73,6 @@ class GameSettingTabs
GameSettingTabs.prototype.ToggleTooltip =
translate("Click to toggle the %(name)s settings tab.");
GameSettingTabs.prototype.HotkeyNextTooltip =
translate("Press %(hotkey)s to move to the next settings tab.");
GameSettingTabs.prototype.HotkeyPreviousTooltip =
translate("Press %(hotkey)s to move to the previous settings tab.");
GameSettingTabs.prototype.ConfigNameHotkeyNext =
"tab.next";
GameSettingTabs.prototype.ConfigNameHotkeyPrevious =
"tab.prev";
GameSettingTabs.prototype.TabButtonHeight = 30;
GameSettingTabs.prototype.TabButtonMargin = 4;

View File

@ -553,10 +553,7 @@ function initGUIButtons()
let allPanelsData = g_ScorePanelsData.concat(g_ChartPanelsData);
for (let tab in allPanelsData)
allPanelsData[tab].tooltip =
sprintf(translate("Toggle the %(name)s summary tab."), { "name": allPanelsData[tab].label }) +
colorizeHotkey("\n" + translate("Use %(hotkey)s to move a summary tab right."), "tab.next") +
colorizeHotkey("\n" + translate("Use %(hotkey)s to move a summary tab left."), "tab.prev");
allPanelsData[tab].tooltip = sprintf(translate("Focus the %(name)s summary tab."), { "name": allPanelsData[tab].label });
placeTabButtons(
allPanelsData,