Skip to content

Commit

Permalink
bank: fix account ad popup blocking clear-all fillers
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed Aug 3, 2023
1 parent ee8b354 commit 55cea3e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public final class WidgetID
public static final int BGR_RANK_RUNEVERSI_GROUP_ID = 46;
public static final int AGILITY_ARENA_HUD_GROUP_ID = 5;
public static final int GNOMEBALL_SCORE_GROUP_ID = 139;
public static final int CLANKRANK_POPUP = 289;
public static final int CLANRANK_POPUP = 289;
public static final int SANITY_GROUP_ID = 834;
public static final int THE_STRANGLER_INFECTION_GROUP_ID = 836;

Expand Down Expand Up @@ -318,7 +318,7 @@ static class Bank
static final int EQUIPMENT_CONTENT_CONTAINER = 69;
static final int SETTINGS_BUTTON = 113;
static final int EQUIPMENT_BUTTON = 114;
static final int JAGEX_ACCOUNT_AD = 116;
static final int POPUP = 116;
}

static class GroupStorage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public enum WidgetInfo
BANK_TAB_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.TAB_CONTAINER),
BANK_EQUIPMENT_CONTAINER(WidgetID.BANK_GROUP_ID, WidgetID.Bank.EQUIPMENT_CONTENT_CONTAINER),
BANK_EQUIPMENT_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.EQUIPMENT_BUTTON),
BANK_JAGEX_ACCOUNT_AD(WidgetID.BANK_GROUP_ID, WidgetID.Bank.JAGEX_ACCOUNT_AD),
BANK_POPUP(WidgetID.BANK_GROUP_ID, WidgetID.Bank.POPUP),
BANK_ITEM_COUNT_TOP(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_TOP),
BANK_ITEM_COUNT_BAR(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BAR),
BANK_ITEM_COUNT_BOTTOM(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BOTTOM),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,22 @@ public void onWidgetLoaded(WidgetLoaded event)
{
updateSeedVaultTotal();
}
else if (event.getGroupId() == WidgetID.CLANKRANK_POPUP // also the Jagex account ad in the bank
else if (event.getGroupId() == WidgetID.CLANRANK_POPUP // also the Jagex account ad in the bank
&& config.blockJagexAccountAd())
{
var wn = client.getComponentTable()
.get(WidgetInfo.BANK_JAGEX_ACCOUNT_AD.getId());
.get(WidgetInfo.BANK_POPUP.getId());
if (wn != null)
{
clientThread.invokeLater(() -> client.closeInterface(wn, true));
clientThread.invokeLater(() ->
{
var w = client.getWidget(WidgetID.CLANRANK_POPUP, 4).getChild(1);
// this is also re-used by the clear all bank fillers popup
if (w.getText().equals("Want more bank space?"))
{
client.closeInterface(wn, true);
}
});
}
}
}
Expand Down

0 comments on commit 55cea3e

Please sign in to comment.