diff --git a/binaries/data/mods/public/gui/summary/layout.js b/binaries/data/mods/public/gui/summary/layout.js index a1e8d2133b..48e68dc84a 100644 --- a/binaries/data/mods/public/gui/summary/layout.js +++ b/binaries/data/mods/public/gui/summary/layout.js @@ -13,17 +13,17 @@ var getScorePanelsData = () => [ "label": translate("Score"), "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, - { "identifier": "totalScore", "caption": translate("Total score"), "yStart": 16, "width": 100 }, - { "identifier": "economyScore", "caption": translate("Economy score"), "yStart": 16, "width": 100 }, - { "identifier": "militaryScore", "caption": translate("Military score"), "yStart": 16, "width": 100 }, - { "identifier": "explorationScore", "caption": translate("Exploration score"), "yStart": 16, "width": 100 } + { "identifier": "totalScore", "caption": translate("Total score"), "yStart": 0, "width": 120 }, + { "identifier": "economyScore", "caption": translate("Economy score"), "yStart": 0, "width": 120 }, + { "identifier": "militaryScore", "caption": translate("Military score"), "yStart": 0, "width": 120 }, + { "identifier": "explorationScore", "caption": translate("Exploration score"), "yStart": 0, "width": 120 } ], "titleHeadings": [], "counters": [ - { "width": 100, "fn": calculateScoreTotal, "verticalOffset": 12 }, - { "width": 100, "fn": calculateEconomyScore, "verticalOffset": 12 }, - { "width": 100, "fn": calculateMilitaryScore, "verticalOffset": 12 }, - { "width": 100, "fn": calculateExplorationScore, "verticalOffset": 12 } + { "width": 120, "fn": calculateScoreTotal }, + { "width": 120, "fn": calculateEconomyScore }, + { "width": 120, "fn": calculateMilitaryScore }, + { "width": 120, "fn": calculateExplorationScore } ], "teamCounterFn": calculateScoreTeam }, @@ -31,14 +31,14 @@ var getScorePanelsData = () => [ "label": translate("Structures"), "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, - { "identifier": "Structure", "caption": translate("Total"), "yStart": 34, "width": 105 }, - { "identifier": "House", "caption": translate("Houses"), "yStart": 34, "width": 85 }, - { "identifier": "Economic", "caption": translate("Economic"), "yStart": 34, "width": 85 }, - { "identifier": "Outpost", "caption": translate("Outposts"), "yStart": 34, "width": 85 }, - { "identifier": "Military", "caption": translate("Military"), "yStart": 34, "width": 85 }, - { "identifier": "Fortress", "caption": translate("Fortresses"), "yStart": 34, "width": 85 }, - { "identifier": "CivCentre", "caption": translate("Civ centers"), "yStart": 34, "width": 85 }, - { "identifier": "Wonder", "caption": translate("Wonders"), "yStart": 34, "width": 85 } + { "identifier": "Structure", "caption": translate("Total"), "yStart": 34, "width": 90 }, + { "identifier": "House", "caption": translate("Houses"), "yStart": 34, "width": 90 }, + { "identifier": "Economic", "caption": translate("Economic"), "yStart": 34, "width": 90 }, + { "identifier": "Outpost", "caption": translate("Outposts"), "yStart": 34, "width": 90 }, + { "identifier": "Military", "caption": translate("Military"), "yStart": 34, "width": 90 }, + { "identifier": "Fortress", "caption": translate("Fortresses"), "yStart": 34, "width": 90 }, + { "identifier": "CivCentre", "caption": translate("Civ centers"), "yStart": 34, "width": 90 }, + { "identifier": "Wonder", "caption": translate("Wonders"), "yStart": 34, "width": 90 } ], "titleHeadings": [ { @@ -50,18 +50,18 @@ var getScorePanelsData = () => [ "lost": getColoredTypeTranslation("lost") }), "yStart": 16, - "width": 85 * 7 + 105 - }, // width = 700 + "width": 90 * 8 + }, // width = 720 ], "counters": [ - { "width": 105, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 }, - { "width": 85, "fn": calculateBuildings, "verticalOffset": 3 } + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings }, + { "width": 90, "fn": calculateBuildings } ], "teamCounterFn": calculateBuildingsTeam }, @@ -69,15 +69,15 @@ var getScorePanelsData = () => [ "label": translate("Units"), "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, - { "identifier": "Unit", "caption": translate("Total"), "yStart": 34, "width": 105 }, - { "identifier": "Infantry", "caption": translate("Infantry"), "yStart": 34, "width": 85 }, - { "identifier": "Worker", "caption": translate("Worker"), "yStart": 34, "width": 85 }, - { "identifier": "Cavalry", "caption": translate("Cavalry"), "yStart": 34, "width": 85 }, - { "identifier": "Champion", "caption": translate("Champion"), "yStart": 34, "width": 85 }, - { "identifier": "Hero", "caption": translate("Heroes"), "yStart": 34, "width": 85 }, - { "identifier": "Siege", "caption": translate("Siege"), "yStart": 34, "width": 85 }, - { "identifier": "Ship", "caption": translate("Navy"), "yStart": 34, "width": 85 }, - { "identifier": "Trader", "caption": translate("Traders"), "yStart": 34, "width": 85 } + { "identifier": "Unit", "caption": translate("Total"), "yStart": 34, "width": 90 }, + { "identifier": "Infantry", "caption": translate("Infantry"), "yStart": 34, "width": 90 }, + { "identifier": "Worker", "caption": translate("Worker"), "yStart": 34, "width": 90 }, + { "identifier": "Cavalry", "caption": translate("Cavalry"), "yStart": 34, "width": 90 }, + { "identifier": "Champion", "caption": translate("Champion"), "yStart": 34, "width": 90 }, + { "identifier": "Hero", "caption": translate("Heroes"), "yStart": 34, "width": 90 }, + { "identifier": "Siege", "caption": translate("Siege"), "yStart": 34, "width": 90 }, + { "identifier": "Ship", "caption": translate("Navy"), "yStart": 34, "width": 90 }, + { "identifier": "Trader", "caption": translate("Traders"), "yStart": 34, "width": 90 } ], "titleHeadings": [ { @@ -88,19 +88,19 @@ var getScorePanelsData = () => [ "lost": getColoredTypeTranslation("lost") }), "yStart": 16, - "width": 85 * 8 + 105 - }, // width = 785 + "width": 90 * 9 + }, // width = 810 ], "counters": [ - { "width": 105, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 }, - { "width": 85, "fn": calculateUnits, "verticalOffset": 3 } + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits }, + { "width": 90, "fn": calculateUnits } ], "teamCounterFn": calculateUnitsTeam }, @@ -113,7 +113,7 @@ var getScorePanelsData = () => [ "identifier": res.code, "caption": resourceNameFirstWord(res.code), "yStart": 34, - "width": 100 + "width": 110 })), { "identifier": "tributes", @@ -123,12 +123,12 @@ var getScorePanelsData = () => [ "sent": getColoredTypeTranslation("sent"), "received": getColoredTypeTranslation("received") }), - "yStart": 16, - "width": 121 + "yStart": 0, + "width": 110 }, - { "identifier": "treasuresCollected", "caption": translate("Treasures collected"), "yStart": 16, "width": 85 }, - { "identifier": "loot", "caption": translate("Loot"), "yStart": 16, "width": 85 }, - { "identifier": "livestock", "caption": translate("Livestock bred"), "yStart": 16, "width": 85 } + { "identifier": "treasuresCollected", "caption": translate("Treasures collected"), "yStart": 0, "width": 85 }, + { "identifier": "loot", "caption": translate("Loot"), "yStart": 0, "width": 85 }, + { "identifier": "livestock", "caption": translate("Livestock bred"), "yStart": 0, "width": 85 } ], "titleHeadings": [ { @@ -138,20 +138,19 @@ var getScorePanelsData = () => [ "used": getColoredTypeTranslation("used") }), "yStart": 16, - "width": 100 * g_ResourceData.GetCodes().length + 110 + "width": 110 * g_ResourceData.GetCodes().length + 110 }, ], "counters": [ - { "width": 110, "fn": calculateTotalResources, "verticalOffset": 12 }, + { "width": 110, "fn": calculateTotalResources }, ...g_ResourceData.GetCodes().map(code => ({ "fn": calculateResources, - "verticalOffset": 12, - "width": 100 + "width": 110 })), - { "width": 121, "fn": calculateTributeSent, "verticalOffset": 12 }, - { "width": 85, "fn": calculateTreasureCollected, "verticalOffset": 12 }, - { "width": 85, "fn": calculateLootCollected, "verticalOffset": 12 }, - { "width": 85, "fn": calculateLivestockTrained, "verticalOffset": 12 } + { "width": 110, "fn": calculateTributeSent }, + { "width": 85, "fn": calculateTreasureCollected }, + { "width": 85, "fn": calculateLootCollected }, + { "width": 85, "fn": calculateLivestockTrained } ], "teamCounterFn": calculateResourcesTeam }, @@ -159,8 +158,8 @@ var getScorePanelsData = () => [ "label": translate("Market"), "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, - { "identifier": "tradeIncome", "caption": translate("Trade income"), "yStart": 16, "width": 100 }, - { "identifier": "barterEfficency", "caption": translate("Barter efficiency"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "tradeIncome", "caption": translate("Trade income"), "yStart": 0, "width": 120 }, + { "identifier": "barterEfficency", "caption": translate("Barter efficiency"), "yStart": 0, "width": 120, "format": "PERCENTAGE" }, ...g_ResourceData.GetResources().map(res => { return { "identifier": res.code, @@ -170,19 +169,18 @@ var getScorePanelsData = () => [ "resourceFirstWord": resourceNameFirstWord(res.code), "resourceWithinSentence": resourceNameWithinSentence(res.code) }), - "yStart": 16, - "width": 100 + "yStart": 0, + "width": 120 }; }) ], "titleHeadings": [], "counters": [ - { "width": 100, "fn": calculateTradeIncome, "verticalOffset": 12 }, - { "width": 100, "fn": calculateBarterEfficiency, "verticalOffset": 12 }, + { "width": 120, "fn": calculateTradeIncome }, + { "width": 120, "fn": calculateBarterEfficiency }, ...g_ResourceData.GetCodes().map(code => ({ - "width": 100, - "fn": calculateResourceExchanged, - "verticalOffset": 12 + "width": 120, + "fn": calculateResourceExchanged })) ], "teamCounterFn": calculateMarketTeam @@ -191,13 +189,13 @@ var getScorePanelsData = () => [ "label": translate("Miscellaneous"), "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, - { "identifier": "killDeath", "caption": translate("Kill / Death ratio"), "yStart": 16, "width": 100, "format": "DECIMAL2" }, - { "identifier": "population", "caption": translate("Population"), "yStart": 16, "width": 100, "hideInSummary": true }, - { "identifier": "mapControlPeak", "caption": translate("Map control (peak)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, - { "identifier": "mapControl", "caption": translate("Map control (finish)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, - { "identifier": "mapExploration", "caption": translate("Map exploration"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, - { "identifier": "vegetarianRatio", "caption": translate("Vegetarian ratio"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, - { "identifier": "feminization", "caption": translate("Feminization"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "killDeath", "caption": translate("Kill / Death ratio"), "yStart": 0, "width": 110, "format": "DECIMAL2" }, + { "identifier": "population", "caption": translate("Population"), "yStart": 0, "width": 110, "hideInSummary": true }, + { "identifier": "mapControlPeak", "caption": translate("Map control (peak)"), "yStart": 0, "width": 110, "format": "PERCENTAGE" }, + { "identifier": "mapControl", "caption": translate("Map control (finish)"), "yStart": 0, "width": 110, "format": "PERCENTAGE" }, + { "identifier": "mapExploration", "caption": translate("Map exploration"), "yStart": 0, "width": 110, "format": "PERCENTAGE" }, + { "identifier": "vegetarianRatio", "caption": translate("Vegetarian ratio"), "yStart": 0, "width": 110, "format": "PERCENTAGE" }, + { "identifier": "feminization", "caption": translate("Feminization"), "yStart": 0, "width": 110, "format": "PERCENTAGE" }, { "identifier": "bribes", "caption": translate("Bribes"), @@ -206,20 +204,20 @@ var getScorePanelsData = () => [ "succeeded": getColoredTypeTranslation("succeeded"), "failed": getColoredTypeTranslation("failed") }), - "yStart": 16, - "width": 139 + "yStart": 0, + "width": 110 } ], "titleHeadings": [], "counters": [ - { "width": 100, "fn": calculateKillDeathRatio, "verticalOffset": 12 }, - { "width": 100, "fn": calculatePopulationCount, "verticalOffset": 12, "hideInSummary": true }, - { "width": 100, "fn": calculateMapPeakControl, "verticalOffset": 12 }, - { "width": 100, "fn": calculateMapFinalControl, "verticalOffset": 12 }, - { "width": 100, "fn": calculateMapExploration, "verticalOffset": 12 }, - { "width": 100, "fn": calculateVegetarianRatio, "verticalOffset": 12 }, - { "width": 100, "fn": calculateFeminization, "verticalOffset": 12 }, - { "width": 139, "fn": calculateBribes, "verticalOffset": 12 } + { "width": 110, "fn": calculateKillDeathRatio }, + { "width": 110, "fn": calculatePopulationCount, "hideInSummary": true }, + { "width": 110, "fn": calculateMapPeakControl }, + { "width": 110, "fn": calculateMapFinalControl }, + { "width": 110, "fn": calculateMapExploration }, + { "width": 110, "fn": calculateVegetarianRatio }, + { "width": 110, "fn": calculateFeminization }, + { "width": 110, "fn": calculateBribes } ], "teamCounterFn": calculateMiscellaneousTeam } @@ -269,7 +267,7 @@ function updateGeneralPanelHeadings(allHeadings) let headerGUI = Engine.GetGUIObjectByName(headerGUIName); headerGUI.caption = headings[h].headerCaption || headings[h].caption; - headerGUI.size = left + " " + headings[h].yStart + " " + (left + headings[h].width) + " 100%"; + headerGUI.size = (left - 4) + " " + headings[h].yStart + " " + (left + headings[h].width + 4) + " 69"; headerGUI.hidden = false; if (headings[h].width < g_LongHeadingWidth) @@ -312,7 +310,7 @@ function updateGeneralPanelCounter(allCounters) for (let w in counters) { counterObject = Engine.GetGUIObjectByName("valueData[" + p + "][" + w + "]"); - counterObject.size = left + " " + counters[w].verticalOffset + " " + (left + counters[w].width) + " 100%"; + counterObject.size = left + " 0 " + (left + counters[w].width) + " 100%"; counterObject.hidden = false; left += counters[w].width; } @@ -327,12 +325,12 @@ function updateGeneralPanelCounter(allCounters) for (let w in counters) { counterObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + p + "][" + w + "]"); - counterObject.size = left + " " + counters[w].verticalOffset + " " + (left + counters[w].width) + " 100%"; + counterObject.size = left + " 0 " + (left + counters[w].width) + " 100%"; counterObject.hidden = false; if (g_Teams[t]) { - let yStart = 25 + g_Teams[t].length * (g_PlayerBoxYSize + g_PlayerBoxGap) + 3 + counters[w].verticalOffset; + let yStart = 25 + g_Teams[t].length * (g_PlayerBoxYSize + g_PlayerBoxGap) + 3; counterTotalObject = Engine.GetGUIObjectByName("valueDataTeam[" + t + "][" + w + "]"); counterTotalObject.size = (left + 20) + " " + yStart + " " + (left + counters[w].width) + " 100%"; counterTotalObject.hidden = false; diff --git a/binaries/data/mods/public/gui/summary/summary.js b/binaries/data/mods/public/gui/summary/summary.js index 523a4e537f..159aba27ae 100644 --- a/binaries/data/mods/public/gui/summary/summary.js +++ b/binaries/data/mods/public/gui/summary/summary.js @@ -256,7 +256,8 @@ function resizeDropdown(dropdown) let size = dropdown.size; size.bottom = dropdown.size.top + (Engine.GetTextWidth(dropdown.font, dropdown.list[dropdown.selected]) > - dropdown.size.right - dropdown.size.left - 32 ? 42 : 27); + dropdown.size.right - dropdown.size.left - 28 && + dropdown.list[dropdown.selected].indexOf(" ") !== -1 ? 42 : 28); dropdown.size = size; } diff --git a/binaries/data/mods/public/gui/summary/summary.xml b/binaries/data/mods/public/gui/summary/summary.xml index 02363ad4f4..349ba51601 100644 --- a/binaries/data/mods/public/gui/summary/summary.xml +++ b/binaries/data/mods/public/gui/summary/summary.xml @@ -30,7 +30,7 @@ - + -