mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-26 19:27:31 -05:00
Merge pull request #920 from juander-ux/fix-singleplayer-button-crash
d2gamescreen/char_select: Fix crash on double clicking singleplayer
This commit is contained in:
commit
ef6f90c01c
@ -47,6 +47,7 @@ type CharacterSelect struct {
|
|||||||
tickTimer float64
|
tickTimer float64
|
||||||
storedTickTimer float64
|
storedTickTimer float64
|
||||||
showDeleteConfirmation bool
|
showDeleteConfirmation bool
|
||||||
|
loaded bool
|
||||||
connectionType d2clientconnectiontype.ClientConnectionType
|
connectionType d2clientconnectiontype.ClientConnectionType
|
||||||
connectionHost string
|
connectionHost string
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ func (v *CharacterSelect) OnLoad(loading d2screen.LoadingState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
v.refreshGameStates()
|
v.refreshGameStates()
|
||||||
|
v.loaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *CharacterSelect) loadBackground() {
|
func (v *CharacterSelect) loadBackground() {
|
||||||
@ -421,6 +423,10 @@ func (v *CharacterSelect) moveSelectionBox() {
|
|||||||
|
|
||||||
// OnMouseButtonDown is called when a mouse button is clicked
|
// OnMouseButtonDown is called when a mouse button is clicked
|
||||||
func (v *CharacterSelect) OnMouseButtonDown(event d2interface.MouseEvent) bool {
|
func (v *CharacterSelect) OnMouseButtonDown(event d2interface.MouseEvent) bool {
|
||||||
|
if !v.loaded {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if v.showDeleteConfirmation {
|
if v.showDeleteConfirmation {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -547,5 +553,7 @@ func (v *CharacterSelect) OnUnload() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v.loaded = false
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user