[WIP] Tracking individual games instead of just the score #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to make the scoreboard able to remember each game. This would most importantly allow us to fully report a set from TSH (#629).
It is currently in a prototype state. A lot of areas need to be changed, most importantly
I need your feedbacks and ideas on ... well, this whole mess !
The current score of the match, as well as individual games, are managed by the ScoreManager (new class) ; the Scoreboard widget owns a ScoreManager instance.
When the score changes in the ScoreManager, it is reflected in the state (by OnScoreChanged)
When the score is changed in the UI, instead of directly changing the state, the scoreboard widget informs the ScoreManager of the change (via OnScoreUIChanged)
When an external source attemps to change the score (auto-update or stage strike app), instead of directly changing the value if the UI,
we call ScoreManager.CommandScoreChange, which changes the score in the UI.
Note that CommandScoreChange calls OnScoreChanged to update the state with the new data, then updates the UI, which calls OnScoreUIChanged, which calls OnScoreChanged a second time.
This is because there doesn't seem to be a safe way to make a difference between a code-induced change and an user-made change in the UI. I'm starting to hate Qt.
(It isn't a problem anyway, as OnScoreChanged will check for differences and see that there isn't any -> doing nothing)
The ScoreManager can track individual games, when the information it receives allows it to ; but it may also stop tracking them ("score-only mode")
Example 1 : The score is manually changed in the UI
Example 2 : data is received from start.gg, with chars and stage :
REGARDING THE STAGE STRIKE WEB APP (SSWA)
It should be possible to do what we want to do here without really touching the way the SSWA works, but i think this is a good occasion to try doing so.
My proposal is :
If that information is not known (we are in score-only mode or the last game has no winner), the user is prompted for it before the sync message is sent.
ADDITIONAL UI : what we need to add
Prototype for the All-Games Editing UI (made using my favorite professional design software, LibreOffice Draw)
