fa icon indicating copy to clipboard operation
fa copied to clipboard

add semitransparent background for unit counter

Open HUSSAR-mtrela opened this issue 2 years ago • 5 comments

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: image

this work similar to existing semitransparent background used in displaying keybinding in construction menu: image

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?

HUSSAR-mtrela avatar Sep 10 '23 01:09 HUSSAR-mtrela

@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 avatar Sep 10 '23 06:09 Garanas

@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 avatar Sep 13 '23 14:09 HUSSAR-mtrela

@HUSSAR-mtrela could you elaborate as to what you'd like to improve, and how you'd want to do that?

Garanas avatar Sep 18 '23 06:09 Garanas

@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 avatar Sep 22 '23 19:09 HUSSAR-mtrela

@HUSSAR-mtrela Your work may have a conflict with https://github.com/FAForever/fa/pull/5484

Garanas avatar Oct 01 '23 08:10 Garanas