add new location types and enhance inventory structure for shared stash support and DLC support.

This commit is contained in:
crazywh1t3
2026-02-13 22:28:16 +02:00
parent 828db2029f
commit 211abf01f0
4 changed files with 102 additions and 29 deletions

View File

@@ -10,18 +10,21 @@ type Location struct {
const (
// Storage locations
LocationUnknown LocationType = "unknown"
LocationInventory LocationType = "inventory"
LocationStash LocationType = "stash"
LocationSharedStash LocationType = "shared_stash"
LocationBelt LocationType = "belt"
LocationCube LocationType = "cube"
LocationVendor LocationType = "vendor"
LocationGround LocationType = "ground"
LocationSocket LocationType = "socket"
LocationCursor LocationType = "cursor"
LocationEquipped LocationType = "equipped"
LocationMercenary LocationType = "mercenary"
LocationUnknown LocationType = "unknown"
LocationInventory LocationType = "inventory"
LocationStash LocationType = "stash"
LocationSharedStash LocationType = "shared_stash"
LocationBelt LocationType = "belt"
LocationCube LocationType = "cube"
LocationVendor LocationType = "vendor"
LocationGround LocationType = "ground"
LocationSocket LocationType = "socket"
LocationCursor LocationType = "cursor"
LocationEquipped LocationType = "equipped"
LocationMercenary LocationType = "mercenary"
LocationGemsTab LocationType = "gems_tab"
LocationMaterialsTab LocationType = "materials_tab"
LocationRunesTab LocationType = "runes_tab"
// Body locations
LocNone LocationType = "none"

View File

@@ -8,10 +8,11 @@ import (
)
type Inventory struct {
Belt Belt
AllItems []Item
Gold int
StashedGold [4]int
Belt Belt
AllItems []Item
Gold int
StashedGold [6]int // [0]=personal, [1..5]=shared stash pages
SharedStashPages int // Number of shared stash units detected (3=non-DLC, 5+=DLC)
}
func (i Inventory) Find(name item.Name, locations ...item.LocationType) (Item, bool) {