Tables everywhere
This commit is contained in:
@@ -35,8 +35,9 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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 LapCounterOverlay extends Overlay
|
||||
{
|
||||
@@ -80,25 +81,23 @@ class LapCounterOverlay extends Overlay
|
||||
}
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total Laps:")
|
||||
.right(Integer.toString(session.getTotalLaps()))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
tableComponent.addRow("Total Laps:", Integer.toString(session.getTotalLaps()));
|
||||
|
||||
if (config.lapsToLevel() && session.getLapsTillLevel() > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Laps until level:")
|
||||
.right(Integer.toString(session.getLapsTillLevel()))
|
||||
.build());
|
||||
tableComponent.addRow("Laps until level:", Integer.toString(session.getLapsTillLevel()));
|
||||
}
|
||||
|
||||
if (config.lapsToGoal() && session.getLapsTillGoal() > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Laps until goal:")
|
||||
.right(Integer.toString(session.getLapsTillGoal()))
|
||||
.build());
|
||||
tableComponent.addRow("Laps until goal:", Integer.toString(session.getLapsTillGoal()));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -38,8 +38,10 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public class BarrowsBrotherSlainOverlay extends Overlay
|
||||
{
|
||||
@@ -75,24 +77,23 @@ public class BarrowsBrotherSlainOverlay extends Overlay
|
||||
}
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
for (BarrowsBrothers brother : BarrowsBrothers.values())
|
||||
{
|
||||
final boolean brotherSlain = client.getVar(brother.getKilledVarbit()) > 0;
|
||||
String slain = brotherSlain ? "\u2713" : "\u2717";
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(brother.getName())
|
||||
.right(slain)
|
||||
.rightColor(brotherSlain ? Color.GREEN : Color.RED)
|
||||
.build());
|
||||
tableComponent.addRow(brother.getName(), ColorUtil.prependColorTag(slain, brotherSlain ? Color.RED : Color.GREEN));
|
||||
}
|
||||
|
||||
float rewardPercent = client.getVar(Varbits.BARROWS_REWARD_POTENTIAL) / 10.0f;
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Potential")
|
||||
.right(rewardPercent != 0 ? rewardPercent + "%" : "0%")
|
||||
.rightColor(rewardPercent >= 73.0f && rewardPercent <= 88.0f ? Color.GREEN : rewardPercent < 65.6f ? Color.WHITE : Color.YELLOW)
|
||||
.build());
|
||||
tableComponent.addRow("Potential", ColorUtil.prependColorTag(rewardPercent != 0 ? rewardPercent + "%" : "0%", rewardPercent >= 73.0f && rewardPercent <= 88.0f ? Color.GREEN : rewardPercent < 65.6f ? Color.WHITE : Color.YELLOW));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
|
||||
class BlastFurnaceCofferOverlay extends Overlay
|
||||
@@ -72,10 +72,13 @@ class BlastFurnaceCofferOverlay extends Overlay
|
||||
{
|
||||
sack.setHidden(true);
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Coffer:")
|
||||
.right(StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp")
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.addRow("Coffer:", StackFormatter.quantityToStackSize(client.getVar(BLAST_FURNACE_COFFER)) + " gp");
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -36,8 +36,9 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
class BoostsOverlay extends Overlay
|
||||
@@ -69,24 +70,21 @@ class BoostsOverlay extends Overlay
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
int nextChange = plugin.getChangeDownTicks();
|
||||
|
||||
if (nextChange != -1)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Next + restore in")
|
||||
.right(String.valueOf(plugin.getChangeTime(nextChange)))
|
||||
.build());
|
||||
tableComponent.addRow("Next + restore:", String.valueOf(plugin.getChangeTime(nextChange)));
|
||||
}
|
||||
|
||||
nextChange = plugin.getChangeUpTicks();
|
||||
|
||||
if (nextChange != -1)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Next - restore in")
|
||||
.right(String.valueOf(plugin.getChangeTime(nextChange)))
|
||||
.build());
|
||||
tableComponent.addRow("Next - restore:", String.valueOf(plugin.getChangeTime(nextChange)));
|
||||
}
|
||||
|
||||
if (plugin.canShowBoosts())
|
||||
@@ -119,14 +117,15 @@ class BoostsOverlay extends Overlay
|
||||
+ ColorUtil.prependColorTag("/" + base, Color.WHITE);
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(skill.getName())
|
||||
.right(str)
|
||||
.rightColor(strColor)
|
||||
.build());
|
||||
tableComponent.addRow(skill.getName() + ":", str);
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class CookingOverlay extends Overlay
|
||||
{
|
||||
@@ -53,18 +54,16 @@ class CookingOverlay extends Overlay
|
||||
|
||||
private final Client client;
|
||||
private final CookingPlugin plugin;
|
||||
private final CookingConfig config;
|
||||
private final XpTrackerService xpTrackerService;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
private CookingOverlay(Client client, CookingPlugin plugin, CookingConfig config, XpTrackerService xpTrackerService)
|
||||
private CookingOverlay(Client client, CookingPlugin plugin, XpTrackerService xpTrackerService)
|
||||
{
|
||||
super(plugin);
|
||||
setPosition(OverlayPosition.TOP_LEFT);
|
||||
this.client = client;
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
this.xpTrackerService = xpTrackerService;
|
||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Cooking overlay"));
|
||||
}
|
||||
@@ -95,15 +94,15 @@ class CookingOverlay extends Overlay
|
||||
.build());
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Cooked:")
|
||||
.right(session.getCookAmount() + (session.getCookAmount() >= 1 ? " (" + xpTrackerService.getActionsHr(Skill.COOKING) + "/hr)" : ""))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
tableComponent.addRow("Cooked:", session.getCookAmount() + (session.getCookAmount() >= 1 ? " (" + xpTrackerService.getActionsHr(Skill.COOKING) + "/hr)" : ""));
|
||||
tableComponent.addRow("Burnt:", session.getBurnAmount() + (session.getBurnAmount() >= 1 ? " (" + FORMAT.format(session.getBurntPercentage()) + "%)" : ""));
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Burnt:")
|
||||
.right(session.getBurnAmount() + (session.getBurnAmount() >= 1 ? " (" + FORMAT.format(session.getBurntPercentage()) + "%)" : ""))
|
||||
.build());
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -38,9 +38,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
@Slf4j
|
||||
class FermentTimerOverlay extends Overlay
|
||||
@@ -78,10 +79,15 @@ class FermentTimerOverlay extends Overlay
|
||||
.text("Making Wine")
|
||||
.color(Color.GREEN)
|
||||
.build());
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Ferments in: ")
|
||||
.right(String.valueOf(INITIAL_TIME - Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds()))
|
||||
.build());
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
tableComponent.addRow("Ferments in:", String.valueOf(INITIAL_TIME - Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds()));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,8 +43,10 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.ComponentConstants;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
class CorpDamageOverlay extends Overlay
|
||||
{
|
||||
@@ -91,6 +93,9 @@ class CorpDamageOverlay extends Overlay
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
NPC core = corpPlugin.getCore();
|
||||
if (core != null)
|
||||
{
|
||||
@@ -114,25 +119,14 @@ class CorpDamageOverlay extends Overlay
|
||||
int textWidth = Math.max(ComponentConstants.STANDARD_WIDTH, fontMetrics.stringWidth(text));
|
||||
|
||||
panelComponent.setPreferredSize(new Dimension(textWidth, 0));
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(text)
|
||||
.leftColor(Color.RED)
|
||||
.build());
|
||||
tableComponent.addRow(ColorUtil.prependColorTag(text, Color.RED), "");
|
||||
}
|
||||
}
|
||||
|
||||
if (config.showDamage())
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Your damage")
|
||||
.right(Integer.toString(myDamage))
|
||||
.rightColor(damageForKill > 0 && myDamage >= damageForKill ? Color.GREEN : Color.RED)
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total damage")
|
||||
.right(Integer.toString(totalDamage))
|
||||
.build());
|
||||
tableComponent.addRow("Your damage", ColorUtil.prependColorTag(Integer.toString(myDamage), damageForKill > 0 && myDamage >= damageForKill ? Color.GREEN : Color.RED));
|
||||
tableComponent.addRow("Total damage:", Integer.toString(totalDamage));
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -28,28 +28,27 @@ import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public class VanguardsOverlay extends Overlay
|
||||
{
|
||||
|
||||
private final Client client;
|
||||
private final CoxPlugin plugin;
|
||||
private final CoxConfig config;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
VanguardsOverlay(Client client, CoxPlugin plugin, CoxConfig config)
|
||||
VanguardsOverlay(CoxPlugin plugin, CoxConfig config)
|
||||
{
|
||||
super(plugin);
|
||||
setPosition(OverlayPosition.DYNAMIC);
|
||||
setPosition(OverlayPosition.DETACHED);
|
||||
this.client = client;
|
||||
this.plugin = plugin;
|
||||
this.config = config;
|
||||
}
|
||||
@@ -67,21 +66,19 @@ public class VanguardsOverlay extends Overlay
|
||||
.text("Vanguards")
|
||||
.color(Color.pink)
|
||||
.build());
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Range")
|
||||
.right(Integer.toString(plugin.getRangeVangHP()))
|
||||
.leftColor(Color.green)
|
||||
.build());
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Mage")
|
||||
.right(Integer.toString(plugin.getMageVangHP()))
|
||||
.leftColor(Color.blue)
|
||||
.build());
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Melee")
|
||||
.right(Integer.toString(plugin.getMeleeVangHP()))
|
||||
.leftColor(Color.red)
|
||||
.build());
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Range", Color.GREEN), Integer.toString(plugin.getRangeVangHP()));
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Mage", Color.BLUE), Integer.toString(plugin.getMageVangHP()));
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Melee", Color.RED), Integer.toString(plugin.getMeleeVangHP()));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class CameraOverlay extends Overlay
|
||||
{
|
||||
@@ -59,39 +59,20 @@ public class CameraOverlay extends Overlay
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
|
||||
panelComponent.getChildren().add(TitleComponent.builder()
|
||||
.text("Camera")
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("X")
|
||||
.right("" + client.getCameraX())
|
||||
.build());
|
||||
tableComponent.addRow("X", "" + client.getCameraX());
|
||||
tableComponent.addRow("Y", "" + client.getCameraY());
|
||||
tableComponent.addRow("Z", "" + client.getCameraZ());
|
||||
tableComponent.addRow("Pitch", "" + client.getCameraPitch());
|
||||
tableComponent.addRow("Yaw", "" + client.getCameraYaw());
|
||||
tableComponent.addRow("Scale", "" + client.getScale());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Y")
|
||||
.right("" + client.getCameraY())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Z")
|
||||
.right("" + client.getCameraZ())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pitch")
|
||||
.right("" + client.getCameraPitch())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Yaw")
|
||||
.right("" + client.getCameraYaw())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Scale")
|
||||
.right("" + client.getScale())
|
||||
.build());
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,10 @@ import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public class LocationOverlay extends Overlay
|
||||
{
|
||||
@@ -66,11 +68,12 @@ public class LocationOverlay extends Overlay
|
||||
|
||||
int regionID = localWorld.getRegionID();
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
if (client.isInInstancedRegion())
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Instance")
|
||||
.build());
|
||||
tableComponent.addRow("Instance", "");
|
||||
|
||||
int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks();
|
||||
int z = client.getPlane();
|
||||
@@ -80,41 +83,24 @@ public class LocationOverlay extends Overlay
|
||||
int chunkY = (chunkData >> 3 & 0x7FF) * CHUNK_SIZE;
|
||||
int chunkX = (chunkData >> 14 & 0x3FF) * CHUNK_SIZE;
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Chunk " + localPoint.getSceneX() / CHUNK_SIZE + "," + localPoint.getSceneY() / CHUNK_SIZE)
|
||||
.right(rotation + " " + chunkX + " " + chunkY)
|
||||
.build());
|
||||
tableComponent.addRow("Chunk " + localPoint.getSceneX() / CHUNK_SIZE + "," + localPoint.getSceneY() / CHUNK_SIZE, rotation + " " + chunkX + " " + chunkY);
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Base")
|
||||
.right(client.getBaseX() + ", " + client.getBaseY())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Local")
|
||||
.right(localPoint.getX() + ", " + localPoint.getY())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Scene")
|
||||
.right(localPoint.getSceneX() + ", " + localPoint.getSceneY())
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Tile")
|
||||
.right(localWorld.getX() + ", " + localWorld.getY() + ", " + client.getPlane())
|
||||
.build());
|
||||
tableComponent.addRow("Base", client.getBaseX() + ", " + client.getBaseY());
|
||||
tableComponent.addRow("Local", localPoint.getX() + ", " + localPoint.getY());
|
||||
tableComponent.addRow("Scene", localPoint.getSceneX() + ", " + localPoint.getSceneY());
|
||||
tableComponent.addRow("Tile", localWorld.getX() + ", " + localWorld.getY() + ", " + client.getPlane());
|
||||
|
||||
for (int i = 0; i < client.getMapRegions().length; i++)
|
||||
{
|
||||
int region = client.getMapRegions()[i];
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left((i == 0) ? "Map regions" : " ")
|
||||
.right(String.valueOf(region))
|
||||
.rightColor((region == regionID) ? Color.GREEN : Color.WHITE)
|
||||
.build());
|
||||
tableComponent.addRow((i == 0) ? "Map regions" : " ", ColorUtil.prependColorTag(String.valueOf(region), (region == regionID) ? Color.GREEN : Color.WHITE));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -35,9 +35,9 @@ import javax.inject.Inject;
|
||||
import net.runelite.client.ui.ColorScheme;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class WaveOverlay extends Overlay
|
||||
{
|
||||
@@ -97,25 +97,30 @@ class WaveOverlay extends Overlay
|
||||
.color(HEADER_COLOR)
|
||||
.build());
|
||||
|
||||
for (LineComponent line : buildWaveLines(waveContents))
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
|
||||
for (String line : buildWaveLines(waveContents))
|
||||
{
|
||||
panelComponent.getChildren().add(line);
|
||||
tableComponent.addRow(line);
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
|
||||
private static Collection<LineComponent> buildWaveLines(final Map<WaveMonster, Integer> wave)
|
||||
private static Collection<String> buildWaveLines(final Map<WaveMonster, Integer> wave)
|
||||
{
|
||||
final List<Map.Entry<WaveMonster, Integer>> monsters = new ArrayList<>(wave.entrySet());
|
||||
monsters.sort(Map.Entry.comparingByKey());
|
||||
final List<LineComponent> outputLines = new ArrayList<>();
|
||||
final List<String> outputLines = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<WaveMonster, Integer> monsterEntry : monsters)
|
||||
{
|
||||
final WaveMonster monster = monsterEntry.getKey();
|
||||
final int quantity = monsterEntry.getValue();
|
||||
final LineComponent line = LineComponent.builder()
|
||||
.left(FightCavePlugin.formatMonsterQuantity(monster, quantity))
|
||||
.build();
|
||||
final String line = FightCavePlugin.formatMonsterQuantity(monster, quantity);
|
||||
|
||||
outputLines.add(line);
|
||||
}
|
||||
|
||||
@@ -36,9 +36,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class FishingOverlay extends Overlay
|
||||
{
|
||||
@@ -91,17 +92,19 @@ class FishingOverlay extends Overlay
|
||||
int actions = xpTrackerService.getActions(Skill.FISHING);
|
||||
if (actions > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Caught fish:")
|
||||
.right(Integer.toString(actions))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
tableComponent.addRow("Caught fish:", Integer.toString(actions));
|
||||
|
||||
if (actions > 2)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Fish/hr:")
|
||||
.right(Integer.toString(xpTrackerService.getActionsHr(Skill.FISHING)))
|
||||
.build());
|
||||
tableComponent.addRow("Fish/hr:", Integer.toString(xpTrackerService.getActionsHr(Skill.FISHING)));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,22 +32,14 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_ADAMANT;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BLACK;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BRONZE;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON_ORN;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_INFERNAL;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_IRON;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_MITHRIL;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_RUNE;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_STEEL;
|
||||
import static net.runelite.api.AnimationID.*;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class MiningOverlay extends Overlay
|
||||
{
|
||||
@@ -115,15 +107,16 @@ class MiningOverlay extends Overlay
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pay-dirt mined:")
|
||||
.right(Integer.toString(session.getTotalMined()))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pay-dirt/hr:")
|
||||
.right(session.getRecentMined() > 2 ? Integer.toString(session.getPerHour()) : "")
|
||||
.build());
|
||||
tableComponent.addRow("Pay-dirt mined:", Integer.toString(session.getTotalMined()));
|
||||
tableComponent.addRow("Pay-dirt/hr:", session.getRecentMined() > 2 ? Integer.toString(session.getPerHour()) : "");
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -34,9 +34,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class MotherlodeGemOverlay extends Overlay
|
||||
{
|
||||
@@ -82,36 +83,32 @@ public class MotherlodeGemOverlay extends Overlay
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(TitleComponent.builder().text("Gems found").build());
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
if (diamondsFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Diamonds:")
|
||||
.right(Integer.toString(diamondsFound))
|
||||
.build());
|
||||
tableComponent.addRow("Diamonds:", Integer.toString(diamondsFound));
|
||||
}
|
||||
|
||||
if (rubiesFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Rubies:")
|
||||
.right(Integer.toString(rubiesFound))
|
||||
.build());
|
||||
tableComponent.addRow("Rubies:", Integer.toString(rubiesFound));
|
||||
}
|
||||
|
||||
if (emeraldsFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Emeralds:")
|
||||
.right(Integer.toString(emeraldsFound))
|
||||
.build());
|
||||
tableComponent.addRow("Emeralds:", Integer.toString(emeraldsFound));
|
||||
}
|
||||
|
||||
if (sapphiresFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Sapphires:")
|
||||
.right(Integer.toString(sapphiresFound))
|
||||
.build());
|
||||
tableComponent.addRow("Sapphires:", Integer.toString(sapphiresFound));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -29,9 +29,10 @@ import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class MotherlodeOreOverlay extends Overlay
|
||||
{
|
||||
@@ -76,52 +77,42 @@ public class MotherlodeOreOverlay extends Overlay
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(TitleComponent.builder().text("Ores found").build());
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
if (nuggetsFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Nuggets:")
|
||||
.right(Integer.toString(nuggetsFound))
|
||||
.build());
|
||||
tableComponent.addRow("Nuggets:", Integer.toString(nuggetsFound));
|
||||
}
|
||||
|
||||
if (coalFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Coal:")
|
||||
.right(Integer.toString(coalFound))
|
||||
.build());
|
||||
tableComponent.addRow("Coal:", Integer.toString(coalFound));
|
||||
}
|
||||
|
||||
if (goldFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Gold:")
|
||||
.right(Integer.toString(goldFound))
|
||||
.build());
|
||||
tableComponent.addRow("Gold:", Integer.toString(goldFound));
|
||||
}
|
||||
|
||||
if (mithrilFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Mithril:")
|
||||
.right(Integer.toString(mithrilFound))
|
||||
.build());
|
||||
tableComponent.addRow("Mithril:", Integer.toString(mithrilFound));
|
||||
}
|
||||
|
||||
if (adamantiteFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Adamantite:")
|
||||
.right(Integer.toString(adamantiteFound))
|
||||
.build());
|
||||
tableComponent.addRow("Adamantite:", Integer.toString(adamantiteFound));
|
||||
}
|
||||
|
||||
if (runiteFound > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Runite:")
|
||||
.right(Integer.toString(runiteFound))
|
||||
.build());
|
||||
tableComponent.addRow("Runite:", Integer.toString(runiteFound));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
|
||||
@@ -32,22 +32,14 @@ import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_ADAMANT;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BLACK;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_BRONZE;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_DRAGON_ORN;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_INFERNAL;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_IRON;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_MITHRIL;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_RUNE;
|
||||
import static net.runelite.api.AnimationID.MINING_MOTHERLODE_STEEL;
|
||||
import static net.runelite.api.AnimationID.*;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class MotherlodeOverlay extends Overlay
|
||||
{
|
||||
@@ -118,15 +110,16 @@ class MotherlodeOverlay extends Overlay
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pay-dirt mined:")
|
||||
.right(Integer.toString(session.getTotalMined()))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pay-dirt/hr:")
|
||||
.right(session.getRecentMined() > 2 ? Integer.toString(session.getPerHour()) : "")
|
||||
.build());
|
||||
tableComponent.addRow("Pay-dirt mined:", Integer.toString(session.getTotalMined()));
|
||||
tableComponent.addRow("Pay-dirt/hr:", session.getRecentMined() > 2 ? Integer.toString(session.getPerHour()) : "");
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,10 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
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;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
class MotherlodeSackOverlay extends Overlay
|
||||
{
|
||||
@@ -76,6 +78,9 @@ class MotherlodeSackOverlay extends Overlay
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR);
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
if (sack != null)
|
||||
{
|
||||
sack.setHidden(true);
|
||||
@@ -87,10 +92,7 @@ class MotherlodeSackOverlay extends Overlay
|
||||
panelComponent.setBackgroundColor(DANGER);
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Pay-dirt in sack:")
|
||||
.right(String.valueOf(client.getVar(Varbits.SACK_NUMBER)))
|
||||
.build());
|
||||
tableComponent.addRow("Pay-dirt in sack:", String.valueOf(client.getVar(Varbits.SACK_NUMBER)));
|
||||
}
|
||||
|
||||
if (config.showDepositsLeft())
|
||||
@@ -110,15 +112,15 @@ class MotherlodeSackOverlay extends Overlay
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Deposits left:")
|
||||
.leftColor(color)
|
||||
.right(depositsLeft == null ? "N/A" : String.valueOf(depositsLeft))
|
||||
.rightColor(color)
|
||||
.build());
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Deposits left:", color), ColorUtil.prependColorTag(depositsLeft == null ? "N/A" : String.valueOf(depositsLeft), color));
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemID;
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -39,8 +40,9 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
|
||||
@@ -102,10 +104,10 @@ class NightmareZoneOverlay extends Overlay
|
||||
renderAbsorptionCounter();
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Points: ")
|
||||
.right(StackFormatter.formatNumber(client.getVar(Varbits.NMZ_POINTS)))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
tableComponent.addRow("Points:", StackFormatter.formatNumber(client.getVar(Varbits.NMZ_POINTS)));
|
||||
tableComponent.addRow("Total:", StackFormatter.formatNumber(client.getVar(VarPlayer.NMZ_REWARD_POINTS) + client.getVar(Varbits.NMZ_POINTS)));
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -40,9 +40,11 @@ import net.runelite.client.ui.overlay.OverlayLayer;
|
||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.util.Text;
|
||||
import net.runelite.http.api.hiscore.HiscoreResult;
|
||||
import net.runelite.http.api.hiscore.HiscoreSkill;
|
||||
@@ -74,8 +76,9 @@ class PlayerComparisonOverlay extends Overlay
|
||||
HiscoreSkill.PRAYER
|
||||
};
|
||||
|
||||
private static final String LEFT_COLUMN_HEADER = "Skill";
|
||||
private static final String RIGHT_COLUMN_HEADER = "You/Them";
|
||||
private static final String SKILL_COLUMN_HEADER = "Skill";
|
||||
private static final String PLAYER_COLUMN_HEADER = "You";
|
||||
private static final String OPPONENT_COLUMN_HEADER = "Them";
|
||||
|
||||
private final Client client;
|
||||
private final OpponentInfoPlugin opponentInfoPlugin;
|
||||
@@ -140,13 +143,12 @@ class PlayerComparisonOverlay extends Overlay
|
||||
.color(HIGHLIGHT_COLOR)
|
||||
.build());
|
||||
|
||||
panelComponent.getChildren().add(
|
||||
LineComponent.builder()
|
||||
.left(LEFT_COLUMN_HEADER)
|
||||
.leftColor(HIGHLIGHT_COLOR)
|
||||
.right(RIGHT_COLUMN_HEADER)
|
||||
.rightColor(HIGHLIGHT_COLOR)
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.CENTER, TableAlignment.RIGHT);
|
||||
tableComponent.addRow(
|
||||
ColorUtil.prependColorTag(SKILL_COLUMN_HEADER, HIGHLIGHT_COLOR),
|
||||
ColorUtil.prependColorTag(PLAYER_COLUMN_HEADER, HIGHLIGHT_COLOR),
|
||||
ColorUtil.prependColorTag(OPPONENT_COLUMN_HEADER, HIGHLIGHT_COLOR));
|
||||
|
||||
for (int i = 0; i < COMBAT_SKILLS.length; ++i)
|
||||
{
|
||||
@@ -163,12 +165,15 @@ class PlayerComparisonOverlay extends Overlay
|
||||
final int playerSkillLevel = client.getRealSkillLevel(skill);
|
||||
final int opponentSkillLevel = opponentSkill.getLevel();
|
||||
|
||||
panelComponent.getChildren().add(
|
||||
LineComponent.builder()
|
||||
.left(hiscoreSkill.getName())
|
||||
.right(playerSkillLevel + "/" + opponentSkillLevel)
|
||||
.rightColor(comparisonStatColor(playerSkillLevel, opponentSkillLevel))
|
||||
.build());
|
||||
tableComponent.addRow(
|
||||
hiscoreSkill.getName(),
|
||||
ColorUtil.prependColorTag(Integer.toString(playerSkillLevel), comparisonStatColor(playerSkillLevel, opponentSkillLevel)),
|
||||
ColorUtil.prependColorTag(Integer.toString(opponentSkillLevel), comparisonStatColor(opponentSkillLevel, playerSkillLevel)));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,9 +51,11 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.ComponentOrientation;
|
||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@@ -245,6 +247,10 @@ public class RaidsOverlay extends Overlay
|
||||
.text(displayLayout)
|
||||
.color(color)
|
||||
.build());
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
color = Color.ORANGE;
|
||||
if (sharable || config.alwaysShowWorldAndCC())
|
||||
{
|
||||
@@ -254,12 +260,8 @@ public class RaidsOverlay extends Overlay
|
||||
clanOwner = "Open CC tab...";
|
||||
color = Color.RED;
|
||||
}
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("W" + client.getWorld())
|
||||
.right("" + clanOwner)
|
||||
.leftColor(Color.ORANGE)
|
||||
.rightColor(color)
|
||||
.build());
|
||||
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("W" + client.getWorld(), Color.ORANGE), ColorUtil.prependColorTag("" + clanOwner, color));
|
||||
}
|
||||
|
||||
int bossMatches = 0;
|
||||
@@ -308,11 +310,7 @@ public class RaidsOverlay extends Overlay
|
||||
}
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(config.showRecommendedItems() ? "" : room.getType().getName())
|
||||
.right(bossName)
|
||||
.rightColor(color)
|
||||
.build());
|
||||
tableComponent.addRow(config.showRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(bossName, color));
|
||||
|
||||
break;
|
||||
|
||||
@@ -336,52 +334,38 @@ public class RaidsOverlay extends Overlay
|
||||
color = config.tightropeColor();
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(config.showRecommendedItems() ? "" : room.getType().getName())
|
||||
.right(puzzleName)
|
||||
.rightColor(color)
|
||||
.build());
|
||||
tableComponent.addRow(config.showRecommendedItems() ? "" : room.getType().getName(), ColorUtil.prependColorTag(puzzleName, color));
|
||||
|
||||
break;
|
||||
case FARMING:
|
||||
if (config.showScavsFarms())
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("")
|
||||
.right(room.getType().getName())
|
||||
.rightColor(new Color(181, 230, 29)) //yellow green
|
||||
.build());
|
||||
tableComponent.addRow("", ColorUtil.prependColorTag(room.getType().getName(), new Color(181, 230, 29)));
|
||||
}
|
||||
break;
|
||||
case SCAVENGERS:
|
||||
if (config.scavsBeforeOlm() && roomCount == lastScavs)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(config.showRecommendedItems() ? "" : "OlmPrep")
|
||||
.right("Scavs")
|
||||
.rightColor(config.scavPrepColor())
|
||||
.build());
|
||||
tableComponent.addRow(config.showRecommendedItems() ? "" : "OlmPrep", ColorUtil.prependColorTag("Scavs", config.scavPrepColor()));
|
||||
}
|
||||
else if (config.scavsBeforeIce() && scavsBeforeIceRooms.contains(roomCount))
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left(config.showRecommendedItems() ? "" : "IcePrep")
|
||||
.right("Scavs")
|
||||
.rightColor(config.scavPrepColor())
|
||||
.build());
|
||||
tableComponent.addRow(config.showRecommendedItems() ? "" : "IcePrep", ColorUtil.prependColorTag("Scavs", config.scavPrepColor()));
|
||||
}
|
||||
else if (config.showScavsFarms())
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("")
|
||||
.right("Scavs")
|
||||
.rightColor(new Color(181, 230, 29)) //yellow green
|
||||
.build());
|
||||
tableComponent.addRow("", ColorUtil.prependColorTag("Scavs", new Color(181, 230, 29)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
roomCount++;
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
Dimension panelDims = panelComponent.render(graphics);
|
||||
width = (int) panelDims.getWidth();
|
||||
height = (int) panelDims.getHeight();
|
||||
|
||||
@@ -38,8 +38,9 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
|
||||
public class RaidsPointsOverlay extends Overlay
|
||||
{
|
||||
@@ -82,29 +83,19 @@ public class RaidsPointsOverlay extends Overlay
|
||||
double uniqueChance = totalPoints / 867500f;
|
||||
|
||||
panel.getChildren().clear();
|
||||
panel.getChildren().add(LineComponent.builder()
|
||||
.left("Total:")
|
||||
.right(POINTS_FORMAT.format(totalPoints))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
panel.getChildren().add(LineComponent.builder()
|
||||
.left(client.getLocalPlayer().getName() + ":")
|
||||
.right(POINTS_FORMAT.format(personalPoints))
|
||||
.build());
|
||||
tableComponent.addRow("Total:", POINTS_FORMAT.format(totalPoints));
|
||||
tableComponent.addRow(client.getLocalPlayer().getName() + ":", POINTS_FORMAT.format(personalPoints));
|
||||
|
||||
|
||||
if (partySize > 1)
|
||||
{
|
||||
panel.getChildren().add(LineComponent.builder()
|
||||
.left("Party size:")
|
||||
.right(String.valueOf(partySize))
|
||||
.build());
|
||||
tableComponent.addRow("Party size:", String.valueOf(partySize));
|
||||
}
|
||||
|
||||
panel.getChildren().add(LineComponent.builder()
|
||||
.left("Unique:")
|
||||
.right(UNIQUE_FORMAT.format(uniqueChance))
|
||||
.build());
|
||||
tableComponent.addRow("Unique:", UNIQUE_FORMAT.format(uniqueChance));
|
||||
//TODO this is annoyingly bugged, personalpoints returns null for some reason
|
||||
/*
|
||||
if (partySize > 1)
|
||||
@@ -117,6 +108,11 @@ public class RaidsPointsOverlay extends Overlay
|
||||
.build());
|
||||
}*/
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panel.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panel.render(graphics);
|
||||
}
|
||||
}
|
||||
@@ -40,9 +40,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class SmeltingOverlay extends Overlay
|
||||
{
|
||||
@@ -94,26 +95,25 @@ class SmeltingOverlay extends Overlay
|
||||
int actions = xpTrackerService.getActions(Skill.SMITHING);
|
||||
if (actions > 0)
|
||||
{
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
if (plugin.getSession().getBarsSmelted() > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Bars:")
|
||||
.right(Integer.toString(session.getBarsSmelted()))
|
||||
.build());
|
||||
tableComponent.addRow("Bars:", Integer.toString(session.getBarsSmelted()));
|
||||
}
|
||||
if (plugin.getSession().getCannonBallsSmelted() > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Cannonballs:")
|
||||
.right(Integer.toString(session.getCannonBallsSmelted()))
|
||||
.build());
|
||||
tableComponent.addRow("Cannonballs:", Integer.toString(session.getCannonBallsSmelted()));
|
||||
}
|
||||
if (actions > 2)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Actions/hr:")
|
||||
.right(Integer.toString(xpTrackerService.getActionsHr(Skill.SMITHING)))
|
||||
.build());
|
||||
tableComponent.addRow("Actions/hr:", Integer.toString(xpTrackerService.getActionsHr(Skill.SMITHING)));
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,22 +24,23 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.theatre.rooms.nylocas;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.client.plugins.theatre.TheatreConfig;
|
||||
import net.runelite.client.plugins.theatre.TheatrePlugin;
|
||||
import net.runelite.client.plugins.theatre.TheatreRoom;
|
||||
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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
class NyloOverlay extends Overlay
|
||||
{
|
||||
@@ -100,25 +101,18 @@ class NyloOverlay extends Overlay
|
||||
}
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
|
||||
int nyloCount = (hagios + toxobolos + ischyros);
|
||||
if (nylohandler.getWave() < 21)
|
||||
{
|
||||
if (nyloCount > 12)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total Nylocas:")
|
||||
.right(nyloCount + " / 12" )
|
||||
.rightColor(Color.RED)
|
||||
.build());
|
||||
tableComponent.addRow("Total Nylocas:", ColorUtil.prependColorTag(nyloCount + " / 12", Color.RED));
|
||||
}
|
||||
else
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total Nylocas:")
|
||||
.right(nyloCount + " / 12" )
|
||||
.rightColor(Color.GREEN)
|
||||
.build());
|
||||
|
||||
tableComponent.addRow("Total Nylocas:", ColorUtil.prependColorTag(nyloCount + " / 12", Color.GREEN));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -126,22 +120,19 @@ class NyloOverlay extends Overlay
|
||||
{
|
||||
if (nyloCount > 24)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total Nylocas:")
|
||||
.right(nyloCount + " / 24" )
|
||||
.rightColor(Color.RED)
|
||||
.build());
|
||||
tableComponent.addRow("Total Nylocas:", ColorUtil.prependColorTag(nyloCount + " / 24", Color.RED));
|
||||
}
|
||||
else
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Total Nylocas:")
|
||||
.right(nyloCount + " / 24" )
|
||||
.rightColor(Color.GREEN)
|
||||
.build());
|
||||
tableComponent.addRow("Total Nylocas:", ColorUtil.prependColorTag(nyloCount + " / 24", Color.GREEN));
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package net.runelite.client.plugins.theatre.rooms.xarpus;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.client.plugins.theatre.TheatreConfig;
|
||||
import net.runelite.client.plugins.theatre.TheatrePlugin;
|
||||
import net.runelite.client.ui.overlay.*;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import java.awt.*;
|
||||
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class XarpusCounter extends Overlay
|
||||
{
|
||||
@@ -56,10 +59,13 @@ public class XarpusCounter extends Overlay
|
||||
graphics.getFontMetrics().stringWidth(overlayTitle) + 30, 0
|
||||
));
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Exhumes: ")
|
||||
.right(String.valueOf(xarpusHandler.getExhumesCount()))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.addRow("Exhumes", String.valueOf(xarpusHandler.getExhumesCount()));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -31,17 +31,18 @@ import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.text.DecimalFormat;
|
||||
import javax.inject.Inject;
|
||||
import static net.runelite.api.AnimationID.THIEVING_STALL;
|
||||
import static net.runelite.api.AnimationID.PICKPOCKET_SUCCESS;
|
||||
import static net.runelite.api.AnimationID.BLOCK_UNARMED;
|
||||
import static net.runelite.api.AnimationID.PICKPOCKET_SUCCESS;
|
||||
import static net.runelite.api.AnimationID.THIEVING_STALL;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerService;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
public class ThievingOverlay extends Overlay
|
||||
{
|
||||
@@ -95,15 +96,16 @@ public class ThievingOverlay extends Overlay
|
||||
.build());
|
||||
}
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Succeeded:")
|
||||
.right(session.getSuccessful() + (session.getSuccessful() >= 1 ? " (" + xpTrackerService.getActionsHr(Skill.THIEVING) + "/hr)" : ""))
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Failed:")
|
||||
.right(session.getFailed() + (session.getFailed() >= 1 ? " (" + FORMAT.format(session.getSuccessRate()) + "%)" : ""))
|
||||
.build());
|
||||
tableComponent.addRow("Succeeded:", session.getSuccessful() + (session.getSuccessful() >= 1 ? " (" + xpTrackerService.getActionsHr(Skill.THIEVING) + "/hr)" : ""));
|
||||
tableComponent.addRow("Failed:", session.getFailed() + (session.getFailed() >= 1 ? " (" + FORMAT.format(session.getSuccessRate()) + "%)" : ""));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -40,4 +40,4 @@ enum WintertodtActivity
|
||||
LIGHTING_BRAZIER("Lighting");
|
||||
|
||||
private final String actionString;
|
||||
}
|
||||
}
|
||||
@@ -42,4 +42,4 @@ enum WintertodtInterruptType
|
||||
BRAZIER_WENT_OUT("Brazier went out");
|
||||
|
||||
private final String interruptSourceString;
|
||||
}
|
||||
}
|
||||
@@ -29,17 +29,26 @@ import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.Skill;
|
||||
import static net.runelite.client.plugins.wintertodt.WintertodtPlugin.WINTERTODT_KINDLING_MULTIPLIER;
|
||||
import static net.runelite.client.plugins.wintertodt.WintertodtPlugin.WINTERTODT_ROOTS_MULTIPLIER;
|
||||
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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
class WintertodtOverlay extends Overlay
|
||||
{
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
private final WintertodtPlugin plugin;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
|
||||
@@ -61,28 +70,35 @@ class WintertodtOverlay extends Overlay
|
||||
}
|
||||
|
||||
panelComponent.getChildren().clear();
|
||||
panelComponent.setPreferredSize(new Dimension(150, 0));
|
||||
panelComponent.setPreferredSize(new Dimension(180, 0));
|
||||
|
||||
panelComponent.getChildren().add(TitleComponent.builder()
|
||||
.text(plugin.getCurrentActivity().getActionString())
|
||||
.color(plugin.getCurrentActivity() == WintertodtActivity.IDLE ? Color.RED : Color.GREEN)
|
||||
.text("Points in inventory")
|
||||
.color(Color.WHITE)
|
||||
.build());
|
||||
|
||||
String inventoryString = plugin.getNumLogs() > 0 ? plugin.getInventoryScore() + " (" + plugin.getTotalPotentialinventoryScore() + ") pts" : plugin.getInventoryScore() + " pts";
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Inventory:")
|
||||
.leftColor(Color.WHITE)
|
||||
.right(inventoryString)
|
||||
.rightColor(plugin.getInventoryScore() > 0 ? Color.GREEN : Color.RED)
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
String kindlingString = plugin.getNumLogs() > 0 ? plugin.getNumKindling() + " (" + (plugin.getNumLogs() + plugin.getNumKindling()) + ")" : Integer.toString(plugin.getNumKindling());
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Kindling:")
|
||||
.leftColor(Color.WHITE)
|
||||
.right(kindlingString)
|
||||
.rightColor(plugin.getNumKindling() + plugin.getNumLogs() > 0 ? Color.GREEN : Color.RED)
|
||||
.build());
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Status:", Color.WHITE), ColorUtil.prependColorTag(plugin.getCurrentActivity().getActionString(), plugin.getCurrentActivity() == WintertodtActivity.IDLE ? Color.RED : Color.GREEN));
|
||||
|
||||
int firemakingLvl = client.getRealSkillLevel(Skill.FIREMAKING);
|
||||
|
||||
int rootsScore = plugin.getNumRoots() * WINTERTODT_ROOTS_MULTIPLIER;
|
||||
int rootsXp = plugin.getNumRoots() * Math.round(2 + (3 * firemakingLvl));
|
||||
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Roots:", Color.WHITE), ColorUtil.prependColorTag(rootsScore + " pts (" + rootsXp + " xp)", plugin.getNumRoots() > 0 ? Color.GREEN : Color.RED));
|
||||
|
||||
int kindlingScore = plugin.getNumKindling() * WINTERTODT_KINDLING_MULTIPLIER;
|
||||
long kindlingXp = plugin.getNumKindling() * Math.round(3.8 * firemakingLvl);
|
||||
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Kindling:", Color.WHITE), ColorUtil.prependColorTag(kindlingScore + " pts (" + kindlingXp + " xp)", plugin.getNumKindling() > 0 ? Color.GREEN : Color.RED));
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Total:", Color.WHITE), ColorUtil.prependColorTag((rootsScore + kindlingScore) + " pts (" + (rootsXp + kindlingXp) + " xp)", (rootsScore + kindlingScore > 0) ? Color.GREEN : Color.RED));
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
@@ -32,21 +32,7 @@ import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import static net.runelite.api.AnimationID.CONSTRUCTION;
|
||||
import static net.runelite.api.AnimationID.FIREMAKING;
|
||||
import static net.runelite.api.AnimationID.FLETCHING_BOW_CUTTING;
|
||||
import static net.runelite.api.AnimationID.IDLE;
|
||||
import static net.runelite.api.AnimationID.LOOKING_INTO;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_3A_AXE;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_ADAMANT;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_BLACK;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_BRONZE;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_DRAGON;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_INFERNAL;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_IRON;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_MITHRIL;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_RUNE;
|
||||
import static net.runelite.api.AnimationID.WOODCUTTING_STEEL;
|
||||
import static net.runelite.api.AnimationID.*;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.InventoryID;
|
||||
@@ -79,6 +65,9 @@ public class WintertodtPlugin extends Plugin
|
||||
{
|
||||
private static final int WINTERTODT_REGION = 6462;
|
||||
|
||||
static final int WINTERTODT_ROOTS_MULTIPLIER = 10;
|
||||
static final int WINTERTODT_KINDLING_MULTIPLIER = 25;
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@@ -101,13 +90,7 @@ public class WintertodtPlugin extends Plugin
|
||||
private WintertodtActivity currentActivity = WintertodtActivity.IDLE;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int inventoryScore;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int totalPotentialinventoryScore;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int numLogs;
|
||||
private int numRoots;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int numKindling;
|
||||
@@ -139,9 +122,7 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
private void reset()
|
||||
{
|
||||
inventoryScore = 0;
|
||||
totalPotentialinventoryScore = 0;
|
||||
numLogs = 0;
|
||||
numRoots = 0;
|
||||
numKindling = 0;
|
||||
currentActivity = WintertodtActivity.IDLE;
|
||||
lastActionTime = null;
|
||||
@@ -410,20 +391,15 @@ public class WintertodtPlugin extends Plugin
|
||||
|
||||
final Item[] inv = container.getItems();
|
||||
|
||||
inventoryScore = 0;
|
||||
totalPotentialinventoryScore = 0;
|
||||
numLogs = 0;
|
||||
numRoots = 0;
|
||||
numKindling = 0;
|
||||
|
||||
for (Item item : inv)
|
||||
{
|
||||
inventoryScore += getPoints(item.getId());
|
||||
totalPotentialinventoryScore += getPotentialPoints(item.getId());
|
||||
|
||||
switch (item.getId())
|
||||
{
|
||||
case BRUMA_ROOT:
|
||||
++numLogs;
|
||||
++numRoots;
|
||||
break;
|
||||
case BRUMA_KINDLING:
|
||||
++numKindling;
|
||||
@@ -431,13 +407,13 @@ public class WintertodtPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
//If we're currently fletching but there are no more logs, go ahead and abort fletching immediately
|
||||
if (numLogs == 0 && currentActivity == WintertodtActivity.FLETCHING)
|
||||
//If we're currently fletching but there are no more roots, go ahead and abort fletching immediately
|
||||
if (numRoots == 0 && currentActivity == WintertodtActivity.FLETCHING)
|
||||
{
|
||||
currentActivity = WintertodtActivity.IDLE;
|
||||
}
|
||||
//Otherwise, if we're currently feeding the brazier but we've run out of both logs and kindling, abort the feeding activity
|
||||
else if (numLogs == 0 && numKindling == 0 && currentActivity == WintertodtActivity.FEEDING_BRAZIER)
|
||||
//Otherwise, if we're currently feeding the brazier but we've run out of both roots and kindling, abort the feeding activity
|
||||
else if (numRoots == 0 && numKindling == 0 && currentActivity == WintertodtActivity.FEEDING_BRAZIER)
|
||||
{
|
||||
currentActivity = WintertodtActivity.IDLE;
|
||||
}
|
||||
@@ -448,29 +424,4 @@ public class WintertodtPlugin extends Plugin
|
||||
currentActivity = action;
|
||||
lastActionTime = Instant.now();
|
||||
}
|
||||
|
||||
private static int getPoints(int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case BRUMA_ROOT:
|
||||
return 10;
|
||||
case BRUMA_KINDLING:
|
||||
return 25;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static int getPotentialPoints(int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case BRUMA_ROOT:
|
||||
case BRUMA_KINDLING:
|
||||
return 25;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,9 +36,10 @@ 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.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||
import net.runelite.client.ui.overlay.components.table.TableAlignment;
|
||||
import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
|
||||
class WoodcuttingOverlay extends Overlay
|
||||
{
|
||||
@@ -92,23 +93,25 @@ class WoodcuttingOverlay extends Overlay
|
||||
.build());
|
||||
}
|
||||
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
int actions = xpTrackerService.getActions(Skill.WOODCUTTING);
|
||||
if (actions > 0)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Logs cut:")
|
||||
.right(Integer.toString(actions))
|
||||
.build());
|
||||
tableComponent.addRow("Logs cut:", Integer.toString(actions));
|
||||
|
||||
if (actions > 2)
|
||||
{
|
||||
panelComponent.getChildren().add(LineComponent.builder()
|
||||
.left("Logs/hr:")
|
||||
.right(Integer.toString(xpTrackerService.getActionsHr(Skill.WOODCUTTING)))
|
||||
.build());
|
||||
tableComponent.addRow("Logs/hr:", Integer.toString(xpTrackerService.getActionsHr(Skill.WOODCUTTING)));
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
panelComponent.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
return panelComponent.render(graphics);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,10 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||
import net.runelite.client.ui.overlay.components.LineComponent;
|
||||
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;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
|
||||
public class XpGlobesOverlay extends Overlay
|
||||
{
|
||||
@@ -248,16 +250,11 @@ public class XpGlobesOverlay extends Overlay
|
||||
xpTooltip.setPreferredLocation(new java.awt.Point(x, y));
|
||||
xpTooltip.setPreferredSize(new Dimension(TOOLTIP_RECT_SIZE_X, 0));
|
||||
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left(skillName)
|
||||
.right(skillLevel)
|
||||
.build());
|
||||
TableComponent tableComponent = new TableComponent();
|
||||
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
|
||||
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left("Current XP:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(skillCurrentXp)
|
||||
.build());
|
||||
tableComponent.addRow(skillName, skillLevel);
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("Current XP:", Color.ORANGE), skillCurrentXp);
|
||||
|
||||
if (goalXp > mouseOverSkill.getCurrentXp())
|
||||
{
|
||||
@@ -267,41 +264,25 @@ public class XpGlobesOverlay extends Overlay
|
||||
if (actionsLeft != Integer.MAX_VALUE)
|
||||
{
|
||||
String actionsLeftString = decimalFormat.format(actionsLeft);
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left(xpActionType.getLabel() + " left:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(actionsLeftString)
|
||||
.build());
|
||||
|
||||
tableComponent.addRow(ColorUtil.prependColorTag(xpActionType.getLabel() + " left:", Color.ORANGE), actionsLeftString);
|
||||
}
|
||||
|
||||
int xpLeft = goalXp - mouseOverSkill.getCurrentXp();
|
||||
String skillXpToLvl = decimalFormat.format(xpLeft);
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left("XP left:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(skillXpToLvl)
|
||||
.build());
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("XP left:", Color.ORANGE), skillXpToLvl);
|
||||
|
||||
int xpHr = xpTrackerService.getXpHr(mouseOverSkill.getSkill());
|
||||
if (xpHr != 0)
|
||||
{
|
||||
String xpHrString = decimalFormat.format(xpHr);
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left("XP per hour:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(xpHrString)
|
||||
.build());
|
||||
tableComponent.addRow(ColorUtil.prependColorTag("XP per hour:", Color.ORANGE), xpHrString);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.enableTimeToLevel())
|
||||
{
|
||||
String timeLeft = xpTrackerService.getTimeTillGoal(mouseOverSkill.getSkill());
|
||||
xpTooltip.getChildren().add(LineComponent.builder()
|
||||
.left("Time left:")
|
||||
.leftColor(Color.ORANGE)
|
||||
.right(timeLeft)
|
||||
.build());
|
||||
}
|
||||
if (!tableComponent.isEmpty())
|
||||
{
|
||||
xpTooltip.getChildren().add(tableComponent);
|
||||
}
|
||||
|
||||
xpTooltip.render(graphics);
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2019, TheStonedTurtle <https://github.com/TheStonedTurtle>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
* Copyright (c) 2019, TheStonedTurtle <https://github.com/TheStonedTurtle>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.runelite.client.ui.overlay.components.table;
|
||||
|
||||
public enum TableAlignment
|
||||
|
||||
@@ -290,6 +290,19 @@ public class TableComponent implements LayoutableRenderableEntity
|
||||
return wrapped.toString().split("\n");
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return columns.size() == 0 || rows.size() == 0;
|
||||
}
|
||||
|
||||
private void ensureColumnSize(final int size)
|
||||
{
|
||||
while (size > columns.size())
|
||||
{
|
||||
columns.add(TableElement.builder().build());
|
||||
}
|
||||
}
|
||||
|
||||
private static int getAlignedPosition(final String str, final TableAlignment alignment, final int columnWidth, final FontMetrics metrics)
|
||||
{
|
||||
final int stringWidth = getTextWidth(metrics, str);
|
||||
@@ -328,6 +341,21 @@ public class TableComponent implements LayoutableRenderableEntity
|
||||
defaultColor);
|
||||
}
|
||||
|
||||
public void setColumnAlignment(final int col, final TableAlignment alignment)
|
||||
{
|
||||
assert columns.size() > col;
|
||||
columns.get(col).setAlignment(alignment);
|
||||
}
|
||||
|
||||
public void setColumnAlignments(@Nonnull final TableAlignment... alignments)
|
||||
{
|
||||
ensureColumnSize(alignments.length);
|
||||
for (int i = 0; i < alignments.length; i++)
|
||||
{
|
||||
setColumnAlignment(i, alignments[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the alignment for the specified table element.
|
||||
* Priority order: cell->row->column->default
|
||||
@@ -430,9 +458,4 @@ public class TableComponent implements LayoutableRenderableEntity
|
||||
addColumn(col);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return columns.size() == 0 || rows.size() == 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
package net.runelite.client.ui.overlay.components.table;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -37,5 +36,5 @@ public class TableRow
|
||||
Color rowColor;
|
||||
TableAlignment rowAlignment;
|
||||
@Builder.Default
|
||||
List<TableElement> elements = new ArrayList<>();
|
||||
List<TableElement> elements;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user