diff options
| author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-03-12 19:59:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-12 19:59:55 +0100 |
| commit | 4352ffb08d4bfffc06adad2a068f375ab9874333 (patch) | |
| tree | b8ce745fca8ab82ffa04f6ab87334139a6b7192b /src/main/java | |
| parent | eb863d60e82b5541a9f42d2608f61cb97ada209b (diff) | |
| download | skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.tar.gz skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.tar.bz2 skyhanni-4352ffb08d4bfffc06adad2a068f375ab9874333.zip | |
Feature: CustomScoreboard (#893)
Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com>
Co-authored-by: Thunderblade73 <gaidermarkus@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
62 files changed, 3524 insertions, 154 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 6c05aadbd..d7d68ba78 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -11,12 +11,14 @@ import at.hannibal2.skyhanni.config.SackData import at.hannibal2.skyhanni.config.commands.Commands.init import at.hannibal2.skyhanni.data.ActionBarData import at.hannibal2.skyhanni.data.ActionBarStatsData +import at.hannibal2.skyhanni.data.BitsAPI import at.hannibal2.skyhanni.data.BlockData import at.hannibal2.skyhanni.data.BossbarData import at.hannibal2.skyhanni.data.ChatManager import at.hannibal2.skyhanni.data.CropAccessoryData import at.hannibal2.skyhanni.data.EntityData import at.hannibal2.skyhanni.data.EntityMovementData +import at.hannibal2.skyhanni.data.FameRanks import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.GardenComposterUpgradesData import at.hannibal2.skyhanni.data.GardenCropMilestones @@ -30,7 +32,8 @@ import at.hannibal2.skyhanni.data.ItemClickData import at.hannibal2.skyhanni.data.ItemRenderBackground import at.hannibal2.skyhanni.data.ItemTipHelper import at.hannibal2.skyhanni.data.LocationFixData -import at.hannibal2.skyhanni.data.MayorElection +import at.hannibal2.skyhanni.data.MaxwellAPI +import at.hannibal2.skyhanni.data.MayorAPI import at.hannibal2.skyhanni.data.MinecraftData import at.hannibal2.skyhanni.data.OtherInventoryData import at.hannibal2.skyhanni.data.OwnInventoryData @@ -38,6 +41,7 @@ import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.PurseAPI +import at.hannibal2.skyhanni.data.QuiverAPI import at.hannibal2.skyhanni.data.RenderData import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.data.ScoreboardData @@ -284,6 +288,8 @@ import at.hannibal2.skyhanni.features.misc.TpsCounter import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList import at.hannibal2.skyhanni.features.misc.compacttablist.TabListReader import at.hannibal2.skyhanni.features.misc.compacttablist.TabListRenderer +import at.hannibal2.skyhanni.features.gui.customscoreboard.CustomScoreboard +import at.hannibal2.skyhanni.features.gui.customscoreboard.ScoreboardPattern import at.hannibal2.skyhanni.features.misc.discordrpc.DiscordRPCManager import at.hannibal2.skyhanni.features.misc.items.AuctionHouseCopyUnderbidPrice import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue @@ -445,7 +451,6 @@ class SkyHanniMod { loadModule(GetFromSackAPI) loadModule(UpdateManager) loadModule(CropAccessoryData()) - loadModule(MayorElection()) loadModule(GardenComposterUpgradesData()) loadModule(ActionBarStatsData) loadModule(GardenCropMilestoneInventory()) @@ -464,6 +469,7 @@ class SkyHanniMod { loadModule(GardenBestCropTime()) loadModule(ActionBarData) loadModule(TrackerManager) + loadModule(ScoreboardPattern) loadModule(UtilsPatterns) loadModule(PetAPI) loadModule(BossbarData) @@ -485,7 +491,12 @@ class SkyHanniMod { loadModule(RiftAPI) loadModule(SackAPI) loadModule(BingoAPI) + loadModule(FameRanks) loadModule(FishingAPI) + loadModule(MaxwellAPI) + loadModule(QuiverAPI) + loadModule(BitsAPI) + loadModule(MayorAPI) loadModule(SkillAPI) loadModule(IsFishingDetection) loadModule(LorenzUtils) @@ -748,6 +759,7 @@ class SkyHanniMod { loadModule(DungeonFinderFeatures()) loadModule(PabloHelper()) loadModule(FishingBaitWarnings()) + loadModule(CustomScoreboard()) loadModule(RepoPatternManager) loadModule(PestSpawn()) loadModule(PestSpawnTimer) diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 597d3a7eb..95286550c 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.config; +import at.hannibal2.skyhanni.data.FameRank; import at.hannibal2.skyhanni.api.SkillAPI; import at.hannibal2.skyhanni.data.model.ComposterUpgrade; import at.hannibal2.skyhanni.features.bingo.card.goals.BingoGoal; @@ -78,6 +79,9 @@ public class Storage { @Expose public Map<UUID, PlayerSpecific> players = new HashMap<>(); + @Expose + public String currentFameRank = null; + public static class PlayerSpecific { @Expose @@ -147,6 +151,39 @@ public class Storage { public String currentPet = ""; @Expose + public MaxwellPowerStorage maxwell = new MaxwellPowerStorage(); + + public static class MaxwellPowerStorage { + @Expose + public String currentPower = null; + + @Expose + public int magicalPower = -1; + } + + @Expose + public ArrowsStorage arrows = new ArrowsStorage(); + + public static class ArrowsStorage { + @Expose + public String currentArrow = null; + + @Expose + public Map<NEUInternalName, Float> arrowAmount = new HashMap<>(); + } + + @Expose + public BitsStorage bits = new BitsStorage(); + + public static class BitsStorage { + @Expose + public int bits = -1; + + @Expose + public int bitsToClaim = -1; + } + + @Expose public Map<LorenzVec, MinionConfig> minions = new HashMap<>(); public static class MinionConfig { diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt index f6765ca2b..88264e994 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt @@ -19,6 +19,7 @@ package at.hannibal2.skyhanni.config.core.config.gui import at.hannibal2.skyhanni.config.core.config.Position +import at.hannibal2.skyhanni.data.GuiEditManager import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsX import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getAbsY import at.hannibal2.skyhanni.data.GuiEditManager.Companion.getDummySize @@ -216,6 +217,7 @@ class GuiPositionEditor(private val positions: List<Position>, private val borde val elementHeight = position.getDummySize(true).y grabbedX += position.moveX(mouseX - grabbedX, elementWidth) grabbedY += position.moveY(mouseY - grabbedY, elementHeight) + GuiEditManager.handleGuiPositionMoved(position.internalName) } } diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java index 89170c027..3b5200c39 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/dev/DevConfig.java @@ -44,6 +44,11 @@ public class DevConfig { @ConfigEditorBoolean public boolean worldEdit = false; + @Expose + @ConfigOption(name = "Bow Sound distance", desc = "The distance in blocks where the sound of shooting a bow will be used for the QuiverAPI.") + @ConfigEditorSlider(minValue = 0, maxValue = 50, minStep = 1) + public int bowSoundDistance = 5; + @ConfigOption(name = "Parkour Waypoints", desc = "") @Accordion @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java index 4eeadf221..10b6cdde1 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/GUIConfig.java @@ -2,9 +2,11 @@ package at.hannibal2.skyhanni.config.features.gui; 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; @@ -29,6 +31,10 @@ public class GUIConfig { public float globalScale = 1F; @Expose + @Category(name = "Custom Scoreboard", desc = "Custom Scoreboard Settings") + public CustomScoreboardConfig customScoreboard = new CustomScoreboardConfig(); + + @Expose @ConfigOption(name = "Modify Visual Words", desc = "") @Accordion public ModifyWordsConfig modifyWords = new ModifyWordsConfig(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/AlignmentConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/AlignmentConfig.java new file mode 100644 index 000000000..a5a8170f3 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/AlignmentConfig.java @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.config.features.gui.customscoreboard; + +import com.google.gson.annotations.Expose; +import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; +import io.github.moulberry.moulconfig.annotations.ConfigOption; + +public class AlignmentConfig { + // TODO: Switch to Dropdowns with multiple different alignment ways in the future + // Horizontal: Left, Center, Right + // Vertical: Top, Center, Bottom + @Expose + @ConfigOption(name = "Align to the right", desc = "Align the scoreboard to the right side of the screen.") + @ConfigEditorBoolean + public boolean alignRight = true; + + @Expose + @ConfigOption(name = "Align to the center vertically", desc = "Align the scoreboard to the center of the screen vertically.") + @ConfigEditorBoolean + public boolean alignCenterVertically = true; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/BackgroundConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/BackgroundConfig.java new file mode 100644 index 000000000..3b4924511 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/BackgroundConfig.java @@ -0,0 +1,66 @@ +package at.hannibal2.skyhanni.config.features.gui.customscoreboard; + +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.ConfigEditorSlider; +import io.github.moulberry.moulconfig.annotations.ConfigOption; + +public class BackgroundConfig { + @Expose + @ConfigOption( + name = "Enabled", + desc = "Show a background behind the scoreboard." + ) + @ConfigEditorBoolean + 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 = "Background Border Size", + desc = "The size of the border around the background." + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 20, + minStep = 1 + ) + public int borderSize = 5; + + @Expose + @ConfigOption( + name = "Rounded Corner Smoothness", + desc = "The smoothness of the rounded corners." + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 30, + minStep = 1 + ) + public int roundedCornerSmoothness = 10; + + @Expose + @ConfigOption( + name = "Use Custom Background Image", + desc = "Put that image into a resource pack, using the path \"skyhanni/scoreboard.png\"." + ) + @ConfigEditorBoolean + 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; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/CustomScoreboardConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/CustomScoreboardConfig.java new file mode 100644 index 000000000..4941caf5c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/CustomScoreboardConfig.java @@ -0,0 +1,65 @@ +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.gui.customscoreboard.ScoreboardElement; +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.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<ScoreboardElement> scoreboardEntries = new ArrayList<>(ScoreboardElement.getEntries()); + + @Expose + @ConfigOption(name = "Display Options", desc = "") + @Accordion + public DisplayConfig displayConfig = new DisplayConfig(); + + @Expose + @ConfigOption(name = "Information Filtering", de |
