Commit Graph

8 Commits

Author SHA1 Message Date
ChunkyAtlas
cd43d7fc17 update chance-man (#7840)
- Added a boolean flag (tradeableItemsInitialized) that triggers refreshTradeableItems() only once during the GameTick when the client state is LOGGED_IN.

- Updated onShutdown() to reset tradeableItemsInitialized to false

- changed ItemID.SIGIL_OF_STORAGE_ATTUNED to ItemID.SIGIL_OF_STORAGE_UNATTUNED
2025-04-15 09:39:00 +02:00
ChunkyAtlas
56e9103f92 update chance-man (#7830)
fixed missing isNormalWorld in onItemContainerChanged.

fixed Dragon Dart (p) and Amethyst Arrow (p)
2025-04-14 17:42:02 +02:00
ChunkyAtlas
61ca1a2a20 update chance-man to v2.1.0 (#7778)
* Update chance-man to 2.0.0

Massive Overhaul: Integrate New Menus & Account Systems, Refactor Core Functionality

Menus Enhancements:
- Differentiated ground item interactions from other menu entries.
- Introduced helper methods (isGroundItem and isLockedGroundItem) to accurately detect and manage locked ground items.
- Locked ground items now display their 'Take' (and similar) options in grey (<col=808080> tags) and are disabled via a no-op click handler, while 'Drop' actions remain enabled.
- Added a static method handleGroundItems as an extra safeguard to ensure locked ground item events are properly consumed.

Account System Overhaul:
- Integrated a new Account package to streamline multi-account management.
- Added event handling (AccountChanged) for seamless account state transitions.
- Enhanced item tracking and permissions with a robust account management logic.
- Updated ChanceManPlugin with a public getter getItemManager() for reliable canonicalization, ensuring consistent operations across accounts.

Refactoring and Structural Improvements:
- Restructured the project into clearer packages: com.chanceman.account for account-related functionality and com.chanceman.menus for menu interactions.
- Updated ActionHandler to manage user interactions more robustly, preventing unintended operations and enforcing skill, spell, and item usage restrictions.
- Consolidated various helper classes and logic, including Restrictions, RuneProvider, SkillItem, SkillOp, and Spell.
- Enhanced overall code quality and readability

* Update chance-man

add more blocked items to ItemsFilter
increase item pool number

* Update chance-man

add more blocked items.

* Update chance-man

preserve order and improve manual roll messaging

- Change unlocked/rolled items storage to LinkedHashSet to maintain insertion order, allowing the UI to display the most recent items on top.

- set a manualRoll flag in the roll animation so manual rolls display "by pressing a button" instead of a random item name.

* Update chance-man

update deprecated usages to use gameval
add items to itemfilter

* Update chance-man

update world types in "isNormalWorld"

* Update chance-man to 2.1.0

Enhance filtering for poison weapons, flatpacks, and armour sets

- Refactor ItemsFilter:
  - Add new files for supporting features (e.g., PoisonWeapons, ArmourSets, BlockedItems).
  - Simplify isBlocked() to combine checks for flatpacks, armour sets, and blocked items.
  - Add isPoisonEligible() method that wraps the PoisonWeapons logic for filtering eligible poisonable weapons.
  
- Add new global prerequisites for poisonable weapons in the PoisonWeapons enum:
  - Introduce global constants for standard, enhanced, and superior weapon poisons.
  - Update all poisonable weapons (e.g. daggers, javelins, spears, darts, knives, arrows, bolts) with four variants: base, (p), (p+), and (p++).

- Add new configuration options:
  - enableArmourSets: Toggle armour set items in the rollable list.
  - enableFlatpacks: Toggle flatpack items in the rollable list.
  - requireWeaponPoison: Require that both the base weapon and its matching global weapon poison are unlocked for poison variants.

- Update ChanceManPlugin:
  - Modify refreshTradeableItems() to exclude poison variants when the base weapon or its corresponding global poison is not unlocked.

* Update chance-man
2025-04-14 02:59:46 -04:00
ChunkyAtlas
354c52ea5f update chance-man to v1.2.0 (#7742)
Refactor ChanceManPanel and expand ItemsFilter
- Updated Chance Man to treat noted items as their regular variants,
  ensuring that noted drops are handled like normal items.
- Refactored layout code to improve panel viewing
- Expanded the ItemsFilter list with additional blocked items
2025-04-01 00:46:52 -04:00
ChunkyAtlas
f04933f4a7 update chance-man to v1.1.5 (#7722)
* Update chance-man to 1.1.4

fix: reset plugin state, enhance UI with count labels and colored messages, and update ItemsFilter

- Reset plugin state in shutDown() by nullifying managers, panels, navButton, and fileExecutor,
  and setting itemsInitialized to false. This fixes the issue where toggling the plugin off/on
  required a client restart.
- Update refreshTradeableItems() to filter items with isNotTracked()
- Modify chat message output to display the unlocked item in green and the rolled item in red.
- Add rolled/unlocked count labels to ChanceManPanel, updating counts as "Rolled: X/Y" and "Unlocked: X/Y".
- Update init() and updatePanel() methods to integrate the new UI components.
- Update ItemsFilter to include additional blocked items

* Update chance-man

add a new more items to itemsFilter

* Update chance-man

add filter buttons with tooltips for unlocked/rolled item filtering

* Update chance-man

fix Rolled/Unlocked indicator under Rolled/Unlocked columns
2025-03-28 00:26:23 -04:00
ChunkyAtlas
9ad3548bef update chance-man to v1.1.2 (#7701)
Fix timing issue by deferring tradeable items refresh

- Add an "itemsInitialized" flag to ensure initialization only happens once.
- Remove the early call to refreshTradeableItems() in startUp().
- Update onGameTick() to initialize managers and UI (and call refreshTradeableItems) only when client.getLocalPlayer() is available and itemsInitialized is false.
2025-03-23 16:10:28 -04:00
ChunkyAtlas
959fb6807f update chance-man to v1.1.1 (#7696)
feat: add ItemsFilter to exclude non-rollable items, handle ensouled heads, and implement GE blocking
- Implement ItemsFilter with a hard-coded, case-insensitive set of blocked item names.
- Integrate ensouled head mapping into ItemsFilter to assign proper item IDs based on the item name.
- Update ChanceManPlugin to skip blocked items and remap ensouled heads during the item pull.
- Implement GE blocking using a ScriptPostFired subscriber (script ID 751) to kill GE search results so that locked items are hidden from the GE
2025-03-23 02:37:02 -04:00
ChunkyAtlas
10bd3d57d1 add chance-man (#7663)
* Create chance-man

Chance Man is a plugin that locks tradeable items until they are unlocked with a random roll. The plugin tracks rolled and unlocked items per player and saves progress using JSON files. It also includes a roll animation and a simple user interface panel for viewing rolled and unlocked items

* Update chance-man

Fix Icon

* Update chance-man

Fix: Use injected Gson instead of creating new instances
- Removed direct `new Gson()` calls in UnlockedItemsManager and RolledItemsManager

- Injected RuneLite's Gson in ChanceManPlugin and passed it to each manager constructor

* Update chance-man

Create LICENSE

* Update chance-man

Fix roll trigger logic for unlocked items

- Update ground and inventory event handlers to trigger a roll for new instances (locked or unlocked) if not already rolled.

- Remove extra checks in RollAnimationManager so that every new instance triggers a roll once.

* Update chance-man

* Update chance-man

- Updated UnlockedItemsManager and RolledItemsManager to construct file paths using RuneLite.RUNELITE_DIR.

- Replaced manual system property construction with the RuneLite constant

- Added a null-check for rolledItemsManager in onItemContainerChanged to prevent NullPointerExceptions.

* Update chance-man

feat: use shared executor for file I/O, update roll animation chat message, and add search bar

- Initialize a shared single-threaded executor in ChanceManPlugin for asynchronous file operations.
- Update UnlockedItemsManager and RolledItemsManager to use the shared executor for load/save tasks.
- Remove individual executor shutdowns from managers and shut down the shared executor in plugin shutdown.
- Modify RollAnimationManager to include the queued (rolled) item in the chat message ("Unlocked {itemname} by rolling {rolleditemname}").
- Add a search bar to ChanceManPanel for filtering of rolled and unlocked items.
2025-03-21 22:18:05 -04:00