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
This commit is contained in:
Arto Simonyan
2025-03-14 20:50:00 +02:00
committed by GitHub
parent b8765f634f
commit 169a765152

View File

@@ -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")