Closed tzachshabtay closed 6 years ago
I am a little concerned about this. Not the biggest deal, but maybe there is another way to separate things that have to be paused and not?
I'm open to suggestions. This has the familiarity advantage with existing AGSers.
Sorry, I was thinking about writing some notes down on this issue, but did not make up my mind yet.
Having two types of callback serves well when you have a strictly two states (all paused / all unpaused), but I was wondering if there may be a different approach there. An example of the problem that comes to mind: if you have a GUI class, which callback should it connect two? There is always a possibility that GUI will be "modal", that is - that pauses game. Then again, same element could be put on something that should be paused with Game.Paused state.
Well, as both events have the same signature, that GUI class in your example can accept the event as a parameter, and then different clients of that GUI can choose which event they want to pass.
I mean, naturally you have to supply something for the object to subscribe to, but what I question is whether that should be an option between two events.
What about existing classes, will I be able to choose how they are updated?
Another thing, I noticed before that you are pausing game during saving it, does that mean that repeatedly_execute_always callbacks will still be working during saving? Or is it something different.
What I am trying to think about is whether its possible to have a generic thing that controls updating for various parts of the game. For example, "complete pause", e.g. when you are editing the game from the editor, or during some other utility procedure, in-game pause, when the room is paused, but menu may be animating, and so on.
I'm aware that we might need more "modes of pausing" (for the editor, save/load games, and maybe more), but I currently lack the insight of how this should work exactly.
If you have something specific in mind, that's cool, otherwise we'll figure it out as we go along and actually hit those obstacles (which will probably be soon).
Added a "repeatedly execute always" event which fires even when the game is paused.
Input now uses this event to fire input events when the game is paused.