This is possible, but not directly with a simple function as with the digging example.
Listen for the event:
EVENT_TRIBUTE_GAME_FLOW_STATE_CHANGE
which returns as the second parameter the "flow state"
The existing flow states are:
* TRIBUTE_GAME_FLOW_STATE_BOARD_SETUP -- 3
* TRIBUTE_GAME_FLOW_STATE_GAME_OVER -- 5
* TRIBUTE_GAME_FLOW_STATE_INACTIVE -- 0
* TRIBUTE_GAME_FLOW_STATE_INTRO -- 1
* TRIBUTE_GAME_FLOW_STATE_PATRON_DRAFT -- 2
* TRIBUTE_GAME_FLOW_STATE_PLAYING -- 4
Now, as soon as you detect: TRIBUTE_GAME_FLOW_STATE_INTRO you know the player is in a tribute game until you detect the TRIBUTE_GAME_FLOW_STATE_INACTIVE which is called when the game and all related ui close.
You can always set the initial state after an reload to "not in a game" as a reloadui will end any tribute game currently active.
I think this should provide what you are looking for.
Last edited by ExoY : 08/25/22 at 11:07 AM.
|