Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
font
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed Mar 6, 2022
1 parent 554fa19 commit 2b2f8df
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gui/session/boonGUI_XML/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- STATS TOP PANEL -->
<style name="overlayHeader" font="sans-bold-stroke-16" textcolor="white" text_align="right" text_valign="top" tooltip_style="sessionToolTipCircle" />
<style name="overlayDefault" font="sans-stroke-20" textcolor="250 250 250" text_align="right" text_valign="top" tooltip_style="sessionToolTipCircle" />
<style name="overlayDefaultBold" font="sans-bold-stroke-16" textcolor="250 250 250" text_align="left" text_valign="bottom" tooltip_style="sessionToolTipCircle" />
<style name="overlayDefaultBold" font="sans-bold-stroke-18" textcolor="250 250 250" text_align="left" text_valign="bottom" tooltip_style="sessionToolTipCircle" />
<style name="overlayResourceCounts" font="sans-stroke-20" textcolor="250 250 250" text_align="right" text_valign="top" tooltip_style="sessionToolTipCircle" ghost="true"/>
<style name="overlayResourceExtra" font="sans-stroke-14" textcolor="250 250 250" text_align="right" text_valign="bottom" tooltip_style="sessionToolTipCircle"/>
<style name="playerInfoButton" sprite_over="simpleHighlighter" tooltip_style="sessionToolTipWideCircle" sound_pressed="audio/interface/ui/ui_button_click.ogg" />
Expand Down
4 changes: 1 addition & 3 deletions gui/session/counters/BoonGUICounterManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ class BoonGUICounterManager

init()
{
verticallySpaceObjects("resourceCountsBoon", this.counters.length * 8);
hideRemaining("resourceCountsBoon", this.counters.length);

verticallySpaceObjects("resourceCountsBoon", 40);
for (const counter of this.counters)
{
counter.icon.sprite = "stretched:session/icons/resources/" + counter.resCode + ".png";
Expand Down
4 changes: 1 addition & 3 deletions gui/session/stats/BoonGUIHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ function verticallySpaceObjects(parentName, margin = 0)
for (let i = 0; i < objects.length; ++i)
{
const size = objects[i].size;
const height = size.bottom - size.top;
size.top = i * (height + margin);
size.bottom = i * height;
size.top = i * margin;
objects[i].size = size;
}
}
Expand Down
2 changes: 1 addition & 1 deletion gui/session/stats/BoonGUIStatsModesRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class BoonGUIStatsModesRow
const Emblem = civ.Emblem.replace(BoonGUIStatsTopPanelRow.Regex_Emblem, "$1");

tooltip = "";
const font = state.nick.length >= 18 ? "sans-stroke-14" : "sans-stroke-18";
const font = state.nick.length >= 17 ? "sans-stroke-16" : "sans-stroke-18";
tooltip += setStringTags(`${state.nick}\n`, { "color": state.playerColor, font });
if (state.team != -1)
{
Expand Down
5 changes: 2 additions & 3 deletions gui/session/stats/BoonGUIStatsTopPanelRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class BoonGUIStatsTopPanelRow
this.team.caption = `${state.team + 1}`;
}
const playerNick = setStringTags(state.nick, { "color": state.playerColor });
caption = state.nick.length <= 11 ? state.nick : state.nick.substr(0, 10) + "…";
caption = state.nick.length <= 9 ? state.nick : state.nick.substr(0, 8) + "…";
this.player.caption = caption;
this.playerHomeButton.tooltip = setStringTags(state.name, { "color": state.playerColor });
this.playerHomeButton.tooltip += state.team != -1 ? setStringTags("\nTeam " + this.team.caption, { "color": state.teamColor }) : "";
Expand Down Expand Up @@ -155,8 +155,7 @@ class BoonGUIStatsTopPanelRow
size.top = this.phaseProgressTop + this.phaseProgressHeight * progress;
this.phaseProgress.size = size;
}
font = "sans-bold-stroke-20";
const popCount = setStringTags(state.popCount.toString().padStart(3), { font });
const popCount = state.popCount.toString().padStart(3);
const popLimit = state.popLimit.toString().padStart(3);
const popMax = state.popMax;
tooltip = "";
Expand Down
3 changes: 1 addition & 2 deletions gui/session/stats/sections/BoonGUIStatsTopPanel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@
<object name="StatsTopPanelRow[n]_rating" type="text" text_align="center" style="overlayDefaultBold" ghost="true" size="127 0% 162 100%"/>
</object>
<object name="StatsTopPanelRow[n]_civ" type="button" size="167 -2 212 100%" style="iconButtonPhase" tooltip_style="sessionToolTipWideCircle">
<object name="StatsTopPanelRow[n]_civIcon" size="2 2 100%-2 100%-2" type="button" ghost="true" tooltip_style="sessionToolTipWideCircle"/>
<object name="StatsTopPanelRow[n]_civIcon" size="2 2 100%-2 100%-2" type="image" ghost="true" />
</object>

<object name="StatsTopPanelRow[n]_phase" type="button" size="213 2 237 26" style="iconButtonPhase">
<object name="StatsTopPanelRow[n]_phaseIcon" type="button" size="2 2 22 22" ghost="true" />
<object name="StatsTopPanelRow[n]_phaseProgressSlider" type="image" sprite="queueProgressSlider" ghost="true" size="2 2 22 21" z="20" />
Expand Down
5 changes: 3 additions & 2 deletions gui/session/top_panel/CounterPopulation~boongui.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
CounterPopulation.prototype.rebuild = function(playerState, diploColor)
{
this.count.caption = sprintf(this.CounterCaption, playerState);
const font = this.count.caption.length > 12 ? "sans-stroke-16" : "sans-stroke-18";
const cCL = this.count.caption.length;
const font = cCL <= 41 ? "sans-stroke-20" : cCL <= 42 ?"sans-stroke-18": "sans-stroke-16";
this.count.caption = setStringTags(this.count.caption, { font });
let total = 0;
for (const resCode of g_ResourceData.GetCodes())
Expand All @@ -15,4 +16,4 @@ CounterPopulation.prototype.rebuild = function(playerState, diploColor)
this.panel.tooltip += setStringTags("\nTotal Gatherers", { "color": total ? "white" : "dimmedWhite" }) + `${g_Indent}` + this.stats.caption;
};

CounterPopulation.prototype.CounterCaption = setStringTags("%(popCount)s", { "font": "sans-bold-stroke-16" }) + "/%(popLimit)s\n" + setStringTags("(%(popMax)s)", { "font": "sans-stroke-14" });
CounterPopulation.prototype.CounterCaption = "%(popCount)s/%(popLimit)s\n" + setStringTags("(%(popMax)s)", { "font": "sans-stroke-12" });

0 comments on commit 2b2f8df

Please sign in to comment.