aboutsummaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go29
-rw-r--r--internal/config/doc.go10
2 files changed, 29 insertions, 10 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 5c0a4b0..48f1a69 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -8,11 +8,39 @@ import (
type Config struct {
Game GameConfig `yaml:"game"`
+ Colors ColorsConfig `yaml:"colors"`
Telnet TelnetConfig `yaml:"telnet"`
HTTP HTTPConfig `yaml:"http"`
HTTPS HTTPSConfig `yaml:"https"`
}
+type ColorsConfig map[string]string
+
+func DefaultColors() ColorsConfig {
+ return ColorsConfig{
+ "room_name": "fg=cyan bold",
+ "room_number": "dim",
+ "room_desc": "fg=white",
+ "direction": "fg=cyan",
+ "exit_direction": "fg=cyan",
+ "exit_name": "fg=green",
+ "mob_name": "fg=bright_red",
+ "friendly_npc": "fg=green",
+ "hostile_npc": "fg=bright_red",
+ "damage": "fg=red",
+ "enemy_hp": "fg=red",
+ "character_hp": "fg=green",
+ "xp": "fg=yellow",
+ "level_up": "fg=bright_yellow bold",
+ "item": "fg=green",
+ "player_name": "fg=bright_white",
+ "death": "fg=red bold",
+ "victory": "fg=green",
+ "miss": "dim",
+ "error": "fg=red",
+ }
+}
+
type GameConfig struct {
TickLength int `yaml:"tick_length"`
}
@@ -39,6 +67,7 @@ func Default() *Config {
Game: GameConfig{
TickLength: 600,
},
+ Colors: DefaultColors(),
Telnet: TelnetConfig{
Enabled: true,
Port: 4000,
diff --git a/internal/config/doc.go b/internal/config/doc.go
deleted file mode 100644
index f35aad3..0000000
--- a/internal/config/doc.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// Package config loads YAML server configuration and provides sensible
-// defaults when no config file is present.
-//
-// Configuration covers three listener types: telnet (raw TCP), HTTP + WebSocket,
-// and HTTPS + WebSocket. Each has an enabled flag and port. The game section
-// controls display settings like max terminal width.
-//
-// Call Load(path) to read a YAML file merged with defaults, or Default()
-// for a configuration suitable for running with telnet on :4000.
-package config