Fix's for overlays (#644)

This commit is contained in:
James
2019-06-18 03:47:02 -07:00
committed by Kyleeld
parent d4e53da693
commit 9df05ef772
2 changed files with 12 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.table.TableComponent; import net.runelite.client.ui.overlay.components.table.TableComponent;
import net.runelite.client.ui.overlay.components.table.TableAlignment;
import net.runelite.client.util.StackFormatter; import net.runelite.client.util.StackFormatter;
class BlastFurnaceCofferOverlay extends Overlay class BlastFurnaceCofferOverlay extends Overlay
@@ -59,6 +60,9 @@ class BlastFurnaceCofferOverlay extends Overlay
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics)
{ {
TableComponent tableComponent = new TableComponent();
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
if (plugin.getConveyorBelt() == null) if (plugin.getConveyorBelt() == null)
{ {
return null; return null;
@@ -72,12 +76,10 @@ class BlastFurnaceCofferOverlay extends Overlay
{ {
sack.setHidden(true); sack.setHidden(true);
TableComponent tableComponent = new TableComponent();
tableComponent.addRow("Coffer:", StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp"); tableComponent.addRow("Coffer:", StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp");
panelComponent.getChildren().add(tableComponent);
} }
panelComponent.getChildren().add(tableComponent);
return panelComponent.render(graphics); return panelComponent.render(graphics);
} }
} }

View File

@@ -35,6 +35,8 @@ import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.ImageComponent; import net.runelite.client.ui.overlay.components.ImageComponent;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.table.TableAlignment;
import net.runelite.client.ui.overlay.components.table.TableComponent;
class ItemRecoilOverlay extends Overlay class ItemRecoilOverlay extends Overlay
{ {
@@ -55,6 +57,9 @@ class ItemRecoilOverlay extends Overlay
@Override @Override
public Dimension render(Graphics2D graphics) public Dimension render(Graphics2D graphics)
{ {
TableComponent tableComponent = new TableComponent();
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
this.imagePanelComponent.getChildren().clear(); this.imagePanelComponent.getChildren().clear();
if (config.showrecoil()) if (config.showrecoil())
{ {
@@ -64,6 +69,8 @@ class ItemRecoilOverlay extends Overlay
imagePanelComponent.setBackgroundColor(plugin imagePanelComponent.setBackgroundColor(plugin
.isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR); .isRingOfRecoilEquipped() ? ACTIVATED_BACKGROUND_COLOR : NOT_ACTIVATED_BACKGROUND_COLOR);
imagePanelComponent.getChildren().add(new ImageComponent(recoilImage)); imagePanelComponent.getChildren().add(new ImageComponent(recoilImage));
imagePanelComponent.getChildren().add(tableComponent);
return imagePanelComponent.render(graphics); return imagePanelComponent.render(graphics);
} }
} }