Always display overlay for title and reputation
This commit is contained in:
@@ -2,6 +2,7 @@ package com.toofifty.easygiantsfoundry;
|
|||||||
|
|
||||||
import com.toofifty.easygiantsfoundry.enums.Heat;
|
import com.toofifty.easygiantsfoundry.enums.Heat;
|
||||||
import com.toofifty.easygiantsfoundry.enums.Stage;
|
import com.toofifty.easygiantsfoundry.enums.Stage;
|
||||||
|
import net.runelite.api.Client;
|
||||||
import net.runelite.client.ui.ColorScheme;
|
import net.runelite.client.ui.ColorScheme;
|
||||||
import net.runelite.client.ui.overlay.OverlayPanel;
|
import net.runelite.client.ui.overlay.OverlayPanel;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
@@ -17,14 +18,17 @@ import java.awt.Graphics2D;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class FoundryOverlay2D extends OverlayPanel
|
public class FoundryOverlay2D extends OverlayPanel
|
||||||
{
|
{
|
||||||
|
private static final int REGION_ID = 13491;
|
||||||
|
private final Client client;
|
||||||
private final EasyGiantsFoundryPlugin plugin;
|
private final EasyGiantsFoundryPlugin plugin;
|
||||||
private final EasyGiantsFoundryState state;
|
private final EasyGiantsFoundryState state;
|
||||||
private final EasyGiantsFoundryHelper helper;
|
private final EasyGiantsFoundryHelper helper;
|
||||||
private final EasyGiantsFoundryConfig config;
|
private final EasyGiantsFoundryConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private FoundryOverlay2D(EasyGiantsFoundryPlugin plugin, EasyGiantsFoundryState state, EasyGiantsFoundryHelper helper, EasyGiantsFoundryConfig config)
|
private FoundryOverlay2D(Client client, EasyGiantsFoundryPlugin plugin, EasyGiantsFoundryState state, EasyGiantsFoundryHelper helper, EasyGiantsFoundryConfig config)
|
||||||
{
|
{
|
||||||
|
this.client = client;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.helper = helper;
|
this.helper = helper;
|
||||||
@@ -50,18 +54,21 @@ public class FoundryOverlay2D extends OverlayPanel
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
if (!state.isEnabled() || state.getCurrentStage() == null)
|
if (client.getLocalPlayer().getWorldLocation().getRegionID() != REGION_ID)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
boolean swordPickedUp = state.isEnabled() && state.getCurrentStage() != null;
|
||||||
Heat heat = state.getCurrentHeat();
|
|
||||||
Stage stage = state.getCurrentStage();
|
|
||||||
|
|
||||||
if (config.drawTitle())
|
if (config.drawTitle())
|
||||||
{
|
{
|
||||||
panelComponent.getChildren().add(TitleComponent.builder().text("Easy Giant's Foundry").build());
|
panelComponent.getChildren().add(TitleComponent.builder().text("Easy Giant's Foundry").build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (swordPickedUp) {
|
||||||
|
Heat heat = state.getCurrentHeat();
|
||||||
|
Stage stage = state.getCurrentStage();
|
||||||
|
|
||||||
if (config.drawHeatInfo())
|
if (config.drawHeatInfo())
|
||||||
{
|
{
|
||||||
panelComponent.getChildren().add(
|
panelComponent.getChildren().add(
|
||||||
@@ -90,6 +97,7 @@ public class FoundryOverlay2D extends OverlayPanel
|
|||||||
LineComponent.builder().left("Heat left").right(heatLeft + "").rightColor(getHeatColor(actionsLeft, heatLeft)).build()
|
LineComponent.builder().left("Heat left").right(heatLeft + "").rightColor(getHeatColor(actionsLeft, heatLeft)).build()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int points = plugin.getPointsTracker().getShopPoints();
|
int points = plugin.getPointsTracker().getShopPoints();
|
||||||
if (config.drawShopPoints())
|
if (config.drawShopPoints())
|
||||||
|
|||||||
Reference in New Issue
Block a user