aboutsummaryrefslogtreecommitdiff
path: root/internal/game/core_login_account.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/core_login_account.go')
-rw-r--r--internal/game/core_login_account.go29
1 files changed, 21 insertions, 8 deletions
diff --git a/internal/game/core_login_account.go b/internal/game/core_login_account.go
index a2c1bd8..093ae71 100644
--- a/internal/game/core_login_account.go
+++ b/internal/game/core_login_account.go
@@ -5,6 +5,7 @@ import (
"os"
"strings"
+ "thehouseoficarus/internal/color"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
)
@@ -172,8 +173,20 @@ func (g *Game) handleColorChoice(sess *net.Session, input string) {
g.showMenu(sess)
}
+func menuColorMode(sess *net.Session) string {
+ if sess != nil && sess.Account != nil && sess.Account.Options != nil {
+ if v, ok := sess.Account.Options["color"]; ok {
+ if s, ok := v.(string); ok && s != "" {
+ return s
+ }
+ }
+ }
+ return "xterm256"
+}
+
func (g *Game) showMenu(sess *net.Session) {
sess.State = net.StateMenu
+ mode := menuColorMode(sess)
lines := []string{
"",
fmt.Sprintf("Welcome back to Gaia 04, %s.", sess.Account.Name),
@@ -181,18 +194,18 @@ func (g *Game) showMenu(sess *net.Session) {
}
if len(sess.Account.Characters) > 0 {
lines = append(lines,
- " (C)onnect character to THOI",
+ color.ExpandTags(mode, " {3}(C){/}{4}onnect character to THOI{/}"),
"",
- " (L)ist characters",
- " (R)ename character",
- " (D)elete character",
+ color.ExpandTags(mode, " {3}(L){/}{4}ist characters{/}"),
+ color.ExpandTags(mode, " {3}(R){/}{4}ename character{/}"),
+ color.ExpandTags(mode, " {3}(D){/}{4}elete character{/}"),
)
}
lines = append(lines,
- " (N)ew character",
- " (P)urge account",
- " (A)ccount rename",
- " (Q)uit",
+ color.ExpandTags(mode, " {3}(N){/}{4}ew character{/}"),
+ color.ExpandTags(mode, " {3}(P){/}{4}urge account{/}"),
+ color.ExpandTags(mode, " {3}(A){/}{4}ccount rename{/}"),
+ color.ExpandTags(mode, " {3}(Q){/}{4}uit{/}"),
"",
)
sess.WriteLines(lines...)