add semitransparent background for unit counter
Adds semitransparent background for unit counter to improve visibility of displaying text which fixes issue #2854
The new SetColorShadow() works better than internal SetDropShadow() for displaying text, e.g. white unit count over bright blue background of air units
Units counter with new semitransparent background:
this work similar to existing semitransparent background used in displaying keybinding in construction menu:
Note above screenshots where taken with a mod that increase size of strategic icons so this is why they appear to overlap with unit counter. @Garanas should we add an option to configure placement of strategic icons on left/right side of the unit icon? Also, I could add options to configure color of unit counter and background if you want?
@Garanas should we add an option to configure placement of strategic icons on left/right side of the unit icon? Also, I could add options to configure color of unit counter and background if you want?
I don't see the need to customize it further, the overlap is minimal. It'd be better I think if we draw the strategic icon on top of the background
@Garanas I checked implementation of construction.lua and there are a lot of duplicated code and low performance code so I will make a few other improvements in this PR. Please do not merge it for now.
@HUSSAR-mtrela could you elaborate as to what you'd like to improve, and how you'd want to do that?
@Garanas I'm working on this kind of improvements:
- move logic for getting icons and basic info about units to utility functions for reuse by other UI
- improve performance by caching common data that is generated for each unit and build option
- use classes to encapsulate some UI elements of construction.lua so we can re-use in avatar.lua
- add a few options to configure appearance of units in construction menu
above improvements should help us later do overhaul of the whole construction like you are planning with the lobby.
@HUSSAR-mtrela Your work may have a conflict with https://github.com/FAForever/fa/pull/5484