Skip to content

Commit

Permalink
add rune pouch
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Jun 23, 2024
1 parent ffdc48e commit 928cf8b
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import lombok.Value;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.EnumComposition;
import net.runelite.api.EnumID;
import net.runelite.api.EquipmentInventorySlot;
import net.runelite.api.InventoryID;
import net.runelite.api.Item;
Expand Down Expand Up @@ -620,6 +622,32 @@ public Layout generateLayout(TagTab tab)
}
}

// Rune pouch
{
final int[] RUNEPOUCH_RUNES = {
Varbits.RUNE_POUCH_RUNE1, Varbits.RUNE_POUCH_RUNE2, Varbits.RUNE_POUCH_RUNE3, Varbits.RUNE_POUCH_RUNE4
};
final EnumComposition runepouchEnum = client.getEnum(EnumID.RUNEPOUCH_RUNE);

int lpos = 40;
for (int idx = 0; idx < RUNEPOUCH_RUNES.length; ++idx, ++lpos)
{
int runeId = client.getVarbitValue(RUNEPOUCH_RUNES[idx]);
if (runeId > 0)
{
int itemId = runepouchEnum.getIntValue(runeId);

int old = l.getItemAtPos(lpos);
if (old != -1)
{
removed.add(old);
}

l.setItemAtPos(itemId, lpos);
}
}
}

// Middle column
for (int j = 0; j < 5; ++j)
{
Expand Down

0 comments on commit 928cf8b

Please sign in to comment.