You asked for a way to have a callback when you quit a screen, it's the answer to this question.
I meant after not before.
So I actually meant different thing.
As for the context related part, the answer was right above.
Do you think checking something 20 times per second that you may not even have a use for,
is a good way of doing things?
And not only you persist to search a solution that will fix the broken approach you refuse to quit, but you also persist in searching it where it don't lie.
Working solutions for what you want to do, you had more than one.But the fact is that they rely on something different than your approach, therefore you discard them. And this last post you wrote is the exact demonstration of this. To make a change coming from a upper context only apply when the player return to the main context, you need only two things, than I named in my previous answer. Yet you again wrote a whole monologue centered on the use of an exception that you have absolutely no reason to use.
What do I refuse to quit?
I researched every option, even stated results up there.
And now I end up nowhere.
Meaning I quit everything.
Because nothing works to the fullest.
And I don't know how to progress any further.
Ren'Py exceptions are part of the engine's core, and there's absolutely no reason to use them since the engine come with all the interface functions needed for that.
You can perfectly change a label by raising the JumpException
exception, but why one would do this since there's a statement, a Python function and a screen action that do it, and more, for you ? And the same apply for the RestartTopContext
exception.
Are you not aware?
Exception is direct way to change things.
Because everything mentioned up end up doing Exception anyway.
It's like me writing function or statement that would use Exception in it and then use it myself.
It's just a shortcut I can chose to take/do later on, for now I have no need for it.
What the fuck are you talking about ?
You ask how to show/hide overlays, I give you the answer, period.
I'm talking about game_menu. When you open it it sets
suppress_overlay
to True,
and when I raise Exception there is nothing that changes it back.
Is a valid approach that don't do what you want to do, and need many days of "tries and fail", effectively a valid approach ?
I just need to reverse changes from opening game_menu.
Or to learn how to properly rollback game_menu.
And since now that I know why overlays are displayed when I was using Rollback solution.
Because Rollback returns to main context and so overlays too.
So I just need to disable overlays for my function, and I would be fine.
And quitting game_menu is done by Rollback anyway.
And rollback is also using RestartTopContext.
The only difference between my approach and Ren'Py mechanics-
is that that I don't change crucial variables to the game at the right time.
Because I didn't even know that I have to change anything.
So I will later work on on my own invoke_in_new_context function,
that will meet my demands.
Because it is surprising to me that overlays aren't disabled in it.
I was confused that it was doing it, but it was the game_menu that was doing it.
So just like game_menu I just need to set up things before calling my function,
and then undo it or use rollback if possible.
But I may not even do it anyway, because I had enough of this.
For such trivial thing to move mountains and rivers and the result isn't even good.
I just don't feel like I need it anymore.
Now I can live without it without any regret.
It was small detail anyway, without much use.
Gonna take my time and use it on something useful that I didn't finish yet.
And anyway why should I be doing it in the first place when you said others did it already?
The reason of this thread was to get finished method of this.
No matter what I do, it will have bigger flaws, because I'm not experienced enough.
I'm not developing engine I'm using it.
It's like asking players to fix themselves the game they are playing.
If no one wants to share his solution to this it's fine.
I just won't be using mine when it can endanger the game.
Risks are absurd and benefits are almost none.
I wanted efficient way, no efficient way no way it is.