- Joined
- May 6, 2007
- Messages
- 30
I've been attempting to make some edits to some existing mods for personal use. I know nothing about actual code when it comes to JS or CSS, and so I've sorta been hacking my way through combining Racington's Unit Icon Size and Polo's Vertical Health Bars. Needless to say, I've been mostly successful
, but I'm running into one final issue that I cannot figure out.
Issue: After increasing the size of the commander's promotion level text, it is no longer centered on the unit icon.
I've provided a rough overview for what is happening in the image at the bottom of the post to go along with what I've written (including links to the modified code), but here's a quick way to get to where I'm at:
I'll add that you can further control the promotion level in
Regardless, this has been driving me crazy for the past day as I furiously search the internet, looking for some random code that may or may not fix this issue, and I've made zero progress. Again, I know nothing about actual programming, and I probably could've figured this out if I did, but at this point I'm stuck, and any help would be greatly appreciated.
If you wish to review the code changes I've made above, here they are.
unit-flags.css - https://pastebin.com/RiwzCxiC
unit-flags.js - https://pastebin.com/aEYQcinw

Issue: After increasing the size of the commander's promotion level text, it is no longer centered on the unit icon.
I've provided a rough overview for what is happening in the image at the bottom of the post to go along with what I've written (including links to the modified code), but here's a quick way to get to where I'm at:
- In
..\Sid Meier's Civilization VII\Base\modules\base-standard\ui\unit-flags\
- unit-flags.css - Increase visibility of commander's promotion level:
unit-flags.css
,line 171
,unit-flag__promotion-number
:- Set the
top
value to something slightly larger (1.5rem
). - Add
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
- Set the
- unit-flags.js - Increase scale of unit icons:
unit-flags.js
,line 70
- Set
'w-12', 'h-12'
to something larger (18 or 20). - This will mess up the tier graphic, but we're not concerned about that because I already have a solution.
- Note: You may need to further increase the
top
setting in the CSS file to get a better view of the commander's promotion level after bumping up the size (3.5rem
).
- Set
- unit-flags.css - Increase font size of commander promotion level:
unit-flags.css
,line 171
,unit-flag__promotion-number
:- Add
font-size: 32px;
- Note: There's more than one way to increase the font size, so use whatever works for you.
- Add
64px
), the single-digit number will also drift away from the center. It's as if the element that handles (or contains) the text is scaling from the upper left, rather than from the center.I'll add that you can further control the promotion level in
unit-flags.js
, line 105
, where arguments, such as 'text-center'
, are assigned, but I don't know anything about JS to make any additions here.Regardless, this has been driving me crazy for the past day as I furiously search the internet, looking for some random code that may or may not fix this issue, and I've made zero progress. Again, I know nothing about actual programming, and I probably could've figured this out if I did, but at this point I'm stuck, and any help would be greatly appreciated.
If you wish to review the code changes I've made above, here they are.
unit-flags.css - https://pastebin.com/RiwzCxiC
unit-flags.js - https://pastebin.com/aEYQcinw