konstructor file prefixes refactor
This commit is contained in:
32
konstructor/screen.dialog.go
Normal file
32
konstructor/screen.dialog.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package konstructor
|
||||
|
||||
import "image/color"
|
||||
|
||||
type DialogMapKey string
|
||||
|
||||
type DialogMap map[DialogMapKey]Dialog
|
||||
|
||||
type DialogLayout struct {
|
||||
Render Render
|
||||
ChoiceFont FontLayout
|
||||
}
|
||||
|
||||
type DialogChoice struct {
|
||||
ID string
|
||||
Label string
|
||||
Handler func()
|
||||
}
|
||||
|
||||
type Dialog struct {
|
||||
CurrentSelected int
|
||||
Layout DialogLayout
|
||||
Choices []DialogChoice
|
||||
}
|
||||
|
||||
func (dialog *Dialog) GetChoiceColor(i int) color.Color {
|
||||
if dialog.CurrentSelected == i {
|
||||
return dialog.Layout.ChoiceFont.SelectedColor
|
||||
} else {
|
||||
return dialog.Layout.ChoiceFont.Color
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user