Skip to content

feat: add BELTCOLUMN{1,2,3,4} keywords#88

Open
segnis-de-pugis wants to merge 3 commits into
Project-Diablo-2:mainfrom
segnis-de-pugis:segnis/feat/belt
Open

feat: add BELTCOLUMN{1,2,3,4} keywords#88
segnis-de-pugis wants to merge 3 commits into
Project-Diablo-2:mainfrom
segnis-de-pugis:segnis/feat/belt

Conversation

@segnis-de-pugis
Copy link
Copy Markdown
Contributor

Would it be possible to have something like this in pd2?

I would like be able to hide potions on the ground if my belt is already full and only show them when there is a space for them in the designated column(s) of the belt. For example BELTCOLUMN2>0 would match if there is at least one item in the second column in the belt.

It's probably a niche use-case, but I'd personally use it in my filter.

Examples

Alias[HEALTH_POTS]: (hp1 OR hp2 OR hp3 OR hp4 OR hp5)
Alias[MANA_POTS]: (mp1 OR mp2 OR mp3 OR mp4 OR mp5)

% hide potions if the belt is full
ItemDisplay[(BELTCOLUMN1>3 BELTCOLUMN2>3) HEALTH_POTS]: %RED%would be hidden %WHITE%%NAME%
ItemDisplay[BELTCOLUMN3>3 MANA_POTS]: %RED%would be hidden %WHITE%%NAME%

% show potions if there is space in the belt (only works for belts with 4 rows)
ItemDisplay[(BELTCOLUMN1<4 OR BELTCOLUMN2<4) HEALTH_POTS): %GREEN%would be shown %WHITE%%NAME%
ItemDisplay[BELTCOLUMN3><4 MANA_POTS]: %GREEN%would be shown %WHITE%%NAME%

Space for mana pots:
pots_1

Space for health pots:
pots_3

No space for any pots:
pots_2

Tests

I tested that this works with no belt, 2x4 belt, 4x4 belt

Known limitations

Because of the caching, hidden potions won't become visible when the character drinks a potion from the belt, and vice-versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant