Skip to content

Update chance-man to 2.2.0 #8088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

ChunkyAtlas
Copy link
Contributor

@ChunkyAtlas ChunkyAtlas commented May 25, 2025

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 haven't 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.

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.
@runelite-github-app
Copy link

runelite-github-app bot commented May 25, 2025

Fix dependency injection for Gson and OkHttpClient; add DropFetcher shutdown
Fix dependency injection for Gson and OkHttpClient; add DropFetcher shutdown
@runelite-github-app
Copy link

runelite-github-app bot commented May 25, 2025

This plugin requires a review from a Plugin Hub maintainer. The reviewer will request any additional changes if needed.


Internal use only: Reviewer details Maintainer details

- 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=<npcId>&name=<fallback>#Drops`  
- Remove `findTitleByNpcId` and obsolete two-stage lookup logic  
- Streamline `fetch()` to log the Special:Lookup URL, fetch HTML, and parse drop tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant