diff options
| author | historia <[not public]> | 2026-06-21 22:19:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-21 22:19:17 -0400 |
| commit | a3ae1e6aad696f584d138d9363c05dedff136a65 (patch) | |
| tree | 81e615f7227bc9d1ec79ceefc7311ecde917b074 /internal/game/core_login_account.go | |
| parent | 84072ffe6365ad57c4976e9272762aa6db41de7e (diff) | |
| download | thehouseoficarus-a3ae1e6aad696f584d138d9363c05dedff136a65.tar.gz | |
feat: safespot system implemented
Diffstat (limited to 'internal/game/core_login_account.go')
| -rw-r--r-- | internal/game/core_login_account.go | 29 |
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...) |
