mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-12 12:26: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
|
||||
storedTickTimer float64
|
||||
showDeleteConfirmation bool
|
||||
loaded bool
|
||||
connectionType d2clientconnectiontype.ClientConnectionType
|
||||
connectionHost string
|
||||
|
||||
@ -195,6 +196,7 @@ func (v *CharacterSelect) OnLoad(loading d2screen.LoadingState) {
|
||||
}
|
||||
|
||||
v.refreshGameStates()
|
||||
v.loaded = true
|
||||
}
|
||||
|
||||
func (v *CharacterSelect) loadBackground() {
|
||||
@ -421,6 +423,10 @@ func (v *CharacterSelect) moveSelectionBox() {
|
||||
|
||||
// OnMouseButtonDown is called when a mouse button is clicked
|
||||
func (v *CharacterSelect) OnMouseButtonDown(event d2interface.MouseEvent) bool {
|
||||
if !v.loaded {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.showDeleteConfirmation {
|
||||
return false
|
||||
}
|
||||
@ -547,5 +553,7 @@ func (v *CharacterSelect) OnUnload() error {
|
||||
return err
|
||||
}
|
||||
|
||||
v.loaded = false
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user