Update textboxes in their advance function (#407)

Fixes wonky input
This commit is contained in:
Ziemas 2020-06-23 05:51:23 +02:00 committed by GitHub
parent 6ed86ee660
commit 15b78372b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -72,10 +72,6 @@ func (v *TextBox) Render(target d2render.Surface) {
}
func (v *TextBox) Advance(elapsed float64) {
}
func (v *TextBox) Update() {
if !v.visible || !v.enabled {
return
}
@ -92,6 +88,9 @@ func (v *TextBox) Update() {
}
}
func (v *TextBox) Update() {
}
func (v *TextBox) GetText() string {
return v.text
}

View File

@ -341,8 +341,6 @@ func (v *MainMenu) Advance(tickTime float64) error {
v.diabloLogoRightBack.Advance(tickTime)
v.diabloLogoLeft.Advance(tickTime)
v.diabloLogoRight.Advance(tickTime)
case ScreenModeServerIp:
v.tcpJoinGameEntry.Update()
}
switch v.screenMode {

View File

@ -482,7 +482,6 @@ func (v *SelectHeroClass) Advance(tickTime float64) error {
if v.selectedHero != d2enum.HeroNone && allIdle {
v.selectedHero = d2enum.HeroNone
}
v.heroNameTextbox.Update()
v.okButton.SetEnabled(len(v.heroNameTextbox.GetText()) >= 2)
return nil
}