Index: ps/trunk/binaries/data/config/default.cfg =================================================================== --- ps/trunk/binaries/data/config/default.cfg +++ ps/trunk/binaries/data/config/default.cfg @@ -147,9 +147,10 @@ bigscreenshot = "Shift+F2" ; Take large BMP screenshot 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 +wireframe = "Alt+Shift+W" ; Toggle wireframe mode +silhouettes = "Alt+Shift+S" ; Toggle unit silhouettes showsky = "Alt+Z" ; Toggle sky +summary = "Ctrl+Tab" ; Toggle in-game summary ; > CLIPBOARD CONTROLS copy = "Ctrl+C" ; Copy to clipboard @@ -329,6 +330,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.tab] +next = "Alt+S" ; Show the next tab +prev = "Alt+W" ; Show the previous tab + [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: ps/trunk/binaries/data/mods/public/gui/credits/credits.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/credits.js +++ ps/trunk/binaries/data/mods/public/gui/credits/credits.js @@ -1,6 +1,7 @@ var g_PanelNames = ["special", "programming", "art", "translators", "misc", "donators"]; var g_ButtonNames = {}; var g_PanelTexts = {}; +var g_SelectedPanel = 0; function init() { @@ -21,9 +22,17 @@ selectPanel(0); } -function placeButtons() +/* + * Show next/previous panel. + * @param direction - 1/-1 forward, backward panel. + */ +function selectNextTab(direction) { + selectPanel((g_SelectedPanel + direction + g_PanelNames.length) % g_PanelNames.length); +} +function placeButtons() +{ for (let i = 0; i < g_PanelNames.length; ++i) { let button = Engine.GetGUIObjectByName("creditsPanelButton[" + i + "]"); @@ -32,6 +41,8 @@ warn("Could not display some credits."); break; } + button.onMouseWheelUp = () => selectNextTab(1); + button.onMouseWheelDown = () => selectNextTab(-1); button.hidden = false; let size = button.size; size.top = i * 35; @@ -84,6 +95,7 @@ function selectPanel(i) { + g_SelectedPanel = i; Engine.GetGUIObjectByName("creditsPanelButtons").children.forEach((button, j) => { button.sprite = i == j ? "ModernTabVerticalForeground" : "ModernTabVerticalBackground"; }); Index: ps/trunk/binaries/data/mods/public/gui/credits/credits.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/credits.xml +++ ps/trunk/binaries/data/mods/public/gui/credits/credits.xml @@ -14,6 +14,14 @@ + + selectNextTab(1); + + + + selectNextTab(-1); + + 0 A.D. Credits Index: ps/trunk/binaries/data/mods/public/gui/manual/intro.txt =================================================================== --- ps/trunk/binaries/data/mods/public/gui/manual/intro.txt +++ ps/trunk/binaries/data/mods/public/gui/manual/intro.txt @@ -49,6 +49,8 @@ Shift + F11: Save current profiler data to "logs/profile.txt" F2: Take screenshot (in .png format, location is displayed in the top left of the GUI after the file has been saved, and can also be seen in the console/logs if you miss it there) Shift + F2: Take huge screenshot (6400px*4800px, in .bmp format, location is displayed in the top left of the GUI after the file has been saved, and can also be seen in the console/logs if you miss it there) +Alt + S: Switch to the next tab. +Alt + W: Switch to the previous tab. [font="sans-bold-14"]In Game [font="sans-14"]Double Left Click \[on unit]: Select all of your units of the same kind on the screen (even if they're different ranks) @@ -87,6 +89,7 @@ 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) +Ctrl + Tab: Toggle summary window. [font="sans-bold-14"]Modify mouse action [font="sans-14"]Ctrl + Right Click on building: Garrison @@ -110,8 +113,8 @@ [font="sans-bold-14"]Overlays [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) +Alt + Shift + 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 + Shift + S: Toggle unit silhouettes (might give a small performance boost) Alt + Z: Toggle sky Alt + C: Toggle attack range visualizations of selected defensive structures Alt + V: Toggle aura range visualizations of selected units and structures Index: ps/trunk/binaries/data/mods/public/gui/options/options.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/options/options.js +++ ps/trunk/binaries/data/mods/public/gui/options/options.js @@ -160,6 +160,17 @@ }; } +/* + * Show next/previous panel. + * @param direction - 1/-1 forward, backward panel. + */ +function selectNextTab(direction) +{ + g_SelectedCategory = (g_SelectedCategory + direction + Object.keys(g_Options).length) % + Object.keys(g_Options).length; + displayOptions(); +} + function placeTabButtons() { for (let category in g_Options) @@ -171,6 +182,8 @@ break; } + button.onMouseWheelUp = () => selectNextTab(1); + button.onMouseWheelDown = () => selectNextTab(-1); button.hidden = false; let size = button.size; Index: ps/trunk/binaries/data/mods/public/gui/options/options.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/options/options.xml +++ ps/trunk/binaries/data/mods/public/gui/options/options.xml @@ -8,6 +8,14 @@ + + selectNextTab(1); + + + + selectNextTab(-1); + + Index: ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_actions.js +++ ps/trunk/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) - } + }, + "selectedData": g_SummarySelectedData }); } Index: ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_menu.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_menu.js +++ ps/trunk/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_SummarySelectedData = ""; + +/** * Initializes globals, loads replays and displays the list. */ function init(data) @@ -69,6 +74,9 @@ initHotkeyTooltips(); displayReplayList(); + + if (data && data.summarySelectedData) + g_SummarySelectedData = data.summarySelectedData; } /** Index: ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_menu.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_menu.xml +++ ps/trunk/binaries/data/mods/public/gui/replaymenu/replay_menu.xml @@ -239,7 +239,7 @@ - + Summary showReplaySummary(); Index: ps/trunk/binaries/data/mods/public/gui/session/hotkeys/misc.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/hotkeys/misc.xml +++ ps/trunk/binaries/data/mods/public/gui/session/hotkeys/misc.xml @@ -28,6 +28,10 @@ toggleTrade(); + + openGameSummary(); + + toggleConfigBool("silhouettes"); Index: ps/trunk/binaries/data/mods/public/gui/session/menu.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/menu.js +++ ps/trunk/binaries/data/mods/public/gui/session/menu.js @@ -58,6 +58,11 @@ */ var g_BribeButtonsWaiting = {}; +/** + * Currently viewed summary panel. + */ +var g_SummarySelectedData = ""; + // 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() {}; @@ -1075,7 +1080,8 @@ "gui": { "isInGame": true }, - "callback": "resumeGame" + "selectedData": g_SummarySelectedData, + "callback": "resumeGameAndSaveSummarySelectedData" }); } @@ -1123,6 +1129,12 @@ pauseGame(false, explicit); } +function resumeGameAndSaveSummarySelectedData(data) +{ + g_SummarySelectedData = data.summarySelectedData; + resumeGame(data.explicitResume); +} + /** * Called when the current player toggles a pause button. */ Index: ps/trunk/binaries/data/mods/public/gui/summary/summary.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/summary.js +++ ps/trunk/binaries/data/mods/public/gui/summary/summary.js @@ -125,11 +125,30 @@ "type": [0, 0] }; +/* + * Array of the panel button names. + */ +var g_PanelButtons = []; + +/* + * Remember the name of the currently opened view panel. + */ +var g_SelectedPanel = ""; + function init(data) { // Fill globals g_GameData = data; g_ScorePanelsData = getScorePanelsData(); + g_PanelButtons = Object.keys(g_ScorePanelsData).concat(["charts"]).map(panel => panel + "PanelButton"); + + g_SelectedPanel = g_PanelButtons[0]; + if (data && data.selectedData) + { + g_SelectedPanel = data.selectedData.panel; + g_SelectedChart = data.selectedData.charts; + } + initTeamData(); calculateTeamCounterDataHelper(); @@ -137,7 +156,23 @@ initPlayerBoxPositions(); initGUICharts(); initGUILabelsAndButtons(); - selectPanel(Engine.GetGUIObjectByName("scorePanelButton")); + selectPanel(Engine.GetGUIObjectByName(g_SelectedPanel)); + for (let button of g_PanelButtons) + { + let tab = Engine.GetGUIObjectByName(button); + tab.onMouseWheelUp = () => selectNextTab(1); + tab.onMouseWheelDown = () => selectNextTab(-1); + } +} + +/* + * Show next/previous panel. + * @param direction - 1/-1 forward, backward panel. + */ +function selectNextTab(direction) +{ + selectPanel(Engine.GetGUIObjectByName(g_PanelButtons[ + (g_PanelButtons.indexOf(g_SelectedPanel) + direction + g_PanelButtons.length) % g_PanelButtons.length])); } function selectPanel(panel) @@ -161,6 +196,8 @@ updatePanelData(g_ScorePanelsData[panel.name.substr(0, panel.name.length - "PanelButton".length)]); else [0, 1].forEach(updateCategoryDropdown); + + g_SelectedPanel = panel.name; } function initGUICharts() @@ -395,11 +432,19 @@ function continueButton() { + let summarySelectedData = { + "panel": g_SelectedPanel, + "charts": g_SelectedChart + }; if (g_GameData.gui.isInGame) - Engine.PopGuiPageCB(0); + Engine.PopGuiPageCB({ + "explicitResume": 0, + "summarySelectedData": summarySelectedData + }); else if (g_GameData.gui.isReplay) Engine.SwitchGuiPage("page_replaymenu.xml", { - "replaySelectionData": g_GameData.gui.replaySelectionData + "replaySelectionData": g_GameData.gui.replaySelectionData, + "summarySelectedData": summarySelectedData }); else if (Engine.HasXmppClient()) Engine.SwitchGuiPage("page_lobby.xml"); Index: ps/trunk/binaries/data/mods/public/gui/summary/summary.xml =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/summary.xml +++ ps/trunk/binaries/data/mods/public/gui/summary/summary.xml @@ -5,6 +5,25 @@