Page 1 of 1

Event for game.tick_paused value changes

Posted: Fri Feb 19, 2021 7:34 pm
by kubiix
As title says, is it possible to add event, when game.tick_paused (https://lua-api.factorio.com/latest/Lua ... ick_paused) value is changed?

Re: Event for game.tick_paused value changes

Posted: Fri Feb 19, 2021 7:45 pm
by Klonan
What is the usecase?

Re: Event for game.tick_paused value changes

Posted: Sat Feb 20, 2021 6:01 am
by kubiix
Factory Planner can pause the game with toggle icon in titlebar and I am developong the same to Recipe Book.
So when both windows are opened and in FP pause is toggled, I can update the state of pause icon in RB.

Re: Event for game.tick_paused value changes

Posted: Sat Feb 20, 2021 10:47 am
by Klonan
kubiix wrote: Sat Feb 20, 2021 6:01 am Factory Planner can pause the game with toggle icon in titlebar and I am developong the same to Recipe Book.
So when both windows are opened and in FP pause is toggled, I can update the state of pause icon in RB.
Sorry that doens't really sound like a meaningful usecase to me, and even so it is moreso you should request a custom event from the recipe book mod author

Re: Event for game.tick_paused value changes

Posted: Sat Feb 20, 2021 11:53 am
by kubiix
Actually I have a pending PR with this feature to Recipe Book repo on Github so I dont see reason why I cannot ask for it.
Is there better (Existing) way to know, that some other mod paused the game to reflect it on pause button state? With no changes needed to other mods? It should not be responsibility of mod that paused the game to inform about it other mods, If other mods want to reflect the change.
It is not only FP but also Hellmod and maybe other mods who can pause the game.