fa icon indicating copy to clipboard operation
fa copied to clipboard

Initialize revamp scoreboard with starting play area

Open Hdt80bro opened this issue 2 years ago • 4 comments

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.

Hdt80bro avatar Jun 12 '22 01:06 Hdt80bro

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.

Garanas avatar Jun 12 '22 07:06 Garanas

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.

Garanas avatar Jun 12 '22 07:06 Garanas

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.

Hdt80bro avatar Jun 13 '22 15:06 Hdt80bro

This looks better 😄

Garanas avatar Jun 13 '22 19:06 Garanas