Skip to content

Commit

Permalink
Merge pull request #49 from j10a1n15/customscoreboard
Browse files Browse the repository at this point in the history
Customscoreboard
  • Loading branch information
RayDeeUx authored Dec 22, 2023
2 parents 5d29ba1 + 4c2e4dc commit 9f40360
Show file tree
Hide file tree
Showing 38 changed files with 2,045 additions and 21 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 @@ -261,6 +262,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 @@ -443,6 +445,7 @@ class SkyHanniMod {
loadModule(SackAPI)
loadModule(BingoAPI)
loadModule(FishingAPI)
loadModule(MaxwellAPI)

// features
loadModule(BazaarOrderHelper())
Expand Down Expand Up @@ -696,6 +699,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 @@ -117,6 +118,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 @@ -49,6 +49,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 @@ -361,6 +362,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,9 +2,11 @@

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;
import io.github.moulberry.moulconfig.annotations.Category;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigEditorButton;
import io.github.moulberry.moulconfig.annotations.ConfigEditorKeybind;
Expand Down Expand Up @@ -38,6 +40,10 @@ public class GUIConfig {
@Accordion
public TextBoxConfig customTextBox = new TextBoxConfig();

@Expose
@Category(name = "Custom Scoreboard", desc = "Custom Scoreboard Settings")
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,20 @@
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 AlignmentConfig {
@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 = "Align to the center vertically", desc = "Align the scoreboard to the center of the screen vertically.")
@ConfigEditorBoolean
@FeatureToggle
public boolean alignCenterVertically = false;
}
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,67 @@
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 = "Mayor Options", desc = "")
@Accordion
public MayorConfig mayorConfig = new MayorConfig();

@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,38 @@
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.Accordion;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

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 = "Show all active events", desc = "Show all active events in the scoreboard instead of one.")
@ConfigEditorBoolean
@FeatureToggle
public boolean showAllActiveEvents = false;

@Expose
@ConfigOption(name = "Alignment Options", desc = "")
@Accordion
public AlignmentConfig alignment = new AlignmentConfig();

@Expose
@ConfigOption(name = "Title and Footer Options", desc = "")
@Accordion
public TitleAndFooterConfig titleAndFooter = new TitleAndFooterConfig();
}
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,20 @@
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 MayorConfig {
@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;
}
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
@@ -0,0 +1,32 @@
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 TitleAndFooterConfig {
@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
Expand Up @@ -20,7 +20,7 @@ public class MiscConfig {
@ConfigOption(name = "Hide Armor", desc = "")
@Accordion
@Expose
// TOOD maybe we can migrate this already
// TODO maybe we can migrate this already
public HideArmorConfig hideArmor2 = new HideArmorConfig();

@Expose
Expand Down Expand Up @@ -120,6 +120,12 @@ public class MiscConfig {
@FeatureToggle
public boolean hidePiggyScoreboard = true;

@Expose
@ConfigOption(name = "Color Month Names", desc = "Color the month names in the Scoreboard.\nAlso applies to the Custom Scoreboard")
@ConfigEditorBoolean
@FeatureToggle
public boolean colorMonthNames = false;

@Expose
@ConfigOption(name = "Explosions Hider", desc = "Hide explosions.")
@ConfigEditorBoolean
Expand Down
Loading

0 comments on commit 9f40360

Please sign in to comment.