TicTac7x / runelite-plugins

External plugins for RuneLite
https://runelite.net/plugin-hub/
10 stars 11 forks source link

[Item Charges Improved] [Feature Request] Disable overlay outside of bank interface #185

Open Ckrisirkc opened 2 months ago

Ckrisirkc commented 2 months ago

I really like the idea behind this plugin. When I'm in the bank it's awesome to be able to see all the charges so I know if I should recharge anything, but I don't like having the text overlay on my items when doing PvM.

I'd love an option to disable the text outside of the bank interface. Basically the opposite of #82

Appreciate any consideration, and thank you for the plugin.

Ckrisirkc commented 2 months ago

Just wanted to add a little legwork to this, but similar to the other request I believe this could be implemented in the same manner by modifying ChargedItemOverlay.renderItemOverlay with minimal additions.

I don't have the runelite/plugin development environment set up or I'd try it myself, but I figure it could work with an addition of a config menu entry in ChargesImprovedConfig:

@ConfigItem(
      keyName = "hide_outside_bank_overlays",
      name = "Hide overlays outside of Bank",
      description = "Hide charges of the items outside of the bank",
      position = 6,
      section = general
  ) default boolean hideOutsideBank() { return false; }

Followed by a similar implementation to what exists inside ChargedItemOverlay.renderItemOverlay:

if (
    // Item overlay disabled.
    !isChargedItemOverlayEnabled(chargedItem.get()) ||

    // Infinity charges hidden.
    !config.showUnlimited() && chargedItem.get().getCharges().equals("∞") ||
    !config.showUnlimited() && triggerItem.get().fixedCharges.isPresent() && triggerItem.get().fixedCharges.get().equals(Charges.UNLIMITED) ||

    // Hide overlays in bank.
    !config.showBankOverlays() && isBankWidget(widgetItem) ||
    // Hide overlays outside of the bank.
    config.hideOutsideBank() && !isBankWidget(widgetItem)
) return;

Cheers and thanks again.

TicTac7x commented 4 days ago

I will implement this bit differently, so that the option works "at bank", meaning that when bank interface is open, then you can also see charges for the items that are also in the inventory. Otherwise it's bit weird and you need to bank your items to see the charges.

TicTac7x commented 4 days ago

https://github.com/runelite/plugin-hub/pull/6560