From ec0bddc01e891446e100c78c158108700c8dc475 Mon Sep 17 00:00:00 2001 From: dk Date: Fri, 3 Jul 2020 00:03:44 -0700 Subject: [PATCH] bugfix for issue #528 (#529) --- d2game/d2gamescreen/character_select.go | 2 +- d2game/d2gamescreen/main_menu.go | 2 +- d2game/d2gamescreen/select_hero_class.go | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/d2game/d2gamescreen/character_select.go b/d2game/d2gamescreen/character_select.go index 7252038c..eba51108 100644 --- a/d2game/d2gamescreen/character_select.go +++ b/d2game/d2gamescreen/character_select.go @@ -209,7 +209,7 @@ func (v *CharacterSelect) updateCharacterBoxes() { } func (v *CharacterSelect) onNewCharButtonClicked() { - d2screen.SetNextScreen(CreateSelectHeroClass(v.audioProvider, v.connectionType, v.connectionHost)) + d2screen.SetNextScreen(CreateSelectHeroClass(v.audioProvider, v.connectionType, v.connectionHost, v.terminal)) } func (v *CharacterSelect) onExitButtonClicked() { diff --git a/d2game/d2gamescreen/main_menu.go b/d2game/d2gamescreen/main_menu.go index 9aff199a..f0c8ee43 100644 --- a/d2game/d2gamescreen/main_menu.go +++ b/d2game/d2gamescreen/main_menu.go @@ -286,7 +286,7 @@ func (v *MainMenu) onSinglePlayerClicked() { return } - d2screen.SetNextScreen(CreateSelectHeroClass(v.audioProvider, d2clientconnectiontype.Local, v.tcpJoinGameEntry.GetText())) + d2screen.SetNextScreen(CreateSelectHeroClass(v.audioProvider, d2clientconnectiontype.Local, v.tcpJoinGameEntry.GetText(), v.terminal)) } func (v *MainMenu) onGithubButtonClicked() { diff --git a/d2game/d2gamescreen/select_hero_class.go b/d2game/d2gamescreen/select_hero_class.go index 6652bb45..8ae277d6 100644 --- a/d2game/d2gamescreen/select_hero_class.go +++ b/d2game/d2gamescreen/select_hero_class.go @@ -71,14 +71,19 @@ type SelectHeroClass struct { terminal d2interface.Terminal } -func CreateSelectHeroClass(audioProvider d2interface.AudioProvider, - connectionType d2clientconnectiontype.ClientConnectionType, connectionHost string) *SelectHeroClass { +func CreateSelectHeroClass( + audioProvider d2interface.AudioProvider, + connectionType d2clientconnectiontype.ClientConnectionType, + connectionHost string, + terminal d2interface.Terminal, +) *SelectHeroClass { result := &SelectHeroClass{ heroRenderInfo: make(map[d2enum.Hero]*HeroRenderInfo), selectedHero: d2enum.HeroNone, connectionType: connectionType, connectionHost: connectionHost, audioProvider: audioProvider, + terminal: terminal, } return result