Increase dialogue modality, display keyboard dialogue

This commit is contained in:
2020-04-14 12:12:37 +01:00
parent 786d261f98
commit 82d3849402
7 changed files with 136 additions and 50 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"log"
"strings"
"github.com/hajimehoshi/ebiten"
@@ -233,6 +234,21 @@ func (f *Flow) playNextScenario(from driverName) func() {
}
}
func (f *Flow) showDialogue(driver driverName, id string) func() {
return func() {
f.drivers[driver].ShowDialogue(locator(driver, id))
}
}
func (f *Flow) hideDialogue(driver driverName) func() {
return f.drivers[driver].HideDialogue
}
func (f *Flow) setExit() {
f.exit = ErrExit
}
// TODO: convert all to locators
func locator(d driverName, id string) string {
return fmt.Sprintf("%v:%v", strings.ToLower(string(d)), id)
}