diff options
| author | historia <[not public]> | 2026-06-22 14:09:46 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-22 14:09:46 -0400 |
| commit | d25638d98fe63efdeab570ef77e6a6a97f2d7a60 (patch) | |
| tree | 0bb1405b8896c7d1f98cef1ea2e994575e6b0b49 /internal | |
| parent | 5b9a75a1520a198c9c6b1f1f55e05c9f4aab5629 (diff) | |
| download | thehouseoficarus-d25638d98fe63efdeab570ef77e6a6a97f2d7a60.tar.gz | |
feat: custom map symbol improvements with 'symbol' command
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/game/cmd_symbol.go | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/internal/game/cmd_symbol.go b/internal/game/cmd_symbol.go index ec8d68b..bb97010 100644 --- a/internal/game/cmd_symbol.go +++ b/internal/game/cmd_symbol.go @@ -41,20 +41,38 @@ func (g *Game) executeSymbol(sess *net.Session, args []string, rawInput string) } cleared := false - if strings.EqualFold(char, "clear") || strings.EqualFold(char, "remove") { + if strings.EqualFold(char, "reset") || strings.EqualFold(char, "remove") { delete(p.MapSymbols, p.RoomID) if err := g.AccountStore.SaveCharacter(p); err != nil { sess.WriteLine("Error saving: " + err.Error()) return } - sess.WriteLine("Custom symbol cleared for this room.") + sess.WriteLine("Custom symbol reset for this room.") cleared = true } if !cleared { r, size := utf8.DecodeRuneInString(char) if size == 0 || size != len(char) || r == utf8.RuneError { - sess.WriteLine("Usage: symbol <single character> [color...]") + // ponytail: color-only mode — args are a color spec, keep existing char + colorSpec := strings.Join(args, " ") + spec := color.Parse(colorSpec) + if spec.Empty() { + sess.WriteLine("Invalid color spec. Use a color number like 232 and/or bold/dim/underline.") + return + } + existing, ok := p.MapSymbols[p.RoomID] + if !ok { + existing = player.MapSymbolData{Char: "■"} + } + existing.Color = colorSpec + p.MapSymbols[p.RoomID] = existing + if err := g.AccountStore.SaveCharacter(p); err != nil { + sess.WriteLine("Error saving: " + err.Error()) + return + } + colored := color.Render(g.colorMode(sess), spec, existing.Char) + sess.WriteLine(fmt.Sprintf("Map symbol color set to: %s (%s)", colored, colorSpec)) return } |
