diff options
| author | historia <[not public]> | 2026-06-16 23:37:50 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-16 23:37:50 -0400 |
| commit | 389e307f205f9b7edf604fb9f86e1038ead736ef (patch) | |
| tree | 595095b5877cc2b0513d31fb126303d8796cc311 /internal/game/cmd_prompt.go | |
| parent | 085e728d22a3369bd110b77409914cfbe9ebe611 (diff) | |
| download | thehouseoficarus-389e307f205f9b7edf604fb9f86e1038ead736ef.tar.gz | |
feat: major xterm256 color overhaul, see worldbuilding docs.
Diffstat (limited to 'internal/game/cmd_prompt.go')
| -rw-r--r-- | internal/game/cmd_prompt.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/game/cmd_prompt.go b/internal/game/cmd_prompt.go new file mode 100644 index 0000000..81c3409 --- /dev/null +++ b/internal/game/cmd_prompt.go @@ -0,0 +1,33 @@ +package game + +import ( + "fmt" + + "thehouseoficarus/internal/net" + "thehouseoficarus/internal/player" +) + +func (g *Game) doPrompt(sess *net.Session, input string) { + p := sess.Player.(*player.Player) + + if input == "" { + prompt := p.Prompt + if prompt == "" { + prompt = "> " + } + sess.WriteLine(fmt.Sprintf("\nPrompt: %s", prompt)) + sess.WriteLine("Use 'prompt <value>' to change. Use 'prompt reset' to restore default.") + return + } + + if input == "reset" { + p.Prompt = "> " + g.AccountStore.SaveCharacter(p) + sess.WriteLine("\nPrompt reset to default.") + return + } + + p.Prompt = input + g.AccountStore.SaveCharacter(p) + sess.WriteLine(fmt.Sprintf("\nPrompt set to: %s", input)) +} |
