From 10bd3d57d142b812270fb46becaad4cc83f07a8a Mon Sep 17 00:00:00 2001 From: ChunkyAtlas Date: Fri, 21 Mar 2025 20:18:05 -0600 Subject: [PATCH] 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. --- plugins/chance-man | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 plugins/chance-man diff --git a/plugins/chance-man b/plugins/chance-man new file mode 100644 index 000000000..f76c90504 --- /dev/null +++ b/plugins/chance-man @@ -0,0 +1,2 @@ +repository=https://github.com/ChunkyAtlas/chance-man.git +commit=07ce18b708ff4181531602ec1adaa4493435e0a8