aboutsummaryrefslogtreecommitdiff
path: root/go/ui
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-09-03 15:00:05 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-09-03 15:00:05 +0200
commitb0d2ca8ccb8b42d8da23ae014d154dfde9f1cf08 (patch)
tree09c936d9deddc903e2555f93441fa804d92817dd /go/ui
parentd292115061b793c8fe959a3eecb0fd3c226f70f9 (diff)
downloadmuhqs-game-b0d2ca8ccb8b42d8da23ae014d154dfde9f1cf08.tar.gz
muhqs-game-b0d2ca8ccb8b42d8da23ae014d154dfde9f1cf08.zip
special case the formatting of free and full actions in choice
Diffstat (limited to 'go/ui')
-rw-r--r--go/ui/choice.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/go/ui/choice.go b/go/ui/choice.go
index 5954c1fa..80902606 100644
--- a/go/ui/choice.go
+++ b/go/ui/choice.go
@@ -32,7 +32,15 @@ func (c *Choice) setText() {
c.Width, c.Height = -1, -1
t := ""
for _, choice := range c.choices {
- t = fmt.Sprintf("%s%v\n", t, choice)
+ switch c := choice.(type) {
+ // Special case Free and FullActions
+ case *game.FreeAction:
+ t = fmt.Sprintf("%s%v\n", t, c.Desc)
+ case *game.FullAction:
+ t = fmt.Sprintf("%s↻%v\n", t, c.Desc)
+ default:
+ t = fmt.Sprintf("%s%v\n", t, choice)
+ }
}
c.text = t[:len(t)-1]