fa
fa copied to clipboard
Initialize revamp scoreboard with starting play area
Get https://github.com/FAForever/fa/pull/3933 working for the new score panel. I don't like how I had to do it though.
It was already working, see:
- https://github.com/FAForever/fa/blob/feature/scoreboard-revamp/lua/ui/game/score-alt.lua#L57
- https://github.com/FAForever/fa/blob/feature/scoreboard-revamp/lua/ui/game/score-alt.lua#L407
Can't make a new scoreboard and not include this fancy feature 😄 . The idea of the new scoreboard is to have its own user sync callback, see the first link. That is called every time the sync is. We can keep all the interactions with the scoreboard in this one file by doing so.
I saw your other message, it is correct that it doesn't work at the moment - but that is only because the scoreboard doesn't exist from the very start. If it does, then it is one of the first UI elements to be initialized and then it would all work just fine.
Thinking about it thought, when we set the new playable area we should maybe just update the session information too.
Unfortunately, the ScenarioFramework will finish creating the map before the entire UI starts getting created. So registering the Sync callback anywhere in there will never catch the first area change when the map starts.
However, simply updating SessionGetScenarioInfo().size
does work.
This looks better 😄