Loot filter on the options window's Beute page

Per category (Gold, Tränke, white/blue/yellow/brown/green items) one of
Löschen (loot deleted at once), Ignorieren (pickup key leaves it), Standard,
Immer anzeigen (label without the labels key). Replaces the game's
PICKUPAUTO choice; settings in [loot] of sacredK.ini. docs/loot-filter.md.
Also ignore MSYS *.stackdump files.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-19 22:14:58 +02:00
1 parent ce3d46a568
commit 198c21dbfa
12 files changed
+709 -25

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
# Loot filter (Beute page)
Request (2026-10-19): on the options window's *Beute* tab, per category —
Gold, Tränke, and the item colours white / blue / yellow / brown / green —
one of:
- **Löschen** (Void): the drop is deleted at once;
- **Ignorieren** (Ignore): the pickup key leaves it;
- **Standard** (Default): picked up, label with the labels key (Alt);
- **Immer anzeigen** (Always Show): picked up, label without the key too.
Decided with the user: the filter replaces the game's PICKUPAUTO choice
(all / valuable / gold only; its radio buttons are hidden, the animation
checkbox stays); Void deletes loot only (monster drops, chests), not items
the player puts down. Settings: `[loot]` in `sacredK.ini`
(`Gold=Default`, keys Gold, Potions, White, Blue, Yellow, Brown, Green;
values Void, Ignore, Default, AlwaysShow). Code: `src/mods/lootfilter.cpp`,
page in `src/mods/options.cpp`.
## What decides the category (read from the game)
- Gold: `0x43ae20` (thiscall on the item type table, (type)): one of four
types listed at `0x947920`. The labels show its amount, the collect mode
takes it without inventory space, the loot drop sets the amount after
creating it.
- Potions: item class 9 (type table +0x2e).
- Item colour (`0x5c1330`, the items' vf24 case 2): set items green
(type group record `0x433f00` +0x23); otherwise, with the game's
`UNIQUE_COLOR` option (on by default), by the quality tier, bits 16..19 of
the item's quality flags (+0x11c): up to 4 white `ffefefef`, 5..11 blue
`ffa0a0ff`, 12..14 yellow `fff0e040`, 15 brown `ffc19a33`; set green
`ff15ff25`. (Without UNIQUE_COLOR, items with special bits get other
colours from `0x5c1260`; the filter uses the tier regardless.)
- Not filtered: runes (class 0x1c), objects with flag 0x800 and the types
`0x428550` reports (CanCollectItem always takes both; quest items,
presumably).
## Where it acts
- **Pickup**: `cCreature::CanCollectItem` (`0x4ec170`, (item), ret 4) is the
filter of the collect mode (`0x4ec3a0`, the pickup key's order 0x113): its
ring scan and the follow-up scan next to a picked item. A clicked item does
not ask it. Original: refuses carried items (+0x14 bit 2), takes the
always-collected ones, then filters by PICKUPAUTO (`0x819580`; 1 by value
against the hero level, 2 gold only). Now: carried → no; else by mode.
- **Void**: the loot drop `cCreature 0x559a30` ((forced type, ?, ?, killer),
ret 0x10; logs `Drop from [%d] %s`) makes its items with
`cObjectManager::CreateAt` (`0x5fbaa0`, ret 0x14) and tosses them
(`0x44e0a0`). Chests keep their contents as ids at +0x1e4/+0x1e8;
`cChest3D::dropItems` (`0x5c9b10`, ret 4) throws them out. Ids from both
are queued and handled on the next engine tick (the callers use the item
after creating it, e.g. `0x4d0f29` uses the returned object): still on the
map (no carried / dead flag) and Void → `RemoveFromMap` (`0x5fc910`) and
`DestroyObject(id, 0, 0, 0)`, as the loot drop itself replaces an item.
Player drops go through `cEngine::dropItem` (`0x6116c0`), not touched.
- **Always Show**: `cWorldView0::DrawObjectLabels` (`0x627260`, (renderer),
ret 4) draws the labels list (+0x96b30, 0x1c per entry, +0 object id; an
entry with the high bit set is skipped) only with the key held (it sets
+0x10 bit 0x4000 from the key). Without the key, if an always-shown item
is listed: all other entries are marked skipped, the key reads as held
(`input::ForceLabels`), the original runs, the marks and bit 0x4000 go back.
Clicking such a label without the key does not pick it up (PickObjectAt
`0x626d30` uses its own list); clicking the item does.
## The page
The auto-pickup frame (now only *Animation*) stays at the top left; below it,
across both columns, a framed table: a row per category (name in the game's
colour), a box per mode, the chosen one highlighted; the title "Beutefilter"
in the header row (above the frame it met the backdrop); hints at the bottom.
Changes are kept until OK (`0x717460`), Cancel drops them, like the key
bindings.
+8
View File
@@ -109,3 +109,11 @@ Request: M (map), Tab (minimap) and Alt (text overlay) bindable too.
instead: `LabelsKeyState` returns the bound key's state.
- Alt and F10 come as WM_SYSKEYDOWN: the key capture takes those too.
- Key page: 20 lines per column (line 25 px) to fit the three rows.
## Beute: loot filter (2026-10-19)
The page holds the loot filter (`docs/loot-filter.md`): the game's pickup
choice (PICKUPAUTO radio buttons, their labels, the separator; matched by
pointer and control name at +0x30) is never shown, a framed table below the
auto-pickup frame sets a mode per category. Its frame is made like the key
page's (`AddFrame`).