Closed Xav1204 closed 1 year ago
@bastianilso I think that it's good now for the warning panel. I used 3 Unity Events :
We have also a bool value in our Unity Event in order to manage the opening of the warning panel and the closing of the app if this one is opened.
Finally, to know if the save is done, I look if the last label in the logstore is clear and if it's the case, the save is done.
Please, let me know if it's look right for you now.
@Xav1204 this was a lot of comments, but we are also dealing with a data saving system which introduce a lot of new interaction between classes in Whack-A-Mole, that we need to get right. :)
Please respond in-line to the comments i provided above with rationales, suggestions, questions so I follow your train of thought on this, thanks!
@bastianilso I think that it's good now. I simplified the code at the most that I could.
So please tell me if you it looks right for you and don't hesitate to tell me also if you have any questions or doubts.
thanks @Xav1204 . I will take a look at this on monday and get back to you. There are still some communication I think we can simplify. The main thing is that TherapistUI should not contain logic about quitting, its merely handling IO between User Interface and managers. In addition, ApplicationManager should subscribe and react to updates from LoggingManager, and behave appropriately based on which saving state LoggingManager is reporting. LoggingManager is only reporting a saving state, whoever listens to this information will decide which parts of the information is relevant to them. LoggingManager does not know about restarting applications, it just announces its own state. Here is a conceptual overview:
LoggingManager: should only report its saving state, e.g. is CSV saving, CSV saving progress, is CSV done, did CSV saving fail..
TherapistUI/GameStateContainer: listens to LoggingManager's updates and updates UI based on state information from LoggingManager saving. (Saving....1/3) etc.
ApplicationManager: Listens to LoggingManager's updates. If the CloseGame() is called while LoggingManager reported CSV is still saving, it prevents the game from quitting and instead asks TherapistUI to show "Saving Data.." Dialog. When LoggingManager informs ApplicationManager that saving is done and a previous call to ClosedGame() has been observed, ApplicationManager can then safely quit the game.
@bastianilso, should the loggingManager also report on whether it is currently in the state of continuously logging - which will require saving at some point?
@hendrikknoche good point. LoggingManager could report a "Logging" state, it would be very logical and expected. It would enable us to e.g. react if users try to exit Whack-A-Mole while a game is running. We could for example then stop the game and show the "Saving data.." dialog and finally quit afterwards.
@bastianilso it's good, all the improvements have been made.
@bastianilso I've made the changes, I hope that it's that you really want especially with the LoggingManager.SaveStatus enum in applicationManager. Moreover, as you've merged a pull request, a conflict with the mainscene.unity appeared and you sent us a mail and explained us how to solve it but I didn't succeed to manage the conflict. If you're at the university tomorrow, could you please come and explain to me and Lucas how to solve this conflict in the future please ?
We needed to update UI during a save to show to the therapist that the save is incomplete. So for this, we have a warning message panel that appear when we try to quit the app during the save. Moreover, we have an indicator of the total files that we need to save and how many are saved. When the save is done, we can restart a game. There will maybe be some functions that will disappear if we succeed to implement the multi-save system.