aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_mix.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-19 18:20:26 -0400
committerhistoria <[not public]>2026-06-19 18:20:26 -0400
commit0ea4eec5dd2122c6704216971eb1249276297867 (patch)
tree430fbbef04e837820f1d031c190f52ecd6112e25 /internal/game/cmd_mix.go
parent3a58125d14bb307f861b38c6c5b0a63babde7e08 (diff)
downloadthehouseoficarus-0ea4eec5dd2122c6704216971eb1249276297867.tar.gz
shop fixes, 'toggle' completely removed, movement speed increased
Diffstat (limited to 'internal/game/cmd_mix.go')
-rw-r--r--internal/game/cmd_mix.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/game/cmd_mix.go b/internal/game/cmd_mix.go
index 3082870..8fc600b 100644
--- a/internal/game/cmd_mix.go
+++ b/internal/game/cmd_mix.go
@@ -4,12 +4,11 @@ import (
"thehouseoficarus/internal/action"
"thehouseoficarus/internal/net"
"thehouseoficarus/internal/player"
- "thehouseoficarus/internal/world"
)
func (g *Game) doMix(sess *net.Session, input string) {
- p := sess.Player.(*player.Player)
- g.CancelAction(p)
+ p := sess.Player
+ g.cancelAction(p)
allRecipes, err := g.RecipeStore.LoadAll()
if err != nil {
@@ -35,7 +34,7 @@ func (g *Game) doMix(sess *net.Session, input string) {
if outDef != nil {
name = outDef.Name
}
- if world.WordPrefixMatch(itemName, name) {
+ if action.WordPrefixMatch(itemName, name) {
matched = append(matched, r)
}
}
@@ -68,7 +67,7 @@ func (g *Game) doMix(sess *net.Session, input string) {
names = append(names, g.recipeName(sess, &r))
}
g.showMenuTable(sess, "What would you like to mix?", names)
- sess.PendingMenu = recipeMenuData(available)
+ sess.PendingMenu = recipeMenuData(recipeDefIDs(available))
}
func (g *Game) showMixMenu(sess *net.Session, p *player.Player, allRecipes []action.RecipeDef) {
@@ -109,5 +108,9 @@ func (g *Game) showMixMenu(sess *net.Session, p *player.Player, allRecipes []act
names = append(names, e.ItemName)
}
g.showMenuTable(sess, "What would you like to mix?", names)
- sess.PendingMenu = entryMenuData(entries)
+ ids := make([]string, len(entries))
+ for i, e := range entries {
+ ids[i] = e.Recipe.ID
+ }
+ sess.PendingMenu = recipeMenuData(ids)
}