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/cmd_option.go | |
| parent | 84072ffe6365ad57c4976e9272762aa6db41de7e (diff) | |
| download | thehouseoficarus-a3ae1e6aad696f584d138d9363c05dedff136a65.tar.gz | |
feat: safespot system implemented
Diffstat (limited to 'internal/game/cmd_option.go')
| -rw-r--r-- | internal/game/cmd_option.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/game/cmd_option.go b/internal/game/cmd_option.go index 19256ba..ff7725c 100644 --- a/internal/game/cmd_option.go +++ b/internal/game/cmd_option.go @@ -26,6 +26,7 @@ func (g *Game) doOption(sess *net.Session, input string) { } for _, def := range player.OptionDefs { val := formatOptionValue(p, &def) + val = truncateForTable(val) valid := formatValidValues(&def) table.Rows = append(table.Rows, []string{ color.Render(mode, color.Parse("75"), def.Name), @@ -148,3 +149,10 @@ func parseOptionValue(def *player.OptionDef, input string) (any, bool) { } return nil, false } + +func truncateForTable(s string) string { + if len(s) <= 10 { + return s + } + return s[:7] + "..." +} |
