From 37a9fd7df3695fcc0fb4dd5427a91b73bdadefbb Mon Sep 17 00:00:00 2001 From: Luna Date: Fri, 3 May 2024 14:07:46 +0200 Subject: Feature: Add overflow crop milestones (#997) Co-authored-by: HiZe Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../hannibal2/skyhanni/config/commands/Commands.kt | 9 +++++ .../cropmilestones/CropMilestonesConfig.java | 5 +++ .../CropMilestonesOverflowConfig.java | 38 ++++++++++++++++++++++ .../config/storage/ProfileSpecificStorage.java | 3 ++ 4 files changed, 55 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesOverflowConfig.java (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt index b4a2c336e..faca8636b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.config.ConfigGuiManager import at.hannibal2.skyhanni.config.features.About.UpdateStream import at.hannibal2.skyhanni.data.ChatClickActionManager import at.hannibal2.skyhanni.data.ChatManager +import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestonesCommunityFix import at.hannibal2.skyhanni.data.GuiEditManager import at.hannibal2.skyhanni.data.PartyAPI @@ -291,6 +292,14 @@ object Commands { }, FarmingMilestoneCommand::onComplete ) + registerCommand0( + "shcropgoal", + "Define a custom milestone goal for a crop.", + { + FarmingMilestoneCommand.setGoal(it.getOrNull(0), it.getOrNull(1)) + }, + FarmingMilestoneCommand::onComplete + ) registerCommand0( "shskills", "Skills XP/Level related command", diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesConfig.java index ee47709a8..abc256c97 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesConfig.java @@ -36,6 +36,11 @@ public class CropMilestonesConfig { @FeatureToggle public boolean progress = true; + @Expose + @ConfigOption(name = "Overflow", desc = "") + @Accordion + public CropMilestonesOverflowConfig overflow = new CropMilestonesOverflowConfig(); + @Expose @ConfigOption( name = "Warn When Close", diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesOverflowConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesOverflowConfig.java new file mode 100644 index 000000000..acf588543 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/garden/cropmilestones/CropMilestonesOverflowConfig.java @@ -0,0 +1,38 @@ +package at.hannibal2.skyhanni.config.features.garden.cropmilestones; + +import com.google.gson.annotations.Expose; +import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean; +import io.github.notenoughupdates.moulconfig.annotations.ConfigOption; + +public class CropMilestonesOverflowConfig { + + @Expose + @ConfigOption(name = "Crop Milestone Display", desc = "Show overflow levels in Crop Milestone display.") + @ConfigEditorBoolean + public boolean cropMilestoneDisplay = false; + + @Expose + @ConfigOption(name = "Best Crop Time", desc = "Show overflow levels in Best Crop Time Display.") + @ConfigEditorBoolean + public boolean bestCropTime = false; + + @Expose + @ConfigOption(name = "Inventory", desc = "Show overflow levels as stack size in the Crop Milestones inventory (will also change milestone average).") + @ConfigEditorBoolean + public boolean inventoryStackSize = false; + + @Expose + @ConfigOption(name = "Tooltip", desc = "Show overflow level progress in the item tooltip in the Crop Milestones inventory.") + @ConfigEditorBoolean + public boolean inventoryTooltip = false; + + @Expose + @ConfigOption(name = "Discord RPC", desc = "Show overflow levels in the Discord RPC milestone display.") + @ConfigEditorBoolean + public boolean discordRPC = false; + + @Expose + @ConfigOption(name = "Chat", desc = "Send a chat message when gaining an overflow milestone level.") + @ConfigEditorBoolean + public boolean chat = false; +} diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java index 2638512d8..5487a3519 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java @@ -361,6 +361,9 @@ public class ProfileSpecificStorage { @Expose public Map npcVisitorLocations = new HashMap<>(); + @Expose + public Map customGoalMilestone = new HashMap<>(); + @Expose public PestProfitTracker.Data pestProfitTracker = new PestProfitTracker.Data(); -- cgit