Default to not show info box anywhere.

Added a red "Open bank" text if you haven't opened the bank yet.
Updated the count to only update when itemContainerChanged triggers.
This commit is contained in:
Christopher Riwik
2025-08-27 18:28:56 +02:00
parent 50d72f9635
commit 82d6add928
3 changed files with 16 additions and 8 deletions

View File

@@ -524,7 +524,7 @@ public interface EasyGiantsFoundryConfig extends Config
description = "Where to show the info box", description = "Where to show the info box",
section = totalMetalsInfo section = totalMetalsInfo
) )
default Location location() { return Location.GIANTS_FOUNDRY; } default Location location() { return Location.NOWHERE; }
@ConfigItem( @ConfigItem(
position = 2, position = 2,

View File

@@ -57,7 +57,12 @@ class EasyGiantsFoundryMetalInfo extends OverlayPanel
|| config.location() == Location.NOWHERE) || config.location() == Location.NOWHERE)
return null; return null;
CountBars(); if (bank == null)
panelComponent.getChildren().add(LineComponent.builder()
.left("Open bank")
.leftColor(Color.RED)
.build());
if (bronzeBars > 0 || config.showZeroValues()) if (bronzeBars > 0 || config.showZeroValues())
AddMetalBarText("Bronze bars:", bronzeBars); AddMetalBarText("Bronze bars:", bronzeBars);
if (ironBars > 0 || config.showZeroValues()) if (ironBars > 0 || config.showZeroValues())

View File

@@ -270,12 +270,15 @@ public class EasyGiantsFoundryPlugin extends Plugin
updateSmithsOutfitPieces(); updateSmithsOutfitPieces();
} }
} }
else if (event.getContainerId() == InventoryID.BANK.getId()) { else {
if (event.getContainerId() == InventoryID.BANK.getId()) {
metalInfo.bank = event.getItemContainer(); metalInfo.bank = event.getItemContainer();
} }
else if (event.getContainerId() == InventoryID.INVENTORY.getId()) { else if (event.getContainerId() == InventoryID.INVENTORY.getId()) {
metalInfo.inventory = event.getItemContainer(); metalInfo.inventory = event.getItemContainer();
} }
metalInfo.CountBars();
}
} }
public void onMenuEntryAdded(MenuEntryAdded event) public void onMenuEntryAdded(MenuEntryAdded event)