Allow interacting with Rs2ItemModel's submenu#1555
Allow interacting with Rs2ItemModel's submenu#1555chsami merged 5 commits intochsami:developmentfrom
Conversation
…e manual lookup of identifier
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes add sub-action support for inventory item interactions. Rs2Inventory now computes the menu identifier by first checking the primary actions array; if not found, it queries Rs2ItemModel for a sub-action mapping, calculates the identifier via NewMenuEntry.findIdentifier, and sets an empty target for sub-action paths. Invocation now passes a target variable rather than always using the item name. Rs2ItemModel introduces getSubops() and getIndexOfSubAction(String), with lazy composition loading to expose sub-operations and map sub-actions to their corresponding main action and sub-index. Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java(3 hunks)runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2ItemModel.java(21 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-25T15:51:39.272Z
Learnt from: runsonmypc
PR: chsami/Microbot#1417
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/agility/AgilityScript.java:13-13
Timestamp: 2025-08-25T15:51:39.272Z
Learning: Both net.runelite.api.ItemID and net.runelite.api.gameval.ItemID are valid import paths in the RuneLite codebase. The microbot plugins consistently use net.runelite.api.ItemID as their established pattern.
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2ItemModel.java
📚 Learning: 2025-08-26T13:22:16.518Z
Learnt from: Voxsylvae
PR: chsami/Microbot#1415
File: runelite-client/src/main/java/net/runelite/client/plugins/microbot/pluginscheduler/tasks/requirements/PrePostScheduleRequirements.java:1215-1221
Timestamp: 2025-08-26T13:22:16.518Z
Learning: The Rs2Equipment.get(slot) method in the Microbot framework returns Rs2ItemModel instances with slot indices that correspond to valid EquipmentInventorySlot values, as items are retrieved by iterating through the enum values themselves. When processing equipment items that were originally obtained via Rs2Equipment.get(slot), the slot indices are guaranteed to be valid for EquipmentInventorySlot.values()[index] access.
Applied to files:
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2ItemModel.java
🧬 Code graph analysis (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java (1)
runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java (1)
NewMenuEntry(11-317)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build
...e-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2Inventory.java
Show resolved
Hide resolved
...e-client/src/main/java/net/runelite/client/plugins/microbot/util/inventory/Rs2ItemModel.java
Show resolved
Hide resolved
…leanup and efficiency improvements
Rs2ItemModel provides access to subops from which the sub-menu action and main action can be derived.
Lets say you want to teleport to "Castle wars" with your "Ring of dueling":
The ring provides a sub-menu with "Castle Wars" on right-click under "Rub". The sub-menu's "Castle Wars" comes from the Rs2ItemModel's subOps but the index of "Rub" depends on the inventory interface from which this interaction is executed.
This change has also been implemented throughout Rs2Walker to make sure it no longer relies on the 2-step transport interactions. Neither does it still need to calculate the invokeMenu's required identification with the number placed at the displayInfo.