From 169a76515285b71e9653678090fb94f7a5743899 Mon Sep 17 00:00:00 2001 From: Arto Simonyan Date: Fri, 14 Mar 2025 20:50:00 +0200 Subject: [PATCH] Add IsBlocking function (#89) - Add IsBlocking function that checks if confirmation popup or blocking panel (loading screen as in when trying to re-connect to bnet) are on the screen --- pkg/memory/game_reader.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/memory/game_reader.go b/pkg/memory/game_reader.go index b122d33..d4135b8 100644 --- a/pkg/memory/game_reader.go +++ b/pkg/memory/game_reader.go @@ -335,6 +335,15 @@ func (gd *GameReader) GetCharacterList() []string { return characterNames } +// IsBlocking checks if there's a blocking popup or loading screen present +func (gd *GameReader) IsBlocking() bool { + panel := gd.GetPanel("BlockingPanel") + panel2 := gd.GetPanel("DismissableModal") + + return (panel.PanelName != "" && panel.PanelEnabled && panel.PanelVisible) || + (panel2.PanelName != "" && panel2.PanelEnabled && panel2.PanelVisible) +} + // IsDismissableModalPresent checks if there's a error popup present func (gd *GameReader) IsDismissableModalPresent() (bool, string) { panel := gd.GetPanel("DismissableModal")