From 9e390812e387de81ef09e1a1509d5c2d04e4d0e2 Mon Sep 17 00:00:00 2001 From: melkypie <5113962+melkypie@users.noreply.github.com> Date: Tue, 13 Oct 2020 01:17:36 +0300 Subject: [PATCH] motherlode: allow sack overlay to be resizable Also makes the overlay adhere to overlayBackgroundColor config --- .../plugins/motherlode/MotherlodeSackOverlay.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSackOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSackOverlay.java index 4d2135224c..c69f09f6fe 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSackOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeSackOverlay.java @@ -35,23 +35,20 @@ import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG; import net.runelite.api.Varbits; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; -import net.runelite.client.ui.overlay.Overlay; import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE; import net.runelite.client.ui.overlay.OverlayMenuEntry; +import net.runelite.client.ui.overlay.OverlayPanel; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.components.ComponentConstants; import net.runelite.client.ui.overlay.components.LineComponent; -import net.runelite.client.ui.overlay.components.PanelComponent; -class MotherlodeSackOverlay extends Overlay +class MotherlodeSackOverlay extends OverlayPanel { private static final Color DANGER = new Color(150, 0, 0, 150); private final Client client; private final MotherlodeConfig config; private final MotherlodePlugin plugin; - private final PanelComponent panelComponent = new PanelComponent(); - @Inject MotherlodeSackOverlay(Client client, MotherlodeConfig config, MotherlodePlugin plugin) { @@ -73,7 +70,6 @@ class MotherlodeSackOverlay extends Overlay Widget sack = client.getWidget(WidgetInfo.MOTHERLODE_MINE); - panelComponent.getChildren().clear(); panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR); if (sack != null) @@ -119,6 +115,6 @@ class MotherlodeSackOverlay extends Overlay } } - return panelComponent.render(graphics); + return super.render(graphics); } }