File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 207207--- Gets the current game state
208208--- @param _ table Arguments (not used )
209209API .functions [" get_game_state" ] = function (_ )
210- local game_state = utils .get_game_state ()
211- API .send_response (game_state )
210+ --- @type PendingRequest
211+ API .pending_requests [" get_game_state" ] = {
212+ condition = function ()
213+ return # G .E_MANAGER .queues .base < EVENT_QUEUE_THRESHOLD
214+ end ,
215+ action = function ()
216+ local game_state = utils .get_game_state ()
217+ API .send_response (game_state )
218+ end ,
219+ }
212220end
213221
214222--- Navigates to the main menu.
Original file line number Diff line number Diff line change @@ -609,6 +609,10 @@ local EVENT_QUEUE_THRESHOLD = 3
609609--- These are shared between API and LOG systems to ensure consistent timing
610610--- @type table<string , function>
611611utils .COMPLETION_CONDITIONS = {
612+ get_game_state = function ()
613+ return # G .E_MANAGER .queues .base < EVENT_QUEUE_THRESHOLD
614+ end ,
615+
612616 go_to_menu = function ()
613617 return G .STATE == G .STATES .MENU and G .MAIN_MENU_UI
614618 end ,
You can’t perform that action at this time.
0 commit comments