summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/features/garden/NextJacobContestConfig.java
blob: 082a9ab1d7a660514065e9e6136d0d7ad0a96f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package at.hannibal2.skyhanni.config.features.garden;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.HasLegacyId;
import at.hannibal2.skyhanni.config.core.config.Position;
import at.hannibal2.skyhanni.features.garden.CropType;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDraggableList;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigLink;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;

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

public class NextJacobContestConfig {
    @Expose
    @ConfigOption(name = "Show Jacob's Contest", desc = "Show the current or next Jacob's farming contest time and crops.")
    @ConfigEditorBoolean
    @FeatureToggle
    public boolean display = true;

    @Expose
    @ConfigOption(name = "Outside Garden", desc = "Show the timer not only in the Garden but everywhere in SkyBlock.")
    @ConfigEditorBoolean
    public boolean showOutsideGarden = false;

    @Expose
    @ConfigOption(name = "In Other Guis", desc = "Mark the current or next Farming Contest crops in other farming GUIs as underlined.")
    @ConfigEditorBoolean
    public boolean otherGuis = false;

    @Expose
    @ConfigOption(name = "Fetch Contests", desc = "Automatically fetch Contests from elitebot.dev for the current year if they're uploaded already.")
    @ConfigEditorBoolean
    public boolean fetchAutomatically = true;

    @Expose
    @ConfigOption(name = "Share Contests", desc = "Share the list of upcoming Contests to elitebot.dev for everyone else to then fetch automatically.")
    @ConfigEditorDropdown
    public ShareContestsEntry shareAutomatically = ShareContestsEntry.ASK;

    public enum ShareContestsEntry implements HasLegacyId {
        ASK("Ask When Needed", 0),
        AUTO("Share Automatically", 1),
        DISABLED("Disabled", 2),
        ;

        private final String str;
        private final int legacyId;

        ShareContestsEntry(String str, int legacyId) {
            this.str = str;
            this.legacyId = legacyId;
        }

        // Constructor if new enum elements are added post-migration
        ShareContestsEntry(String str) {
            this(str, -1);
        }

        @Override
        public int getLegacyId() {
            return legacyId;
        }

        @Override
        public String toString() {
            return str;
        }
    }

    @Expose
    @ConfigOption(name = "Warning", desc = "Show a warning shortly before a new Jacob's Contest starts.")
    @ConfigEditorBoolean
    public boolean warn = false;

    @Expose
    @ConfigOption(name = "Warning Time", desc = "Set the warning time in seconds before a Jacob's Contest begins.")
    @ConfigEditorSlider(
        minValue = 10,
        maxValue = 60 * 5,
        minStep = 1
    )
    public int warnTime = 60 * 2;

    @Expose
    @ConfigOption(name = "Popup Warning", desc = "Create a popup when the warning time is reached and Minecraft is not in focus.")
    @ConfigEditorBoolean
    public boolean warnPopup = false;

    @Expose
    @ConfigOption(
        name = "Warn For",
        desc = "Only warn for these crops."
    )
    @ConfigEditorDraggableList
    public List<CropType> warnFor = new ArrayList<>(CropType.getEntries());

    @Expose
    @ConfigLink(owner = NextJacobContestConfig.class, field = "display")
    public Position pos = new Position(-200, 10, false, true);
}