From a33b27f1a50280094942d49e49071bc74dea48fd Mon Sep 17 00:00:00 2001 From: ChunkyAtlas Date: Sat, 28 Jun 2025 16:19:39 -0600 Subject: [PATCH] update chance-man to v2.2.0 (#8088) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update chance-man to 2.2.0 feat: Implement NPC drop table viewer in music tab This commit introduces a major UI feature that allows players to view NPC drop tables directly in-game by temporarily hijacking the music tab interface. A "Show Drops" menu option has been added to the right-click menu for NPCs. When selected, the plugin fetches the NPC's drop data and dynamically replaces the content of the music tab with a custom drop viewer UI. The new UI consists of several components: - **`DropsTabUI`**: The main class that initializes and manages the lifecycle of this feature. - **`DropsMenuListener`**: Injects the "Show Drops" option into the NPC context menu. - **`MusicWidgetController`**: The core of the feature, responsible for: - Backing up and hiding the original music widget elements. - Drawing a new interface that displays the NPC's name, level, and a progress bar for rolled vs. total drops. - Creating a scrollable grid of all possible drop items, with items the player has already "rolled" appearing faded. - **`SpriteOverrideManager`**: Replaces the default music tab icon with a custom "drops" icon to indicate that the drop viewer is active. - **`TabListener`**: Detects when the player navigates away from the music tab and restores its original content, ensuring the drop viewer is temporary. - **`WidgetUtils`**: Provides helper functions for creating menu entries and managing widget children. * Update chance-man Fix dependency injection for Gson and OkHttpClient; add DropFetcher shutdown * Update chance-man Fix dependency injection for Gson and OkHttpClient; add DropFetcher shutdown * Update chance-man - Replace manual name-and-ID search fallback with MediaWiki’s Special:Lookup extension (always queries by npcId first, then falls back to the provided name) - Simplify `buildWikiUrl` to emit `/w/Special:Lookup?type=npc&id=&name=#Drops` - Remove `findTitleByNpcId` and obsolete two-stage lookup logic - Streamline `fetch()` to log the Special:Lookup URL, fetch HTML, and parse drop tables * Update chance-man Add Jsoup as implementation and thirdParty dependency * Update chance-man * Update build.gradle * Update chance-man update HTTP User-Agent to "RuneLite-ChanceMan/2.2.0" --- package/verification-template/build.gradle | 2 +- plugins/chance-man | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/verification-template/build.gradle b/package/verification-template/build.gradle index a501d5900..f1073fda5 100644 --- a/package/verification-template/build.gradle +++ b/package/verification-template/build.gradle @@ -45,7 +45,7 @@ dependencies { because "discord-rare-drop-notifier, droptracker" } thirdParty("org.jsoup:jsoup:1.13.1") { - because "discord-rare-drop-notifier, drop-simulator, fire-beats, loot-table, loot-lookup" + because "discord-rare-drop-notifier, drop-simulator, fire-beats, loot-table, loot-lookup, chance-man" } thirdParty("com.miglayout:miglayout-swing:5.2") { because "drop-simulator" diff --git a/plugins/chance-man b/plugins/chance-man index 010b992a6..05573e6bc 100644 --- a/plugins/chance-man +++ b/plugins/chance-man @@ -1,2 +1,2 @@ repository=https://github.com/ChunkyAtlas/chance-man.git -commit=3b0a95d0797bd3db2f008ee9b888ee66d78157ff +commit=d9d0808f6c103e5e10b0f24de762577d64e0114c