Skip to content

Commit

Permalink
Merge pull request #42 from j10a1n15/customscoreboard
Browse files Browse the repository at this point in the history
Customscoreboard
  • Loading branch information
RayDeeUx authored Dec 11, 2023
2 parents 96d0a5a + 629ca22 commit 549e612
Show file tree
Hide file tree
Showing 33 changed files with 1,863 additions and 20 deletions.
4 changes: 4 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import at.hannibal2.skyhanni.data.ItemAddManager
import at.hannibal2.skyhanni.data.ItemClickData
import at.hannibal2.skyhanni.data.ItemRenderBackground
import at.hannibal2.skyhanni.data.ItemTipHelper
import at.hannibal2.skyhanni.data.MaxwellAPI
import at.hannibal2.skyhanni.data.LocationFixData
import at.hannibal2.skyhanni.data.MayorElection
import at.hannibal2.skyhanni.data.MinecraftData
Expand Down Expand Up @@ -255,6 +256,7 @@ import at.hannibal2.skyhanni.features.misc.SkyBlockKickDuration
import at.hannibal2.skyhanni.features.misc.SuperpairsClicksAlert
import at.hannibal2.skyhanni.features.misc.TimeFeatures
import at.hannibal2.skyhanni.features.misc.TpsCounter
import at.hannibal2.skyhanni.features.misc.customscoreboard.CustomScoreboard
import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListReader
import at.hannibal2.skyhanni.features.misc.compacttablist.TabListRenderer
Expand Down Expand Up @@ -434,6 +436,7 @@ class SkyHanniMod {
loadModule(SackAPI)
loadModule(BingoAPI)
loadModule(FishingAPI)
loadModule(MaxwellAPI)

// features
loadModule(BazaarOrderHelper())
Expand Down Expand Up @@ -684,6 +687,7 @@ class SkyHanniMod {
loadModule(DungeonFinderFeatures())
loadModule(PabloHelper())
loadModule(FishingBaitWarnings())
loadModule(CustomScoreboard())
loadModule(RepoPatternManager)
loadModule(PestSpawn())
loadModule(PestSpawnTimer)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/config/Storage.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.config;

import at.hannibal2.skyhanni.data.Powers;
import at.hannibal2.skyhanni.data.model.ComposterUpgrade;
import at.hannibal2.skyhanni.features.bingo.card.goals.BingoGoal;
import at.hannibal2.skyhanni.features.combat.endernodetracker.EnderNodeTracker;
Expand Down Expand Up @@ -111,6 +112,9 @@ public static class ProfileSpecific {
@Expose
public String currentPet = "";

@Expose
public Powers currentPower = null;

@Expose
public Map<LorenzVec, MinionConfig> minions = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import at.hannibal2.skyhanni.features.minion.MinionFeatures
import at.hannibal2.skyhanni.features.misc.CollectionTracker
import at.hannibal2.skyhanni.features.misc.LockMouseLook
import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager
import at.hannibal2.skyhanni.features.misc.customscoreboard.CustomScoreboard
import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager
import at.hannibal2.skyhanni.features.misc.massconfiguration.DefaultConfigFeatures
import at.hannibal2.skyhanni.features.misc.visualwords.VisualWordGui
Expand All @@ -46,6 +47,7 @@ import at.hannibal2.skyhanni.test.PacketTest
import at.hannibal2.skyhanni.test.SkyHanniConfigSearchResetCommand
import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests
import at.hannibal2.skyhanni.test.TestBingo
import at.hannibal2.skyhanni.test.command.CopyActionBar
import at.hannibal2.skyhanni.test.WorldEdit
import at.hannibal2.skyhanni.test.command.CopyItemCommand
import at.hannibal2.skyhanni.test.command.CopyNearbyEntitiesCommand
Expand Down Expand Up @@ -346,6 +348,10 @@ object Commands {
"shconfigmanagerreset",
"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)."
) { SkyHanniDebugsAndTests.configManagerResetCommand(it) }
registerCommand(
"shcopyactionbar",
"Copies the actionbar to the clipboard"
) { CopyActionBar.command(it) }
registerCommand(
"readcropmilestonefromclipboard",
"Read crop milestone from clipboard. This helps fixing wrong crop milestone data"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.config.features.gui.customscoreboard.CustomScoreboardConfig;
import at.hannibal2.skyhanni.data.GuiEditManager;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.Accordion;
Expand Down Expand Up @@ -38,6 +39,12 @@ public class GUIConfig {
@Accordion
public TextBoxConfig customTextBox = new TextBoxConfig();


@Expose
@ConfigOption(name = "Custom Scoreboard", desc = "")
@Accordion
public CustomScoreboardConfig customScoreboard = new CustomScoreboardConfig();

@Expose
@ConfigOption(name = "Real Time", desc = "Display the current computer time, a handy feature when playing in full-screen mode.")
@ConfigEditorBoolean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorColour;
import io.github.moulberry.moulconfig.annotations.ConfigEditorInfoText;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

public class BackgroundConfig {
@Expose
@ConfigOption(
name = "Enabled",
desc = "Show a background behind the scoreboard."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = true;

@Expose
@ConfigOption(
name = "Background Color",
desc = "The color of the background."
)
@ConfigEditorColour
public String color = "0:102:0:0:0";

@Expose
@ConfigOption(
name = "Use Custom Background Image",
desc = "Put that image into a resource pack, using the path \"skyhanni/scoreboard.png\"."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean useCustomBackgroundImage = false;

@Expose
@ConfigOption(
name = "Custom Background",
desc = "Add an image named \"scoreboard.png\" to your texture pack at \"\\assets\\skyhanni\\scoreboard.png.\" Activate the texture pack in Minecraft, then reload the game."
)
@ConfigEditorInfoText
public String useless;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.features.misc.customscoreboard.ScoreboardElements;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.Accordion;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class CustomScoreboardConfig {
@Expose
@ConfigOption(
name = "Enabled",
desc = "Show a custom scoreboard instead of the vanilla one."
)
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(
name = "Appearance",
desc = "Drag text to change the appearance of the advanced scoreboard." // supporting both custom & advanced search
)
@ConfigEditorDraggableList()
public List<ScoreboardElements> scoreboardEntries = new ArrayList<>(Arrays.asList(ScoreboardElements.values()));

@Expose
@ConfigOption(name = "Display Options", desc = "")
@Accordion
public DisplayConfig displayConfig = new DisplayConfig();

@Expose
@ConfigOption(name = "Information Filtering", desc = "")
@Accordion
public InformationFilteringConfig informationFilteringConfig = new InformationFilteringConfig();

@Expose
@ConfigOption(name = "Background Options", desc = "")
@Accordion
public BackgroundConfig backgroundConfig = new BackgroundConfig();

@Expose
@ConfigOption(name = "Party Options", desc = "")
@Accordion
public PartyConfig partyConfig = new PartyConfig();

@Expose
@ConfigOption(name = "Show Mayor Perks", desc = "Show the perks of the current mayor.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showMayorPerks = true;

@Expose
@ConfigOption(name = "Show Time till next mayor", desc = "Show the time till the next mayor is elected.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showTimeTillNextMayor = true;

@Expose
@ConfigOption(name = "Unknown Lines warning", desc = "Gives a chat warning when unknown lines are found in the scoreboard.")
@ConfigEditorBoolean
@FeatureToggle
public boolean unknownLinesWarning = true;

@Expose
public Position position = new Position(10, 80, false, true);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorText;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.observer.Property;

public class DisplayConfig {
@Expose
@ConfigOption(name = "Hide Vanilla Scoreboard", desc = "Hide the vanilla scoreboard.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideVanillaScoreboard = false;

@Expose
@ConfigOption(name = "Display Numbers First", desc = "Determines whether the number or line name displays first. " +
"§eNote: Will not update the preview above!")
@ConfigEditorBoolean
@FeatureToggle
public boolean displayNumbersFirst = false;

@Expose
@ConfigOption(name = "Align to the right", desc = "Align the scoreboard to the right side of the screen.")
@ConfigEditorBoolean
@FeatureToggle
public boolean alignRight = false;

@Expose
@ConfigOption(name = "Show all active events", desc = "Show all active events in the scoreboard instead of one.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showAllActiveEvents = false;

@Expose
@ConfigOption(name = "Align to the center vertically", desc = "Align the scoreboard to the center of the screen vertically.")
@ConfigEditorBoolean
@FeatureToggle
public boolean alignCenterVertically = false;

@Expose
@ConfigOption(name = "Center Title and Footer", desc = "Center the title and footer to the scoreboard width.")
@ConfigEditorBoolean
@FeatureToggle
public boolean centerTitleAndFooter = false;

@Expose
@ConfigOption(name = "Custom Title", desc = "What should be displayed as the title of the scoreboard.\nUse & for colors.")
@ConfigEditorText
public Property<String> customTitle = Property.of("&6&lSKYBLOCK");

@Expose
@ConfigOption(name = "Use Hypixel's Title Animation", desc = "Will overwrite the custom title with Hypixel's title animation.")
@ConfigEditorBoolean
@FeatureToggle
public boolean useHypixelTitleAnimation = false;

@Expose
@ConfigOption(name = "Custom Footer", desc = "What should be displayed as the footer of the scoreboard.\nUse & for colors.")
@ConfigEditorText
public Property<String> customFooter = Property.of("&ewww.hypixel.net");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

public class InformationFilteringConfig {
@Expose
@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.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideEmptyLines = true;

@Expose
@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.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideIrrelevantLines = true;

@Expose
@ConfigOption(name = "Hide consecutive empty lines", desc = "Hide lines that are empty and have an empty line above them.")
@ConfigEditorBoolean
@FeatureToggle
public boolean hideConsecutiveEmptyLines = true;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package at.hannibal2.skyhanni.config.features.gui.customscoreboard;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider;
import io.github.moulberry.moulconfig.annotations.ConfigOption;
import io.github.moulberry.moulconfig.observer.Property;

public class PartyConfig {
@Expose
@ConfigOption(name = "Max Party List", desc = "Max number of party members to show in the party list. (You are not included)")
@ConfigEditorSlider(
minValue = 0,
maxValue = 25, // why do I even set it so high
minStep = 1
)
public Property<Integer> maxPartyList = Property.of(4);

@Expose
@ConfigOption(name = "Show Party everywhere", desc = "Show the party list everywhere.\nIf disabled, it will only show in Dungeon hub, Crimson Isle & Kuudra")
@ConfigEditorBoolean
@FeatureToggle
public boolean showPartyEverywhere = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ object ActionBarStatsData {
)

var groups = mutableMapOf("health" to "", "riftTime" to "", "defense" to "", "mana" to "")
var actionBar = ""

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

actionBar = event.message

for ((groupName, pattern) in patterns) {
pattern.matchMatcher(event.message) {
groups[groupName] = group(groupName)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/at/hannibal2/skyhanni/data/IslandType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum class IslandType(val displayName: String, val modeName: String = "null") {
PRIVATE_ISLAND("Private Island"),
PRIVATE_ISLAND_GUEST("Private Island Guest"),
THE_END("The End"),
KUUDRA_ARENA("Instanced"),
KUUDRA_ARENA("Kuudra"),
CRIMSON_ISLE("Crimson Isle"),
DWARVEN_MINES("Dwarven Mines"),
DUNGEON_HUB("Dungeon Hub", "dungeon_hub"),
Expand Down
Loading

0 comments on commit 549e612

Please sign in to comment.