Skip to content

Commit 9899ec1

Browse files
Merge pull request #20 from martimavocado/scoreboard-test
merge scoreboard
2 parents 6836c55 + aea9847 commit 9899ec1

30 files changed

+1462
-8
lines changed

src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import at.hannibal2.skyhanni.data.ItemAddManager
2626
import at.hannibal2.skyhanni.data.ItemClickData
2727
import at.hannibal2.skyhanni.data.ItemRenderBackground
2828
import at.hannibal2.skyhanni.data.ItemTipHelper
29+
import at.hannibal2.skyhanni.data.MaxwellAPI
2930
import at.hannibal2.skyhanni.data.LocationFixData
3031
import at.hannibal2.skyhanni.data.MayorElection
3132
import at.hannibal2.skyhanni.data.MinecraftData
@@ -243,6 +244,7 @@ import at.hannibal2.skyhanni.features.misc.SkyBlockKickDuration
243244
import at.hannibal2.skyhanni.features.misc.SuperpairsClicksAlert
244245
import at.hannibal2.skyhanni.features.misc.TimeFeatures
245246
import at.hannibal2.skyhanni.features.misc.TpsCounter
247+
import at.hannibal2.skyhanni.features.misc.customscoreboard.CustomScoreboard
246248
import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList
247249
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListReader
248250
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListRenderer
@@ -418,6 +420,7 @@ class SkyHanniMod {
418420
loadModule(SackAPI)
419421
loadModule(BingoAPI)
420422
loadModule(FishingAPI)
423+
loadModule(MaxwellAPI)
421424

422425
// features
423426
loadModule(BazaarOrderHelper())
@@ -660,6 +663,7 @@ class SkyHanniMod {
660663
loadModule(DungeonFinderFeatures())
661664
loadModule(PabloHelper())
662665
loadModule(FishingBaitWarnings())
666+
loadModule(CustomScoreboard())
663667
loadModule(PestSpawn())
664668
loadModule(PestSpawnTimer)
665669
loadModule(PestFinder())

src/main/java/at/hannibal2/skyhanni/config/Storage.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package at.hannibal2.skyhanni.config;
22

3+
import at.hannibal2.skyhanni.data.Powers;
34
import at.hannibal2.skyhanni.data.model.ComposterUpgrade;
45
import at.hannibal2.skyhanni.features.combat.endernodetracker.EnderNodeTracker;
56
import at.hannibal2.skyhanni.features.combat.ghostcounter.GhostData;
@@ -102,6 +103,9 @@ public static class ProfileSpecific {
102103
@Expose
103104
public String currentPet = "";
104105

106+
@Expose
107+
public Powers currentPower = null;
108+
105109
@Expose
106110
public Map<LorenzVec, MinionConfig> minions = new HashMap<>();
107111

src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import at.hannibal2.skyhanni.features.minion.MinionFeatures
3737
import at.hannibal2.skyhanni.features.misc.CollectionTracker
3838
import at.hannibal2.skyhanni.features.misc.LockMouseLook
3939
import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager
40+
import at.hannibal2.skyhanni.features.misc.customscoreboard.CustomScoreboard
4041
import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager
4142
import at.hannibal2.skyhanni.features.misc.massconfiguration.DefaultConfigFeatures
4243
import at.hannibal2.skyhanni.features.misc.visualwords.VisualWordGui
@@ -45,6 +46,7 @@ import at.hannibal2.skyhanni.test.PacketTest
4546
import at.hannibal2.skyhanni.test.SkyHanniConfigSearchResetCommand
4647
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
4748
import at.hannibal2.skyhanni.test.TestBingo
49+
import at.hannibal2.skyhanni.test.command.CopyActionBar
4850
import at.hannibal2.skyhanni.test.command.CopyItemCommand
4951
import at.hannibal2.skyhanni.test.command.CopyNearbyEntitiesCommand
5052
import at.hannibal2.skyhanni.test.command.CopyNearbyParticlesCommand
@@ -324,6 +326,10 @@ object Commands {
324326
"shconfigmanagerreset",
325327
"Reloads the config manager and rendering processors of MoulConfig. This §cWILL RESET §7your config, but also updating the java config files (names, description, orderings and stuff)."
326328
) { SkyHanniDebugsAndTests.configManagerResetCommand(it) }
329+
registerCommand(
330+
"shcopyactionbar",
331+
"Copies the actionbar to the clipboard"
332+
) { CopyActionBar.command(it) }
327333
registerCommand(
328334
"readcropmilestonefromclipboard",
329335
"Read crop milestone from clipboard. This helps fixing wrong crop milestone data"

src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import at.hannibal2.skyhanni.config.FeatureToggle;
44
import at.hannibal2.skyhanni.config.core.config.Position;
5+
import at.hannibal2.skyhanni.config.features.gui.customscoreboard.CustomScoreboardConfig;
56
import at.hannibal2.skyhanni.data.GuiEditManager;
67
import com.google.gson.annotations.Expose;
78
import io.github.moulberry.moulconfig.annotations.Accordion;
@@ -38,6 +39,12 @@ public class GUIConfig {
3839
@Accordion
3940
public TextBoxConfig customTextBox = new TextBoxConfig();
4041

42+
43+
@Expose
44+
@ConfigOption(name = "Custom Scoreboard", desc = "")
45+
@Accordion
46+
public CustomScoreboardConfig customScoreboard = new CustomScoreboardConfig();
47+
4148
@Expose
4249
@ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.")
4350
@ConfigEditorBoolean
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;
2+
3+
import at.hannibal2.skyhanni.config.FeatureToggle;
4+
import com.google.gson.annotations.Expose;
5+
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
6+
import io.github.moulberry.moulconfig.annotations.ConfigEditorColour;
7+
import io.github.moulberry.moulconfig.annotations.ConfigOption;
8+
9+
public class BackgroundConfig {
10+
@Expose
11+
@ConfigOption(
12+
name = "Enabled",
13+
desc = "Show a background behind the scoreboard."
14+
)
15+
@ConfigEditorBoolean
16+
@FeatureToggle
17+
public boolean enabled = true;
18+
19+
@Expose
20+
@ConfigOption(
21+
name = "Background Color",
22+
desc = "The color of the background."
23+
)
24+
@ConfigEditorColour
25+
public String color = "0:102:0:0:0";
26+
27+
@Expose
28+
@ConfigOption(
29+
name = "Use Custom Background Image",
30+
desc = "Put that image into a resource pack, using the path skyhanni/scoreboard.png."
31+
)
32+
@ConfigEditorBoolean
33+
@FeatureToggle
34+
public boolean useCustomBackgroundImage = false;
35+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;
2+
3+
import at.hannibal2.skyhanni.config.FeatureToggle;
4+
import at.hannibal2.skyhanni.config.core.config.Position;
5+
import at.hannibal2.skyhanni.config.features.misc.compacttablist.AdvancedPlayerListConfig;
6+
import com.google.gson.annotations.Expose;
7+
import io.github.moulberry.moulconfig.annotations.Accordion;
8+
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
9+
import io.github.moulberry.moulconfig.annotations.ConfigEditorColour;
10+
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
11+
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
12+
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
13+
import io.github.moulberry.moulconfig.annotations.ConfigOption;
14+
import io.github.moulberry.moulconfig.observer.Property;
15+
16+
import java.util.ArrayList;
17+
import java.util.Arrays;
18+
import java.util.List;
19+
20+
public class CustomScoreboardConfig {
21+
@Expose
22+
@ConfigOption(
23+
name = "Enabled",
24+
desc = "Show a custom scoreboard instead of the vanilla one."
25+
)
26+
@ConfigEditorBoolean
27+
@FeatureToggle
28+
public boolean enabled = false;
29+
30+
@Expose
31+
@ConfigOption(
32+
name = "Text Format",
33+
desc = "Drag text to change the appearance of the scoreboard."
34+
)
35+
@ConfigEditorDraggableList(
36+
exampleText = {
37+
"§6§lSKYBLOCK",
38+
"§7♲ Blueberry",
39+
"Purse: §652,763,737",
40+
"Motes: §d64,647",
41+
"Bank: §6249M",
42+
"Bits: §b59,264",
43+
"Copper: §c23,495",
44+
"Gems: §a57,873",
45+
"Heat: §c♨ 0",
46+
"",
47+
"§7⏣ §bVillage",
48+
"Late Summer 11th",
49+
"§8m77CK",
50+
"Power: Sighted",
51+
"",
52+
"Objective:\n§eUpdate SkyHanni",
53+
"§cSlayer\n §7- §cVoidgloom Seraph III\n §7- §e12§7/§c120 §7Kills",
54+
"",
55+
"§9§lPowder\n §7- §fMithril: §254,646\n §7- §fGemstone: §d51,234",
56+
"§7Wide Range of Events\n§7(too much for this here)",
57+
"§2Diana:\n §7- §eLucky!\n §7- §eMythological Ritual\n §7- §ePet XP Buff",
58+
"§9§lParty (4):\n §7- §fhannibal2\n §7- §fMoulberry\n §7- §fVahvl\n §7- §fJ10a1n15",
59+
"§ewww.hypixel.net",
60+
}
61+
)
62+
public List<Integer> textFormat = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22));
63+
64+
@Expose
65+
@ConfigOption(name = "Display Options", desc = "")
66+
@Accordion
67+
public DisplayConfig displayConfig = new DisplayConfig();
68+
69+
@Expose
70+
@ConfigOption(name = "Information Filtering", desc = "")
71+
@Accordion
72+
public InformationFilteringConfig informationFilteringConfig = new InformationFilteringConfig();
73+
74+
@Expose
75+
@ConfigOption(name = "Background Options", desc = "")
76+
@Accordion
77+
public BackgroundConfig backgroundConfig = new BackgroundConfig();
78+
79+
@Expose
80+
@ConfigOption(name = "Party Options", desc = "")
81+
@Accordion
82+
public PartyConfig partyConfig = new PartyConfig();
83+
84+
@Expose
85+
@ConfigOption(name = "Show Mayor Perks", desc = "Show the perks of the current mayor.")
86+
@ConfigEditorBoolean
87+
@FeatureToggle
88+
public boolean showMayorPerks = true;
89+
90+
@Expose
91+
public Position position = new Position(10, 80, false, true);
92+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;
2+
3+
import at.hannibal2.skyhanni.config.FeatureToggle;
4+
import com.google.gson.annotations.Expose;
5+
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
6+
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
7+
import io.github.moulberry.moulconfig.annotations.ConfigOption;
8+
import io.github.moulberry.moulconfig.observer.Property;
9+
10+
public class DisplayConfig {
11+
@Expose
12+
@ConfigOption(name = "Hide Vanilla Scoreboard", desc = "Hide the vanilla scoreboard.")
13+
@ConfigEditorBoolean
14+
@FeatureToggle
15+
public boolean hideVanillaScoreboard = false;
16+
17+
@Expose
18+
@ConfigOption(name = "Display Numbers First", desc = "Determines whether the number or line name displays first. " +
19+
"§eNote: Will not update the preview above!")
20+
@ConfigEditorBoolean
21+
@FeatureToggle
22+
public boolean displayNumbersFirst = false;
23+
24+
@Expose
25+
@ConfigOption(name = "Align to the right", desc = "Align the scoreboard to the right side of the screen.")
26+
@ConfigEditorBoolean
27+
@FeatureToggle
28+
public boolean alignRight = false;
29+
30+
@Expose
31+
@ConfigOption(name = "Align to the center vertically", desc = "Align the scoreboard to the center of the screen vertically.")
32+
@ConfigEditorBoolean
33+
@FeatureToggle
34+
public boolean alignCenterVertically = false;
35+
36+
@Expose
37+
@ConfigOption(name = "Custom Title", desc = "What should be displayed as the title of the scoreboard.\nUse & for colors.")
38+
@ConfigEditorText
39+
public Property<String> customTitle = Property.of("&6&lSKYBLOCK");
40+
41+
@Expose
42+
@ConfigOption(name = "Use Hypixel's Title Animation", desc = "Will overwrite the custom title with Hypixel's title animation.")
43+
@ConfigEditorBoolean
44+
@FeatureToggle
45+
public boolean useHypixelTitleAnimation = false;
46+
47+
@Expose
48+
@ConfigOption(name = "Custom Footer", desc = "What should be displayed as the footer of the scoreboard.\nUse & for colors.")
49+
@ConfigEditorText
50+
public Property<String> customFooter = Property.of("&ewww.hypixel.net");
51+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;
2+
3+
import at.hannibal2.skyhanni.config.FeatureToggle;
4+
import com.google.gson.annotations.Expose;
5+
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
6+
import io.github.moulberry.moulconfig.annotations.ConfigOption;
7+
8+
public class InformationFilteringConfig {
9+
@Expose
10+
@ConfigOption(name = "Hide lines with no info", desc = "Hide lines that have no info to display, like hiding the party when not being in one.")
11+
@ConfigEditorBoolean
12+
@FeatureToggle
13+
public boolean hideEmptyLines = true;
14+
15+
@Expose
16+
@ConfigOption(name = "Hide Info not relevant to location", desc = "Hide lines that are not relevant to the current location, like hiding copper while not in garden.")
17+
@ConfigEditorBoolean
18+
@FeatureToggle
19+
public boolean hideIrrelevantLines = true;
20+
21+
@Expose
22+
@ConfigOption(name = "Hide consecutive empty lines", desc = "Hide lines that are empty and have an empty line above them.")
23+
@ConfigEditorBoolean
24+
@FeatureToggle
25+
public boolean hideConsecutiveEmptyLines = true;
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;
2+
3+
import at.hannibal2.skyhanni.config.FeatureToggle;
4+
import com.google.gson.annotations.Expose;
5+
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
6+
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
7+
import io.github.moulberry.moulconfig.annotations.ConfigOption;
8+
import io.github.moulberry.moulconfig.observer.Property;
9+
10+
public class PartyConfig {
11+
@Expose
12+
@ConfigOption(name = "Max Party List", desc = "Max number of party members to show in the party list. (You are not included)")
13+
@ConfigEditorSlider(
14+
minValue = 1,
15+
maxValue = 25, // why do I even set it so high
16+
minStep = 1
17+
)
18+
public Property<Integer> maxPartyList = Property.of(4);
19+
20+
@Expose
21+
@ConfigOption(name = "Show Party everywhere", desc = "Show the party list everywhere.")
22+
@ConfigEditorBoolean
23+
@FeatureToggle
24+
public boolean showPartyEverywhere = false;
25+
}

src/main/java/at/hannibal2/skyhanni/data/ActionBarStatsData.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ object ActionBarStatsData {
1515
)
1616

1717
var groups = mutableMapOf("health" to "", "riftTime" to "", "defense" to "", "mana" to "")
18+
var actionBar = ""
1819

1920
@SubscribeEvent
2021
fun onActionBar(event: LorenzActionBarEvent) {
2122
if (!LorenzUtils.inSkyBlock) return
2223

24+
actionBar = event.message
25+
2326
for ((groupName, pattern) in patterns) {
2427
pattern.matchMatcher(event.message) {
2528
groups[groupName] = group(groupName)

0 commit comments

Comments
 (0)