diff options
| author | historia <[not public]> | 2026-06-15 02:57:35 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-15 02:58:50 -0400 |
| commit | 4cc1ddcd185509080b4b3e15d1646567edd51c9d (patch) | |
| tree | 2a564846ad4fd159a2d7e55451bfa9569fe8c0b8 /internal/game/color.go | |
| parent | 445c4612cc5cf2c226f85894b6ad1e2419a374e2 (diff) | |
| download | thehouseoficarus-4cc1ddcd185509080b4b3e15d1646567edd51c9d.tar.gz | |
removed game speed for being broken and an antifeature anyway. added color support.
Diffstat (limited to 'internal/game/color.go')
| -rw-r--r-- | internal/game/color.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/game/color.go b/internal/game/color.go new file mode 100644 index 0000000..45df212 --- /dev/null +++ b/internal/game/color.go @@ -0,0 +1,22 @@ +package game + +import ( + "thirdcollapse/internal/color" + "thirdcollapse/internal/net" + "thirdcollapse/internal/player" +) + +func (g *Game) colorMode(sess *net.Session) string { + if p, ok := sess.Player.(*player.Player); ok && p != nil { + return p.OptionString("color") + } + return "none" +} + +func (g *Game) colorize(sess *net.Session, name, text string) string { + return color.Wrap(g.colorMode(sess), name, text) +} + +func (g *Game) colorTag(sess *net.Session, text string) string { + return color.Tag(g.colorMode(sess), text) +} |
