introduce enums as map keys

This commit is contained in:
2023-07-07 00:56:33 +02:00
parent 415a564317
commit faa6f00891
15 changed files with 52 additions and 31 deletions

View File

@@ -6,7 +6,7 @@ import (
)
func (e *Engine) DialogUpdate() {
dialog := e.Domain.GetDialog(e.KContext.ScreenValue)
dialog := e.Domain.GetDialog(e.KContext.ActiveDialog)
if e.UpPressed() && dialog.CurrentSelected != 0 {
dialog.CurrentSelected--
@@ -19,11 +19,11 @@ func (e *Engine) DialogUpdate() {
if e.Action0Pressed() {
dialog.Choices[dialog.CurrentSelected].Handler()
}
e.Domain.SetDialog(e.KContext.ScreenValue, dialog)
e.Domain.SetDialog(e.KContext.ActiveDialog, dialog)
}
func (e *Engine) DialogDraw(screen *ebiten.Image) {
dialog := e.Domain.GetDialog(e.KContext.ScreenValue)
dialog := e.Domain.GetDialog(e.KContext.ActiveDialog)
face := dialog.Layout.ChoiceFont.GetFontFace()

View File

@@ -6,7 +6,7 @@ import (
)
func (e *Engine) MenuUpdate() {
menu := e.Domain.GetMenu(e.KContext.ScreenValue)
menu := e.Domain.GetMenu(e.KContext.ActiveMenu)
if e.UpPressed() && menu.CurrentSelected != 0 {
menu.CurrentSelected--
@@ -20,11 +20,11 @@ func (e *Engine) MenuUpdate() {
menu.MenuItems[menu.CurrentSelected].Handler()
}
e.Domain.SetMenu(e.KContext.ScreenValue, menu)
e.Domain.SetMenu(e.KContext.ActiveMenu, menu)
}
func (e *Engine) MenuDraw(screen *ebiten.Image) {
menu := e.Domain.GetMenu(e.KContext.ScreenValue)
menu := e.Domain.GetMenu(e.KContext.ActiveMenu)
face := menu.Layout.MenuItemFont.GetFontFace()
for i, menu_item := range menu.MenuItems {