Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -147,8 +147,9 @@ togglefullscreen = "Alt+Return" ; Toggle fullscreen/windowed mode screenshot.watermark = "Alt+K" ; Toggle product/company watermark for official screenshots wireframe = "Alt+W" ; Toggle wireframe mode -silhouettes = "Alt+S" ; Toggle unit silhouettes +silhouettes = "Ctrl+Alt+S" ; Toggle unit silhouettes showsky = "Alt+Z" ; Toggle sky +summary = "Alt+S" ; Toggle in-game summary ; > CLIPBOARD CONTROLS copy = "Ctrl+C" ; Copy to clipboard @@ -323,6 +324,10 @@ fastforward = Space ; If timewarp mode enabled, speed up the game rewind = Backspace ; If timewarp mode enabled, go back to earlier point in the game +[hotkey.summary] +nextpanel = "Tab" ; Show next panel in summary screen +prevpanel = "Shift+Tab" ; Show previous panel in summary screen + [hotkey.text] ; > GUI TEXTBOX HOTKEYS delete.left = "Ctrl+Backspace" ; Delete word to the left of cursor delete.right = "Ctrl+Del" ; Delete word to the right of cursor Index: binaries/data/mods/public/gui/manual/intro.txt =================================================================== --- binaries/data/mods/public/gui/manual/intro.txt +++ binaries/data/mods/public/gui/manual/intro.txt @@ -84,6 +84,8 @@ PageUp with units selected: Highlights the units/buildings guarded by the selection. PageDown with units/buildings selected: Highlights the units guarding the selection. Tab: See all status bars (which would also show the building progress) +Alt + S: Toggle summary window. +Tab/Shift + Tab: Switch through summary panels in summary window forward/backward. [font="sans-bold-14"]Modify mouse action [font="sans-14"]Ctrl + Right Click on building: Garrison @@ -106,7 +108,7 @@ [font="sans-14"]Alt + G: Hide/show the GUI Alt + D: Show/hide developer overlay (with developer options) Alt + W: Toggle wireframe mode (press once to get wireframes overlaid over the textured models, twice to get just the wireframes colored by the textures, thrice to get back to normal textured mode) -Alt + S: Toggle unit silhouettes (might give a small performance boost) +Ctrl + Alt + S: Toggle unit silhouettes (might give a small performance boost) Alt + Z: Toggle sky Alt + V: Toggle aura range visualizations of selected units and structures Alt + B: Toggle heal range visualizations of selected units Index: binaries/data/mods/public/gui/replaymenu/replay_actions.js =================================================================== --- binaries/data/mods/public/gui/replaymenu/replay_actions.js +++ binaries/data/mods/public/gui/replaymenu/replay_actions.js @@ -127,7 +127,8 @@ "isReplay": true, "replayDirectory": g_ReplaysFiltered[selected].directory, "replaySelectionData": createReplaySelectionData(g_ReplaysFiltered[selected].directory) - } + }, + "viewPanel": g_SummaryViewPanel }); } Index: binaries/data/mods/public/gui/replaymenu/replay_menu.js =================================================================== --- binaries/data/mods/public/gui/replaymenu/replay_menu.js +++ binaries/data/mods/public/gui/replaymenu/replay_menu.js @@ -49,6 +49,11 @@ var g_ReplaysLoaded = false; /** + * Remember the name of the currently opened view panel. + */ +var g_SummaryViewPanel = ""; + +/** * Initializes globals, loads replays and displays the list. */ function init(data) @@ -69,6 +74,9 @@ initHotkeyTooltips(); displayReplayList(); + + if (data && data.summaryViewPanel) + g_SummaryViewPanel = data.summaryViewPanel; } /** Index: binaries/data/mods/public/gui/replaymenu/replay_menu.xml =================================================================== --- binaries/data/mods/public/gui/replaymenu/replay_menu.xml +++ binaries/data/mods/public/gui/replaymenu/replay_menu.xml @@ -254,7 +254,7 @@ - + Summary showReplaySummary(); Index: binaries/data/mods/public/gui/session/hotkeys/misc.xml =================================================================== --- binaries/data/mods/public/gui/session/hotkeys/misc.xml +++ binaries/data/mods/public/gui/session/hotkeys/misc.xml @@ -28,6 +28,10 @@ toggleTrade(); + + openGameSummary(); + + toggleConfigBool("silhouettes"); Index: binaries/data/mods/public/gui/session/menu.js =================================================================== --- binaries/data/mods/public/gui/session/menu.js +++ binaries/data/mods/public/gui/session/menu.js @@ -58,6 +58,11 @@ */ var g_BribeButtonsWaiting = {}; +/** + * Remember the name of the currently opened view panel. + */ +var g_SummaryViewPanel = ""; + // Redefined every time someone makes a tribute (so we can save some data in a closure). Called in input.js handleInputBeforeGui. var g_FlushTributing = function() {}; @@ -1068,7 +1073,8 @@ "gui": { "isInGame": true }, - "callback": "resumeGame" + "viewPanel": g_SummaryViewPanel, + "callback": "resumeGameAndSaveSummaryViewPanel" }); } @@ -1116,6 +1122,12 @@ pauseGame(false, explicit); } +function resumeGameAndSaveSummaryViewPanel(data) +{ + g_SummaryViewPanel = data.viewPanel; + resumeGame(data.explicitResume); +} + /** * Called when the current player toggles a pause button. */ Index: binaries/data/mods/public/gui/summary/layout.js =================================================================== --- binaries/data/mods/public/gui/summary/layout.js +++ binaries/data/mods/public/gui/summary/layout.js @@ -210,6 +210,16 @@ } }; +/* + * Array of the panel buttons. + */ +var g_PanelButtons = Object.keys(g_ScorePanelsData).concat(["charts"]).map(k => k + "PanelButton"); + +/* + * Remember the name of the currently opened view panel. + */ +var g_ViewPanel = g_PanelButtons[0]; + function getColoredTypeTranslation(type) { return g_SummaryTypes[type].color ? '[color="' + g_SummaryTypes[type].color + '"]' + g_SummaryTypes[type].caption + '[/color]' : g_SummaryTypes[type].caption; Index: binaries/data/mods/public/gui/summary/summary.js =================================================================== --- binaries/data/mods/public/gui/summary/summary.js +++ binaries/data/mods/public/gui/summary/summary.js @@ -125,6 +125,17 @@ "type": [0, 0] }; +/* + * Show next/previous panel. + * @param {integer} direction - 1/-1 forward, backward panel. + */ +function nextPanel(direction) +{ + let index = g_PanelButtons.indexOf(g_ViewPanel); + selectPanel(Engine.GetGUIObjectByName(g_PanelButtons[index == -1 ? 0 : index + direction < 0 ? + g_PanelButtons.length -1 : (index + direction) % g_PanelButtons.length])); +} + function selectPanel(panel) { // TODO: move panel buttons to a custom parent object @@ -146,6 +157,8 @@ updatePanelData(g_ScorePanelsData[panel.name.substr(0, panel.name.length - "PanelButton".length)]); else [0, 1].forEach(updateCategoryDropdown); + + g_ViewPanel = panel.name; } function initCharts() @@ -380,10 +393,11 @@ function continueButton() { if (g_GameData.gui.isInGame) - Engine.PopGuiPageCB(0); + Engine.PopGuiPageCB({ "explicitResume": 0, "viewPanel": g_ViewPanel }); else if (g_GameData.gui.isReplay) Engine.SwitchGuiPage("page_replaymenu.xml", { - "replaySelectionData": g_GameData.gui.replaySelectionData + "replaySelectionData": g_GameData.gui.replaySelectionData, + "summaryViewPanel": g_ViewPanel }); else if (Engine.HasXmppClient()) Engine.SwitchGuiPage("page_lobby.xml"); @@ -422,6 +436,9 @@ g_GameData = data; let assignedState = g_GameData.sim.playerStates[g_GameData.gui.assignedPlayer || -1]; + if (data && data.viewPanel) + g_ViewPanel = data.viewPanel; + Engine.GetGUIObjectByName("summaryText").caption = g_GameData.gui.isInGame ? translate("Current Scores") : @@ -485,5 +502,15 @@ calculateTeamCounterDataHelper(); initCharts(); - selectPanel(Engine.GetGUIObjectByName("scorePanelButton")); + selectPanel(Engine.GetGUIObjectByName(g_ViewPanel)); + + for (let panel of g_PanelButtons.map(k => Engine.GetGUIObjectByName(k))) + { + panel.onMouseWheelUp = function() { + nextPanel(1); + }; + panel.onMouseWheelDown = function() { + nextPanel(-1); + }; + } } Index: binaries/data/mods/public/gui/summary/summary.xml =================================================================== --- binaries/data/mods/public/gui/summary/summary.xml +++ binaries/data/mods/public/gui/summary/summary.xml @@ -15,6 +15,18 @@