aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/me/Danker/gui')
-rw-r--r--src/main/java/me/Danker/gui/DankerGui.java43
-rw-r--r--src/main/java/me/Danker/gui/EditLocationsGui.java16
-rw-r--r--src/main/java/me/Danker/gui/SkillTrackerGui.java99
3 files changed, 139 insertions, 19 deletions
diff --git a/src/main/java/me/Danker/gui/DankerGui.java b/src/main/java/me/Danker/gui/DankerGui.java
index 73db9f0..205dc8b 100644
--- a/src/main/java/me/Danker/gui/DankerGui.java
+++ b/src/main/java/me/Danker/gui/DankerGui.java
@@ -27,6 +27,7 @@ public class DankerGui extends GuiScreen {
private GuiButton changeDisplay;
private GuiButton onlySlayer;
private GuiButton puzzleSolvers;
+ private GuiButton skillTracker;
// Toggles
private GuiButton gparty;
private GuiButton coords;
@@ -78,44 +79,45 @@ public class DankerGui extends GuiScreen {
changeDisplay = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Change Display Settings");
onlySlayer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Set Slayer Quest");
puzzleSolvers = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Toggle Dungeons Puzzle Solvers");
- outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled));
- splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing));
- dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled));
+ skillTracker = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Toggle Skill XP/Hour Tracking");
+ outlineText = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Outline Displayed Text: " + Utils.getColouredBoolean(ToggleCommand.outlineTextToggled));
+ splitFishing = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Split Fishing Display: " + Utils.getColouredBoolean(ToggleCommand.splitFishing));
coords = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Coordinate/Angle Display: " + Utils.getColouredBoolean(ToggleCommand.coordsToggled));
// Page 2
- cakeTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled));
- skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled));
- gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled));
+ dungeonTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Display Dungeon Timers: " + Utils.getColouredBoolean(ToggleCommand.dungeonTimerToggled));
+ cakeTimer = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Cake Timer: " + Utils.getColouredBoolean(ToggleCommand.cakeTimerToggled));
+ skill50Display = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Display Progress To Skill Level 50: " + Utils.getColouredBoolean(ToggleCommand.skill50DisplayToggled));
slayerCount = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Count Total 20% Drops: " + Utils.getColouredBoolean(ToggleCommand.slayerCountTotal));
chatMaddox = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Click On-Screen to Open Maddox: " + Utils.getColouredBoolean(ToggleCommand.chatMaddoxToggled));
aotd = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Disable AOTD Ability: " + Utils.getColouredBoolean(ToggleCommand.aotdToggled));
lividDagger = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Disable Livid Dagger Ability: " + Utils.getColouredBoolean(ToggleCommand.lividDaggerToggled));
// Page 3
- spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts));
- sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages));
- midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages));
- healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages));
- goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled));
- petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled));
- expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled));
+ gparty = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Guild Party Notifications: " + Utils.getColouredBoolean(ToggleCommand.gpartyToggled));
+ spiritBearAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Spirit Bear Spawn Alerts: " + Utils.getColouredBoolean(ToggleCommand.spiritBearAlerts));
+ sceptreMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Spirit Sceptre Messages: " + Utils.getColouredBoolean(ToggleCommand.sceptreMessages));
+ midasStaffMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "Midas Staff Messages: " + Utils.getColouredBoolean(ToggleCommand.midasStaffMessages));
+ healMessages = new GuiButton(0, width / 2 - 100, (int) (height * 0.5), "Heal Messages: " + Utils.getColouredBoolean(ToggleCommand.healMessages));
+ goldenEnch = new GuiButton(0, width / 2 - 100, (int) (height * 0.6), "Golden T10/T6/T4 Enchantments: " + Utils.getColouredBoolean(ToggleCommand.goldenToggled));
+ petColours = new GuiButton(0, width / 2 - 100, (int) (height * 0.7), "Colour Pet Backgrounds: " + Utils.getColouredBoolean(ToggleCommand.petColoursToggled));
// Page 4
- lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled));
- golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled));
- rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts));
+ expertiseLore = new GuiButton(0, width / 2 - 100, (int) (height * 0.1), "Expertise Kills In Lore: " + Utils.getColouredBoolean(ToggleCommand.expertiseLoreToggled));
+ lividSolver = new GuiButton(0, width / 2 - 100, (int) (height * 0.2), "Find Correct Livid: " + Utils.getColouredBoolean(ToggleCommand.lividSolverToggled));
+ golemAlerts = new GuiButton(0, width / 2 - 100, (int) (height * 0.3), "Alert When Golem Spawns: " + Utils.getColouredBoolean(ToggleCommand.golemAlertToggled));
+ rngesusAlert = new GuiButton(0, width / 2 - 100, (int) (height * 0.4), "RNGesus Alerts: " + Utils.getColouredBoolean(ToggleCommand.rngesusAlerts));
if (page == 1) {
this.buttonList.add(changeDisplay);
this.buttonList.add(onlySlayer);
this.buttonList.add(puzzleSolvers);
+ this.buttonList.add(skillTracker);
this.buttonList.add(outlineText);
this.buttonList.add(splitFishing);
- this.buttonList.add(dungeonTimer);
this.buttonList.add(coords);
this.buttonList.add(nextPage);
} else if (page == 2) {
+ this.buttonList.add(dungeonTimer);
this.buttonList.add(cakeTimer);
this.buttonList.add(skill50Display);
- this.buttonList.add(gparty);
this.buttonList.add(slayerCount);
this.buttonList.add(chatMaddox);
this.buttonList.add(aotd);
@@ -123,16 +125,17 @@ public class DankerGui extends GuiScreen {
this.buttonList.add(nextPage);
this.buttonList.add(backPage);
} else if (page == 3) {
+ this.buttonList.add(gparty);
this.buttonList.add(spiritBearAlert);
this.buttonList.add(sceptreMessages);
this.buttonList.add(midasStaffMessages);
this.buttonList.add(healMessages);
this.buttonList.add(goldenEnch);
this.buttonList.add(petColours);
- this.buttonList.add(expertiseLore);
this.buttonList.add(nextPage);
this.buttonList.add(backPage);
} else if (page == 4) {
+ this.buttonList.add(expertiseLore);
this.buttonList.add(lividSolver);
this.buttonList.add(golemAlerts);
this.buttonList.add(rngesusAlert);
@@ -179,6 +182,8 @@ public class DankerGui extends GuiScreen {
TheMod.guiToOpen = "onlyslayergui";
} else if (button == puzzleSolvers) {
TheMod.guiToOpen = "puzzlesolvers";
+ } else if (button == skillTracker) {
+ TheMod.guiToOpen = "skilltracker";
} else if (button == outlineText) {
ToggleCommand.outlineTextToggled = !ToggleCommand.outlineTextToggled;
ConfigHandler.writeBooleanConfig("toggles", "OutlineText", ToggleCommand.outlineTextToggled);
diff --git a/src/main/java/me/Danker/gui/EditLocationsGui.java b/src/main/java/me/Danker/gui/EditLocationsGui.java
index 7e67c1e..75caf6a 100644
--- a/src/main/java/me/Danker/gui/EditLocationsGui.java
+++ b/src/main/java/me/Danker/gui/EditLocationsGui.java
@@ -25,6 +25,7 @@ public class EditLocationsGui extends GuiScreen {
private LocationButton skill50;
private LocationButton lividHP;
private LocationButton cakeTimer;
+ private LocationButton skillTracker;
@Override
public boolean doesGuiPauseGame() {
@@ -71,17 +72,23 @@ public class EditLocationsGui extends GuiScreen {
EnumChatFormatting.YELLOW + 2 + "\n" +
EnumChatFormatting.YELLOW + 1;
+ String skillTrackerText = TheMod.SKILL_TRACKER_COLOUR + "Farming XP Earned: 462,425.3\n" +
+ TheMod.SKILL_TRACKER_COLOUR + "Time Elapsed: " + Utils.getTimeBetween(0, 3602) + "\n" +
+ TheMod.SKILL_TRACKER_COLOUR + "XP Per Hour: 462,168";
+
display = new LocationButton(0, MoveCommand.displayXY[0], MoveCommand.displayXY[1], 145 * ScaleCommand.displayScale, 102 * ScaleCommand.displayScale, ScaleCommand.displayScale, displayText, displayNums, 110);
dungeonTimer = new LocationButton(0, MoveCommand.dungeonTimerXY[0], MoveCommand.dungeonTimerXY[1], 113 * ScaleCommand.dungeonTimerScale, 57 * ScaleCommand.dungeonTimerScale, ScaleCommand.dungeonTimerScale, dungeonTimerText, dungeonTimerNums, 80);
coords = new LocationButton(0, MoveCommand.coordsXY[0], MoveCommand.coordsXY[1], 141 * ScaleCommand.coordsScale, 12 * ScaleCommand.coordsScale, ScaleCommand.coordsScale, TheMod.COORDS_COLOUR + "74 / 14 / -26 (141.1 / 6.7)", null, null);
skill50 = new LocationButton(0, MoveCommand.skill50XY[0], MoveCommand.skill50XY[1], 233 * ScaleCommand.skill50Scale, 12 * ScaleCommand.skill50Scale, ScaleCommand.skill50Scale, TheMod.SKILL_50_COLOUR + "+3.5 Farming (28,882,117.7/55,172,425) 52.34%", null, null);
lividHP = new LocationButton(0, MoveCommand.lividHpXY[0], MoveCommand.lividHpXY[1], 85 * ScaleCommand.lividHpScale, 12 * ScaleCommand.lividHpScale, ScaleCommand.lividHpScale, EnumChatFormatting.WHITE + "﴾ Livid " + EnumChatFormatting.YELLOW + "6.9M" + EnumChatFormatting.RED + "❤ " + EnumChatFormatting.WHITE + "﴿", null, null);
cakeTimer = new LocationButton(0, MoveCommand.cakeTimerXY[0], MoveCommand.cakeTimerXY[1] + 5, 85 * ScaleCommand.cakeTimerScale, 18 * ScaleCommand.cakeTimerScale, ScaleCommand.cakeTimerScale, TheMod.CAKE_COLOUR + " 11h16m", null, null);
+ skillTracker = new LocationButton(0, MoveCommand.skillTrackerXY[0], MoveCommand.skillTrackerXY[1], 150 * ScaleCommand.skillTrackerScale, 28 * ScaleCommand.skillTrackerScale, ScaleCommand.skillTrackerScale, skillTrackerText, null, null);
this.buttonList.add(coords);
this.buttonList.add(dungeonTimer);
this.buttonList.add(lividHP);
this.buttonList.add(cakeTimer);
+ this.buttonList.add(skillTracker);
this.buttonList.add(display);
this.buttonList.add(skill50);
}
@@ -136,6 +143,11 @@ public class EditLocationsGui extends GuiScreen {
MoveCommand.cakeTimerXY[1] += yMoved;
cakeTimer.xPosition = MoveCommand.cakeTimerXY[0];
cakeTimer.yPosition = MoveCommand.cakeTimerXY[1];
+ } else if (moving.equals("skillTracker")) {
+ MoveCommand.skillTrackerXY[0] += xMoved;
+ MoveCommand.skillTrackerXY[1] += yMoved;
+ skillTracker.xPosition = MoveCommand.skillTrackerXY[0];
+ skillTracker.yPosition = MoveCommand.skillTrackerXY[1];
}
this.buttonList.clear();
initGui();
@@ -160,6 +172,8 @@ public class EditLocationsGui extends GuiScreen {
moving = "lividHP";
} else if (button == cakeTimer) {
moving = "cakeTimer";
+ } else if (button == skillTracker) {
+ moving = "skillTracker";
}
}
}
@@ -180,6 +194,8 @@ public class EditLocationsGui extends GuiScreen {
ConfigHandler.writeIntConfig("locations", "lividHpY", MoveCommand.lividHpXY[1]);
ConfigHandler.writeIntConfig("locations", "cakeTimerX", MoveCommand.cakeTimerXY[0]);
ConfigHandler.writeIntConfig("locations", "cakeTimerY", MoveCommand.cakeTimerXY[1]);
+ ConfigHandler.writeIntConfig("locations", "skillTrackerX", MoveCommand.skillTrackerXY[0]);
+ ConfigHandler.writeIntConfig("locations", "skillTrackerY", MoveCommand.skillTrackerXY[1]);
}
}
diff --git a/src/main/java/me/Danker/gui/SkillTrackerGui.java b/src/main/java/me/Danker/gui/SkillTrackerGui.java
new file mode 100644
index 0000000..9672890
--- /dev/null
+++ b/src/main/java/me/Danker/gui/SkillTrackerGui.java
@@ -0,0 +1,99 @@
+package me.Danker.gui;
+
+import org.apache.commons.lang3.time.StopWatch;
+
+import me.Danker.TheMod;
+import me.Danker.handlers.ConfigHandler;
+import me.Danker.handlers.TextRenderer;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.gui.ScaledResolution;
+
+public class SkillTrackerGui extends GuiScreen {
+
+ private GuiButton goBack;
+ private GuiButton start;
+ private GuiButton stop;
+ private GuiButton reset;
+ private GuiButton hide;
+ private GuiButton show;
+
+ @Override
+ public boolean doesGuiPauseGame() {
+ return false;
+ }
+
+ @Override
+ public void initGui() {
+ super.initGui();
+
+ ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
+ int height = sr.getScaledHeight();
+ int width = sr.getScaledWidth();
+
+ goBack = new GuiButton(0, 2, height - 30, 100, 20, "Go Back");
+ start = new GuiButton(0, width / 2 - 140, (int) (height * 0.45), 80, 20, "Start");
+ stop = new GuiButton(0, width / 2 - 40, (int) (height * 0.45), 80, 20, "Stop");
+ reset = new GuiButton(0, width / 2 + 60, (int) (height * 0.45), 80, 20, "Reset");
+ hide = new GuiButton(0, width / 2 - 70, (int) (height * 0.55), 60, 20, "Hide");
+ show = new GuiButton(0, width / 2 + 10, (int) (height * 0.55), 60, 20, "Show");
+
+ this.buttonList.add(start);
+ this.buttonList.add(stop);
+ this.buttonList.add(reset);
+ this.buttonList.add(hide);
+ this.buttonList.add(show);
+ this.buttonList.add(goBack);
+ }
+
+ @Override
+ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+ this.drawDefaultBackground();
+ String stateText = "";
+ if (TheMod.skillStopwatch.isStarted() && !TheMod.skillStopwatch.isSuspended()) {
+ stateText = "Timer: Running";
+ } else if (!TheMod.skillStopwatch.isStarted() || TheMod.skillStopwatch.isSuspended()) {
+ stateText = "Timer: Paused";
+ }
+ if (!TheMod.showSkillTracker) {
+ stateText += " (Hidden)";
+ }
+ int stateTextWidth = mc.fontRendererObj.getStringWidth(stateText);
+ new TextRenderer(mc, stateText, width / 2 - stateTextWidth / 2, 10, 1D);
+ super.drawScreen(mouseX, mouseY, partialTicks);
+ }
+
+ @Override
+ public void actionPerformed(GuiButton button) {
+ if (button == goBack) {
+ TheMod.guiToOpen = "dankergui1";
+ } else if (button == start) {
+ if (TheMod.skillStopwatch.isStarted() && TheMod.skillStopwatch.isSuspended()) {
+ TheMod.skillStopwatch.resume();
+ } else if (!TheMod.skillStopwatch.isStarted()) {
+ TheMod.skillStopwatch.start();
+ }
+ } else if (button == stop) {
+ if (TheMod.skillStopwatch.isStarted() && !TheMod.skillStopwatch.isSuspended()) {
+ TheMod.skillStopwatch.suspend();
+ }
+ } else if (button == reset) {
+ TheMod.skillStopwatch = new StopWatch();
+ TheMod.farmingXPGained = 0;
+ TheMod.miningXPGained = 0;
+ TheMod.combatXPGained = 0;
+ TheMod.foragingXPGained = 0;
+ TheMod.fishingXPGained = 0;
+ TheMod.enchantingXPGained = 0;
+ TheMod.alchemyXPGained = 0;
+ } else if (button == hide) {
+ TheMod.showSkillTracker = false;
+ ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", false);
+ } else if (button == show) {
+ TheMod.showSkillTracker = true;
+ ConfigHandler.writeBooleanConfig("misc", "showSkillTracker", true);
+ }
+ }
+
+}