aboutsummaryrefslogtreecommitdiff
path: root/go/ui/prompt.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/ui/prompt.go')
-rw-r--r--go/ui/prompt.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/go/ui/prompt.go b/go/ui/prompt.go
index c0b11d94..a7f2ce07 100644
--- a/go/ui/prompt.go
+++ b/go/ui/prompt.go
@@ -13,6 +13,7 @@ const (
)
type Prompt struct {
+ EventHandlersMap
y, width int
action game.Action
components []Widget
@@ -20,10 +21,11 @@ type Prompt struct {
func NewPrompt(y, width int, action game.Action, promptText string) *Prompt {
p := &Prompt{
- y: y,
- width: width,
- action: action,
- components: []Widget{NewFixedTextBox(0, y, width, PROMPT_HEIGHT, promptText).Centering(true)},
+ EventHandlersMap: NewEventHandlersMap(),
+ y: y,
+ width: width,
+ action: action,
+ components: []Widget{NewFixedTextBox(0, y, width, PROMPT_HEIGHT, promptText).Centering(true)},
}
return p
}
@@ -91,3 +93,7 @@ func (p *Prompt) stopHover(ticks int, x, y int) bool {
p.setTextBgAlpha(0xff)
return true
}
+
+func (p *Prompt) Layout() (int, int) {
+ return p.width, PROMPT_HEIGHT
+}