aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_score.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-25 15:40:48 -0400
committerhistoria <[not public]>2026-06-25 15:40:48 -0400
commitabd612c15799f604e671e83dc7c410ed2b44185f (patch)
tree0597ca92350de73aac2a7cf26b2f2d6595dac0cc /internal/game/cmd_score.go
parent2725e2927a1595c7b100d942d1f14146252adeb7 (diff)
downloadthehouseoficarus-abd612c15799f604e671e83dc7c410ed2b44185f.tar.gz
slop refactor
Diffstat (limited to 'internal/game/cmd_score.go')
-rw-r--r--internal/game/cmd_score.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/internal/game/cmd_score.go b/internal/game/cmd_score.go
index d4dd823..20c61d9 100644
--- a/internal/game/cmd_score.go
+++ b/internal/game/cmd_score.go
@@ -8,6 +8,7 @@ import (
"thehouseoficarus/internal/color"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
+ "thehouseoficarus/internal/ui"
)
func (g *Game) executeScore(sess *net.Session, args []string, rawInput string) {
@@ -49,10 +50,10 @@ func (g *Game) doScore(sess *net.Session) {
player.Fishing: "Fishing", player.Woodcutting: "Woodcutting", player.Mining: "Mining",
player.Hacking: "Hacking", player.Scavenging: "Scavenging", player.Farming: "Farming",
player.Thieving: "Thieving",
- player.Cooking: "Cooking", player.Smithing: "Smithing", player.Crafting: "Crafting",
+ player.Cooking: "Cooking", player.Smithing: "Smithing", player.Crafting: "Crafting",
player.Fletching: "Fletching", player.Pharmacy: "Pharmacy", player.Construction: "Construction",
player.Firemaking: "Firemaking",
- player.Agility: "Agility",
+ player.Agility: "Agility",
}
type skillCat struct {
@@ -105,7 +106,7 @@ func (g *Game) doScore(sess *net.Session) {
gap()
hpStyle := hpBarStyle(p.HP, p.MaxHP())
- hpBarStr := RenderColoredBar(p.HP, p.MaxHP(), 26, unicode, hpStyle, mode)
+ hpBarStr := ui.RenderColoredBar(p.HP, p.MaxHP(), 26, unicode, hpStyle, mode)
hpFg := hpBarFg(p.HP, p.MaxHP())
hpLine := fmt.Sprintf("HP [%s] %s / %s",
hpBarStr,
@@ -113,7 +114,7 @@ func (g *Game) doScore(sess *net.Session) {
color.Render(mode, color.Parse("230"), fmt.Sprint(p.MaxHP())))
content(hpLine)
- batBarRaw := RenderBarF(p.Battery, p.MaxBattery(), 26, unicode)
+ batBarRaw := ui.RenderBarF(p.Battery, p.MaxBattery(), 26, unicode)
batBarStr := color.Render(mode, color.ColorSpec{Fg: 45}, batBarRaw)
batLine := fmt.Sprintf("BAT [%s] %s / %s",
batBarStr,
@@ -242,7 +243,7 @@ func formatInt(n int) string {
return strings.Join(parts, ",")
}
-func hpBarStyle(current, max int) *BarStyle {
+func hpBarStyle(current, max int) *ui.BarStyle {
if max <= 0 {
max = 1
}
@@ -256,7 +257,7 @@ func hpBarStyle(current, max int) *BarStyle {
default:
fg = 196
}
- return &BarStyle{FilledColor: fg, EmptyColor: 238, EmptyDim: true}
+ return &ui.BarStyle{FilledColor: fg, EmptyColor: 238, EmptyDim: true}
}
func hpBarFg(current, max int) int {
@@ -292,7 +293,7 @@ func skillLevelColor(level int) int {
func xpProgressBar(xp int, width int, unicode bool) string {
currentLevel := player.LevelForXP(xp)
if currentLevel >= 99 {
- fillRune, _ := barRunes(unicode)
+ fillRune, _ := ui.BarRunes(unicode)
return strings.Repeat(fillRune, width)
}
xpForLevel := player.XPForLevel(currentLevel)
@@ -302,7 +303,7 @@ func xpProgressBar(xp int, width int, unicode bool) string {
if needed <= 0 {
needed = 1
}
- fillRune, emptyRune := barRunes(unicode)
+ fillRune, emptyRune := ui.BarRunes(unicode)
filled := progress * width / needed
if filled > width {
filled = width