From 5fbd9865242b911e24b4c614cf52df88a859633a Mon Sep 17 00:00:00 2001 From: LangLangbart <92653266+LangLangBart@users.noreply.github.com> Date: Mon, 13 Mar 2023 08:04:28 +0100 Subject: [PATCH] fix: add a subtle gray circle to the visibility indicator in the top panel the gray circle helps with the contrast for dark colours --- .../ui/session/phosphor/circle-empty.png | Bin 0 -> 480 bytes .../ui/session/phosphor/circle-full.png | Bin 0 -> 430 bytes gui/session/boonGUI_XML/sprites.xml | 8 ++++++++ gui/session/stats/BoonGUIStatsTopPanelRow.js | 13 +++++++----- .../stats/sections/BoonGUIStatsTopPanel.xml | 19 +++++++++++------- 5 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 art/textures/ui/session/phosphor/circle-empty.png create mode 100644 art/textures/ui/session/phosphor/circle-full.png diff --git a/art/textures/ui/session/phosphor/circle-empty.png b/art/textures/ui/session/phosphor/circle-empty.png new file mode 100644 index 0000000000000000000000000000000000000000..3b7a619773f7083e3c4981235df4629430600327 GIT binary patch literal 480 zcmV<60U!Q}P)Px$nn^@KR5(v%lf7z`VGxC%1A&cUAxIj*GNeequ;c=Q7mzBQU}Yg#Sj%E<5lE3L zkS>)MAh`fpu-_u24A_VWVKpEenR$P9zs<+8-_OjMnRDj6qFn;q-||6XVXUL~f4Zu>?PK2vxa=_o9mxza=*}Ay~1jfKUVmA!3 zG8Tk^KFPe=+=ApvD+_%EKBl3Hj|Wzs0egZEMvwI*6vN6Rtk1wtPx$Xh}ptR5(vvlg&*7Q4EB?IpmrX9ncLG1PMeTL_z#D0!TmusRla8DY+$wLC^Nv zePj>W-K;$`9?ui)65w_h*zr33*FV+0eGrcFR?}MYrLM%#68Q>qnLzphZxIJPcQhzP zL+{Rq4bmEW(bXx{9c{k|o~L>>h>%h!;vM^Do*)ZKaM$<-+;!Sikg_(w<1kD;27P(r zkZecob0h8^EP)+p5w&h(x1UZr^%t0rG8aaNn8NZ3^O^HZ;tFYScwCuiJ>TU4_n4Qn z?G5x!RsXTp60b$7dz1iC)>l;<8)Fg`iL_=0U?uo0yNYS + + + + + diff --git a/gui/session/stats/BoonGUIStatsTopPanelRow.js b/gui/session/stats/BoonGUIStatsTopPanelRow.js index 688fd10e..6a428fea 100644 --- a/gui/session/stats/BoonGUIStatsTopPanelRow.js +++ b/gui/session/stats/BoonGUIStatsTopPanelRow.js @@ -75,6 +75,7 @@ class BoonGUIStatsTopPanelRow this.killDeathRatio = Engine.GetGUIObjectByName(`${PREFIX}_killDeathRatio`); this.los = Engine.GetGUIObjectByName(`${PREFIX}_los`); + this.losHighlight = Engine.GetGUIObjectByName(`${PREFIX}_losHighlight`); Engine.SetGlobalHotkey("structree", "Press", openStructTree); Engine.SetGlobalHotkey("civinfo", "Press", openStructTree); @@ -385,16 +386,18 @@ class BoonGUIStatsTopPanelRow tooltip += "Cowards do not count in battle; they are there, but not in it. Euripides"; this.killDeathRatioHighlight.tooltip = tooltip; + // Ever present slightly gray coloured empty circle, defined in the xml part. + // Place a full circle in the player's color over the gray circle, the gray circle is slightly visible, this is good for contrast with dark colors. + if(state.hasSharedLos || state.numberAllies == 1) + this.los.sprite = `stretched:color:${state.playerColor}:textureAsMask:session/phosphor/circle-full.png`; - const los = state.hasSharedLos || state.numberAllies == 1 ? "●" : "○"; - this.los.caption = setStringTags(los, { "color": state.playerColor }); color = state.brightenedPlayerColor; - tooltip = ""; - tooltip += `${playerNick}\n`; + tooltip = `${playerNick}\n`; font = "sans-stroke-20"; tooltip += `${setStringTags("○", { color, font })} / ${setStringTags("●", { color, font })}\n`; tooltip += "Full circle when cartography has been researched or when you are without mutual allies."; - this.los.tooltip = tooltip; + this.losHighlight.tooltip = tooltip; + } } diff --git a/gui/session/stats/sections/BoonGUIStatsTopPanel.xml b/gui/session/stats/sections/BoonGUIStatsTopPanel.xml index e2b98bca..b3f43ac1 100644 --- a/gui/session/stats/sections/BoonGUIStatsTopPanel.xml +++ b/gui/session/stats/sections/BoonGUIStatsTopPanel.xml @@ -466,13 +466,18 @@ + name="StatsTopPanelRow[n]_losHighlight" + size="945 0 100% 100%" + type="button" + style="statsHighlighter"> + + + +