Skip to content

Commit

Permalink
Feature: New Year Cake Tracker (#2237)
Browse files Browse the repository at this point in the history
Co-authored-by: Empa <[email protected]>
Co-authored-by: CalMWolfs <[email protected]>
Co-authored-by: hannibal2 <[email protected]>
  • Loading branch information
4 people authored Nov 15, 2024
1 parent 25cd382 commit 352afc4
Show file tree
Hide file tree
Showing 5 changed files with 585 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
package at.hannibal2.skyhanni.config.features.inventory;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.utils.LorenzColor;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorColour;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorInfoText;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class CakeTrackerConfig {

@Expose
@ConfigOption(name = "Enabled", desc = "Tracks which Cakes you have/need.")
@ConfigEditorBoolean
@FeatureToggle
public boolean enabled = false;

@Expose
@ConfigOption(
name = "Note",
desc = "§cNote7:" +
"\nThis feature is not compatible with the NEU Storage Overlay." +
"\nBackpacks/Ender Chest will not be scanned correctly with it enabled."
)
@ConfigEditorInfoText
public boolean incompatibleNote = false;

@Expose
@ConfigLink(owner = CakeTrackerConfig.class, field = "enabled")
public Position cakeTrackerPosition = new Position(300, 300, false, true);

@Expose
public CakeTrackerDisplayType displayType = CakeTrackerDisplayType.MISSING_CAKES;

public enum CakeTrackerDisplayType {
MISSING_CAKES,
OWNED_CAKES,
}

@Expose
public CakeTrackerDisplayOrderType displayOrderType = CakeTrackerDisplayOrderType.OLDEST_FIRST;

public enum CakeTrackerDisplayOrderType {
OLDEST_FIRST,
NEWEST_FIRST,
}

@Expose
@ConfigOption(name = "Price on Hover", desc = "Show the prices of cakes when hovering over them in the tracker.")
@ConfigEditorBoolean
public boolean priceOnHover = true;

@Expose
@ConfigOption(
name = "Missing Color",
desc = "The color that should be used to highlight unobtained cakes in the Auction House."
)
@ConfigEditorColour
public String unobtainedAuctionHighlightColor = LorenzColor.RED.toConfigColor();

@Expose
@ConfigOption(
name = "Owned Color",
desc = "The color that should be used to highlight obtained cakes in the Auction House."
)
@ConfigEditorColour
public String obtainedAuctionHighlightColor = LorenzColor.GREEN.toConfigColor();

@Expose
@ConfigOption(
name = "Maximum Rows",
desc = "The maximum number of rows to display in the tracker, before a cutoff is imposed."
)
@ConfigEditorSlider(minValue = 5, maxValue = 40, minStep = 1)
public Property<Integer> maxDisplayRows = Property.of(20);
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ public class InventoryConfig {
@Accordion
public PageScrollingConfig pageScrolling = new PageScrollingConfig();

@Expose
@ConfigOption(name = "New Year Cake Tracker", desc = "")
@Accordion
public CakeTrackerConfig cakeTracker = new CakeTrackerConfig();

@Expose
@ConfigOption(name = "Magical Power Display", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -528,6 +529,26 @@ public static class GhostCounter {

}

public static class CakeData {
@Expose
public Set<Integer> ownedCakes = new HashSet<>();

@Expose
public Set<Integer> missingCakes = new HashSet<>();

@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ownedCakes.hashCode();
result = prime * result + missingCakes.hashCode();
return result;
}
}

@Expose
public CakeData cakeData = new CakeData();

@Expose
public PowderTracker.Data powderTracker = new PowderTracker.Data();

Expand Down
Loading

0 comments on commit 352afc4

Please sign in to comment.