Merge branch 'master' into master

This commit is contained in:
Patrick Watts
2024-09-18 11:22:40 +04:00
committed by GitHub
29 changed files with 1988 additions and 686 deletions

View File

@@ -1,14 +1,15 @@
package com.toofifty.easygiantsfoundry;
import static com.toofifty.easygiantsfoundry.EasyGiantsFoundryHelper.getHeatColor;
import com.toofifty.easygiantsfoundry.enums.Heat;
import com.toofifty.easygiantsfoundry.enums.Stage;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.overlay.OverlayPanel;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.LineComponent;
@@ -21,21 +22,23 @@ public class FoundryOverlay2D extends OverlayPanel
private final Client client;
private final EasyGiantsFoundryPlugin plugin;
private final EasyGiantsFoundryState state;
private final EasyGiantsFoundryHelper helper;
private final EasyGiantsFoundryConfig config;
@Inject
private FoundryOverlay2D(Client client, EasyGiantsFoundryPlugin plugin, EasyGiantsFoundryState state, EasyGiantsFoundryHelper helper, EasyGiantsFoundryConfig config)
private FoundryOverlay2D(
Client client,
EasyGiantsFoundryPlugin plugin,
EasyGiantsFoundryState state,
EasyGiantsFoundryConfig config)
{
this.client = client;
this.plugin = plugin;
this.state = state;
this.helper = helper;
this.config = config;
this.setPosition(OverlayPosition.BOTTOM_LEFT);
}
private Color getHeatColor(int actions, int heat)
private Color getHeatColor(int actions, int heat)
{
if (heat >= actions)
{
@@ -74,7 +77,8 @@ public class FoundryOverlay2D extends OverlayPanel
panelComponent.getChildren().add(TitleComponent.builder().text("Easy Giant's Foundry").build());
}
if (swordPickedUp) {
if (swordPickedUp)
{
Heat heat = state.getCurrentHeat();
Stage stage = state.getCurrentStage();
@@ -91,8 +95,8 @@ public class FoundryOverlay2D extends OverlayPanel
);
}
int actionsLeft = helper.getActionsLeftInStage();
int heatLeft = helper.getActionsForHeatLevel();
int actionsLeft = state.getActionsLeftInStage();
int heatLeft = state.getActionsForHeatLevel();
if (config.drawActionsLeft())
{
@@ -118,7 +122,7 @@ public class FoundryOverlay2D extends OverlayPanel
if (config.drawShopPoints())
{
panelComponent.getChildren().add(
LineComponent.builder().left("Reputation").right(plugin.getReputation() + "").build()
LineComponent.builder().left("Reputation").right(plugin.getReputation() + "").build()
);
}