aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_color.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-16 17:05:17 -0400
committerhistoria <[not public]>2026-09-16 17:05:17 -0400
commit1dad15698845d370e998f7cc5feb8aece3fab58f (patch)
tree8d58058782de9f422573e1f8efd5d130ce7d1ce9 /internal/game/render_color.go
parenta6cf03a6ae98e4fb675da25046d148e92bcf7206 (diff)
downloadthehouseoficarus-1dad15698845d370e998f7cc5feb8aece3fab58f.tar.gz
refactor: remove dead code, consolidate save/error handling, add lint gate
Diffstat (limited to 'internal/game/render_color.go')
-rw-r--r--internal/game/render_color.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/game/render_color.go b/internal/game/render_color.go
index ab3692e..ccce05e 100644
--- a/internal/game/render_color.go
+++ b/internal/game/render_color.go
@@ -47,7 +47,7 @@ func (g *Game) colorize(sess *net.Session, category, text string) string {
// per-player override map — constants are admin-tunable only — so players
// have no way to change them. Falls back through the file's constant_colors
// map, then to the built-in DefaultConstantColors.
-func (g *Game) resolveConstant(sess *net.Session, category string) color.ColorSpec {
+func (g *Game) resolveConstant(category string) color.ColorSpec {
if g.ConstantColorConfig != nil {
if val, ok := (*g.ConstantColorConfig)[category]; ok && val != "" {
return color.Parse(val)
@@ -62,14 +62,14 @@ func (g *Game) resolveConstant(sess *net.Session, category string) color.ColorSp
// colorizeConstant paints text with a constant color spec, bypassing the
// player override tier entirely.
func (g *Game) colorizeConstant(sess *net.Session, category, text string) string {
- spec := g.resolveConstant(sess, category)
+ spec := g.resolveConstant(category)
return color.Render(g.colorMode(sess), spec, text)
}
// levelColorSpec returns the color spec for the level-difference band shown
// next to mob/player levels (green/red/white by how far the target is from
// the viewer). Uses admin-tunable constant_colors; falls back to built-ins.
-func (g *Game) levelColorSpec(sess *net.Session, myLevel, theirLevel int) color.ColorSpec {
+func (g *Game) levelColorSpec(myLevel, theirLevel int) color.ColorSpec {
diff := theirLevel - myLevel
var name string
switch {
@@ -84,11 +84,11 @@ func (g *Game) levelColorSpec(sess *net.Session, myLevel, theirLevel int) color.
default:
name = "level_diff_down_big"
}
- return g.resolveConstant(sess, name)
+ return g.resolveConstant(name)
}
func (g *Game) levelColorize(sess *net.Session, myLevel, theirLevel int, text string) string {
- spec := g.levelColorSpec(sess, myLevel, theirLevel)
+ spec := g.levelColorSpec(myLevel, theirLevel)
return color.Render(g.colorMode(sess), spec, text)
}
@@ -130,7 +130,7 @@ func (g *Game) namedColorSpecs(sess *net.Session) map[string]color.ColorSpec {
}
}
for name := range config.DefaultConstantColors() {
- if spec := g.resolveConstant(sess, name); !spec.Empty() {
+ if spec := g.resolveConstant(name); !spec.Empty() {
names[name] = spec
}
}
@@ -139,7 +139,7 @@ func (g *Game) namedColorSpecs(sess *net.Session) map[string]color.ColorSpec {
if _, ok := names[name]; ok {
continue
}
- if spec := g.resolveConstant(sess, name); !spec.Empty() {
+ if spec := g.resolveConstant(name); !spec.Empty() {
names[name] = spec
}
}