Index: binaries/data/mods/public/gui/session/selection_details.js =================================================================== --- binaries/data/mods/public/gui/session/selection_details.js +++ binaries/data/mods/public/gui/session/selection_details.js @@ -318,6 +318,63 @@ showTemplateDetails(entState.template); }; + let SetupStat = (panel, i, icon, text) => { + if (!text) + { + Engine.GetGUIObjectByName(`${panel}[${i}]`).hidden = true; + return; + } + Engine.GetGUIObjectByName(`${panel}[${i}]`).hidden = false; + Engine.GetGUIObjectByName(`${panel}Icon[${i}]`).sprite = "stretched:color:255 255 255 30:textureAsMask:" + icon; + let size = Engine.GetGUIObjectByName(`${panel}[${i}]`).size; + size.top = 30*i; + size.bottom = 30*i+28; + Engine.GetGUIObjectByName(`${panel}[${i}]`).size = size; + Engine.GetGUIObjectByName(`${panel}Text[${i}]`).caption = text; + }; + + // Left-hand side of the stats panel + // DPS first. + if (!!template?.attack?.Melee || !!template?.attack?.Ranged) + { + let DPS = (template?.attack?.Melee || template?.attack?.Ranged)?.Damage; + DPS = (DPS?.Hack || 0) + (DPS?.Pierce || 0) + (DPS?.Crush || 0); + SetupStat("LHS", 0, "session/icons/dps.png", + (DPS / (template?.attack?.Melee || template?.attack?.Ranged).repeatTime * 1000).toFixed(1)); + } + else + SetupStat("LHS", 0); + + // Capture DPS + if (!!template?.attack?.Capture) + { + let CDPS = template.attack.Capture.Capture || 0; + SetupStat("LHS", 1, "session/icons/cdps.png", + (CDPS / template.attack.Capture.repeatTime * 1000).toFixed(1)); + } + else + SetupStat("LHS", 1); + + // Range + if (!!template?.attack?.Ranged) + SetupStat("LHS", 2, "session/icons/range.png", template.attack.Ranged.maxRange || 0); + else + SetupStat("LHS", 2); + + // Right-hand side -> resistances + if (!!template?.resistance?.Damage) + { + SetupStat("RHS", 0, "session/icons/res_hack.png", template.resistance.Damage?.Hack || 0); + SetupStat("RHS", 1, "session/icons/res_pierce.png", template.resistance.Damage?.Pierce || 0); + SetupStat("RHS", 2, "session/icons/res_crush.png", template.resistance.Damage?.Crush || 0); + } + else + { + SetupStat("RHS", 0); + SetupStat("RHS", 1); + SetupStat("RHS", 2); + } + let detailedTooltip = [ getAttackTooltip, getHealerTooltip, @@ -332,7 +389,7 @@ ].map(func => func(entState)).filter(tip => tip).join("\n"); if (detailedTooltip) { - Engine.GetGUIObjectByName("attackAndResistanceStats").hidden = false; + Engine.GetGUIObjectByName("attackAndResistanceStats").hidden = true; Engine.GetGUIObjectByName("attackAndResistanceStats").tooltip = detailedTooltip; } else Index: binaries/data/mods/public/gui/session/selection_panels.js =================================================================== --- binaries/data/mods/public/gui/session/selection_panels.js +++ binaries/data/mods/public/gui/session/selection_panels.js @@ -104,8 +104,9 @@ g_SelectionPanels.Command = { "getMaxNumberOfItems": function() { - return 6; + return 10; }, + "rowLength": 10, "getItems": function(unitEntStates) { let commands = []; @@ -138,14 +139,7 @@ data.icon.sprite = "stretched:session/icons/" + data.item.icon; - let size = data.button.size; - // relative to the center ( = 50%) - size.rleft = 50; - size.rright = 50; - // offset from the center calculation, count on square buttons, so size.bottom is the width too - size.left = (data.i - data.numberOfItems / 2) * (size.bottom + 1); - size.right = size.left + size.bottom; - data.button.size = size; + setPanelObjectPosition(data.button, data.i + 30, data.rowLength); return true; } }; @@ -153,7 +147,7 @@ g_SelectionPanels.Construction = { "getMaxNumberOfItems": function() { - return 40 - getNumberOfRightPanelButtons(); + return 30 - getNumberOfRightPanelButtons(); }, "rowLength": 10, "getItems": function() @@ -359,7 +353,7 @@ g_SelectionPanels.Gate = { "getMaxNumberOfItems": function() { - return 40 - getNumberOfRightPanelButtons(); + return 30 - getNumberOfRightPanelButtons(); }, "rowLength": 10, "getItems": function(unitEntStates) @@ -401,7 +395,7 @@ g_SelectionPanels.Pack = { "getMaxNumberOfItems": function() { - return 40 - getNumberOfRightPanelButtons(); + return 30 - getNumberOfRightPanelButtons(); }, "rowLength": 10, "getItems": function(unitEntStates) @@ -788,7 +782,7 @@ if (template.icon) icon.sprite = modifier + "stretched:session/portraits/" + template.icon; - setPanelObjectPosition(button, position, data.rowLength); + setPanelObjectPosition(button, position + data.rowLength, data.rowLength); // Prepare to handle the top button (if any) position -= data.rowLength; @@ -913,7 +907,7 @@ g_SelectionPanels.Training = { "getMaxNumberOfItems": function() { - return 40 - getNumberOfRightPanelButtons(); + return 30 - getNumberOfRightPanelButtons(); }, "rowLength": 10, "getItems": function() @@ -1021,7 +1015,7 @@ g_SelectionPanels.Upgrade = { "getMaxNumberOfItems": function() { - return 40 - getNumberOfRightPanelButtons(); + return 30 - getNumberOfRightPanelButtons(); }, "rowLength": 10, "getItems": function(unitEntStates) Index: binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml =================================================================== --- binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml +++ binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml @@ -1,26 +1,50 @@ + + + + + + + Experience + + + + + + + + Rank + + + + + + + + + + - - - + + -