add dialog to domain

This commit is contained in:
2023-07-04 20:56:09 +02:00
parent 74272c09f2
commit 88cf7620be
5 changed files with 53 additions and 31 deletions

40
domain/dialog.go Normal file
View File

@@ -0,0 +1,40 @@
package domain
import (
"game/konstructor"
"image/color"
)
func (d *Domain) InitDialog() {
d.DialogMap = konstructor.DialogMap{
"TestDialog": {
Layout: konstructor.DialogLayout{
ChoiceFont: konstructor.FontLayout{
DPI: 72,
Size: 24,
Color: color.White,
SelectedColor: color.RGBA{R: 0, G: 255, B: 0, A: 100},
},
},
Choices: []konstructor.DialogChoice{
{
ID: "one",
Label: "One",
},
{
ID: "two",
Label: "Two",
},
},
},
}
}
func (d *Domain) GetDialog(name string) konstructor.Dialog {
value, _ := d.DialogMap[name]
return value
}
func (d *Domain) SetDialog(name string, dialog konstructor.Dialog) {
d.DialogMap[name] = dialog
}