Skip to content
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

fix: Remove deprecated widget API usages #1330

Merged
merged 11 commits into from
Nov 12, 2023

Conversation

pajlada
Copy link
Contributor

@pajlada pajlada commented Nov 12, 2023

This relies on #1324 being merged in first, then this rebased before it can be merged. This has been completed

  • feat: Add packWidget & unpackWidget utils
  • feat: Add WidgetTextRequirement constructor accepting a Component ID
  • feat: Add constructor to WidgetDetails accepting a component ID
  • fix: BarrowsHelper widget usage
  • fix: shadowofthestorm deprecated widget usage
  • fix: inventory container getter deprecated widget usage
  • fix: repace WorldLines deprecated WidgetInfo use with ComponentID
  • fix: replace deprecated usage of WidgetInfo.*
  • Remove deprecated WidgetInfo constructors for WidgetTextRequirement
  • Remove unused WidgetReplacement & WidgetDetails constructors
  • fix: replace deprecated usage of WidgetID.* for group IDs

There were a lot of things here that were not super easy to test, so it is a good idea to go commit by commit here & double check the changes that have been made. I have tried to keep each commit atomic & have it document what it's actually changed.

This PR must be merged in before any further QuestHelper updates can be pushed, see runelite/plugin-hub@db44ca0

This will replace all WidgetInfo constructor uses
This will replace the WidgetInfo constructor
Translated directly from WidgetInfo.java, but not tested
Replaces WidgetInfo.DIALOG_SPRITE_TEXT with ComponentID.DIALOG_SPRITE_TEXT, same as used in WidgetInfo.java
This has been loosely tested with the gem bag dialog, making sure it gets the correct text

Replaces WidgetInfo.DIARY_QUEST_WIDGET_TITLE with ComponentID.DIARY_TITLE, same as used in WidgetInfo.java
This has not been tested

Replaces WidgetInfo.DIALOG_PLAYER_TEXT with ComponentID.DIALOG_PLAYER_TEXT, same as used in WidgetInfo.java
This has been loosely tested by talking to an NPC, making sure the widget looks sane

Replaces WidgetInfo.CHATBOX_TITLE with ComponentID.CHATBOX_TITLE, same as used in WidgetInfo.java
This has been loosely tested by trying to deposit candy to the Great cauldron, which shows the same dialog

Replaces WidgetInfo.DIALOG_NPC_TEXT with ComponentID.DIALOG_NPC_TEXT, same as used in WidgetInfo.java
This has been loosely tested by talking to an NPC, making sure the widget looks sane

Replaces WidgetInfo.DIALOG_NPC_NAME with ComponentID.DIALOG_NPC_NAME, same as used in WidgetInfo.java

Replaces WidgetInfo.DIALOG_NPC_HEAD_MODEL with ComponentID.DIALOG_NPC_HEAD_MODEL, same as used in WidgetInfo.java

Replaces WidgetInfo.WORLD_MAP_VIEW with ComponentID.WORLD_MAP_MAPVIEW, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.EMOTE_CONTAINER with ComponentID.EMOTES_EMOTE_CONTAINER, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.EMOTE_WINDOW with ComponentID.EMOTES_WINDOW, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.EMOTE_SCROLLBAR with ComponentID.EMOTES_EMOTE_SCROLLBAR, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.BANK_TITLE_BAR with ComponentID.BANK_TITLE_BAR, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.BANK_ITEM_CONTAINER with ComponentID.BANK_ITEM_CONTAINER, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.BANK_SCROLLBAR with ComponentID.BANK_SCROLLBAR, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.BANK_CONTAINER with ComponentID.BANK_CONTAINER, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.BANK_SEARCH_BUTTON_BACKGROUND with ComponentID.BANK_SEARCH_BUTTON_BACKGROUND, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.CHATBOX_CONTAINER with ComponentID.CHATBOX_CONTAINER, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.CHATBOX_FULL_INPUT with ComponentID.CHATBOX_FULL_INPUT, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.ACHIEVEMENT_DIARY_CONTAINER with ComponentID.ACHIEVEMENT_DIARY_CONTAINER, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.RESIZABLE_MINIMAP_DRAW_AREA with ComponentID.RESIZABLE_VIEWPORT_BOTTOM_LINE_MINIMAP_DRAW_AREA, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.RESIZABLE_MINIMAP_STONES_DRAW_AREA with ComponentID.RESIZABLE_VIEWPORT_MINIMAP_DRAW_AREA, same as used in WidgetInfo.java
This has not been tested in-game

Replaces WidgetInfo.FIXED_VIEWPORT_MINIMAP_DRAW_AREA with ComponentID.FIXED_VIEWPORT_MINIMAP_DRAW_AREA, same as used in WidgetInfo.java
This has not been tested in-game
Replaces WidgetID.DIALOG_PLAYER_GROUP_ID with InterfaceID.DIALOG_PLAYER
They point to the same value in WidgetID.java
This has not been tested in-game

Replaces WidgetID.DIALOG_OPTION_GROUP_ID with InterfaceID.DIALOG_OPTION
They point to the same value in WidgetID.java
This has not been tested in-game

Replaces WidgetID.DIALOG_NPC_GROUP_ID with InterfaceID.DIALOG_NPC
They point to the same value in WidgetID.java
This has not been tested in-game

Replaces WidgetID.BANK_GROUP_ID with InterfaceID.BANK
They point to the same value in WidgetID.java
This has not been tested in-game
@pajlada pajlada force-pushed the chore/deprecated-widget-api branch from f1b435e to 0f68673 Compare November 12, 2023 14:12
Copy link
Owner

@Zoinkwiz Zoinkwiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, really helps me a lot! 😄

@Zoinkwiz Zoinkwiz merged commit 1f330c6 into Zoinkwiz:master Nov 12, 2023
1 check passed
@pajlada pajlada deleted the chore/deprecated-widget-api branch November 12, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants