summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/config/features/chroma/ChromaConfig.java
blob: 6a02e2ed306194f4f7da3b9baa406717497caa9c (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
package at.hannibal2.skyhanni.config.features.chroma;

import at.hannibal2.skyhanni.config.FeatureToggle;
import at.hannibal2.skyhanni.config.HasLegacyId;
import at.hannibal2.skyhanni.features.chroma.ChromaManager;
import com.google.gson.annotations.Expose;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorBoolean;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorButton;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorDropdown;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorInfoText;
import io.github.notenoughupdates.moulconfig.annotations.ConfigEditorSlider;
import io.github.notenoughupdates.moulconfig.annotations.ConfigOption;
import io.github.notenoughupdates.moulconfig.observer.Property;

public class ChromaConfig {

    @Expose
    @ConfigOption(name = "Chroma Preview", desc = "§fPlease star SkyHanni on GitHub!")
    @ConfigEditorInfoText(infoTitle = "Only in SkyBlock")
    public boolean chromaPreview = false;

    @Expose
    @ConfigOption(name = "Enabled", desc = "Toggle SkyHanni's chroma. §e(Disables Patcher's Optimized Font Renderer while enabled)")
    @ConfigEditorBoolean
    @FeatureToggle
    public Property<Boolean> enabled = Property.of(false);

    @Expose
    @ConfigOption(name = "Chroma Size", desc = "Change the size of each color in the chroma.")
    @ConfigEditorSlider(minValue = 1f, maxValue = 100f, minStep = 1f)
    public float chromaSize = 30f;

    @Expose
    @ConfigOption(name = "Chroma Speed", desc = "Change how fast the chroma animation moves.")
    @ConfigEditorSlider(minValue = 0.5f, maxValue = 20f, minStep = 0.5f)
    public float chromaSpeed = 6f;

    @Expose
    @ConfigOption(name = "Chroma Saturation", desc = "Change the saturation of the chroma.")
    @ConfigEditorSlider(minValue = 0f, maxValue = 1f, minStep = 0.01f)
    public float chromaSaturation = 0.75f;

    @Expose
    @ConfigOption(name = "Chroma Direction", desc = "Change the slant and direction of the chroma.")
    @ConfigEditorDropdown
    public Direction chromaDirection = Direction.FORWARD_RIGHT;

    public enum Direction implements HasLegacyId {
        FORWARD_RIGHT("Forward + Right", 0),
        FORWARD_LEFT("Forward + Left", 1),
        BACKWARD_RIGHT("Backward + Right", 2),
        BACKWARD_LEFT("Backward + Left", 3);

        private final String str;
        private final int legacyId;

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

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

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

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

    @ConfigOption(name = "Reset to Default", desc = "Reset all chroma settings to the default.")
    @ConfigEditorButton(buttonText = "Reset")
    public Runnable resetSettings = ChromaManager::resetChromaSettings;

    @Expose
    @ConfigOption(name = "Everything Chroma", desc = "Render §4§l§oALL §r§7text in chroma. §e(Some enchants may appear white with SBA enchant parsing)")
    @ConfigEditorBoolean
    public boolean allChroma = false;

    @Expose
    @ConfigOption(name = "Ignore Chat", desc = "Prevent Everything Chroma from applying to the chat (if you unironically use that feature...)")
    @ConfigEditorBoolean
    public boolean ignoreChat = false;

}