aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/lorenz/mod/config/Features.java
blob: 43843df401208c0ee248ffdb57bab20e41807140 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
package at.lorenz.mod.config;

import at.lorenz.mod.LorenzMod;
import com.google.gson.annotations.Expose;
import com.thatgravyboat.skyblockhud_2.config.SBHConfigEditor;
import com.thatgravyboat.skyblockhud_2.core.GuiElement;
import com.thatgravyboat.skyblockhud_2.core.GuiScreenElementWrapper;
import com.thatgravyboat.skyblockhud_2.core.config.Position;
import com.thatgravyboat.skyblockhud_2.core.config.annotations.*;
import com.thatgravyboat.skyblockhud_2.core.config.gui.GuiPositionEditor;
import net.minecraft.client.Minecraft;

public class Features {

    private void editOverlay(String activeConfig, int width, int height, Position position) {
        Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {}, () -> {}, () -> LorenzMod.screenToOpen = new GuiScreenElementWrapper(new SBHConfigEditor(LorenzMod.feature, activeConfig))));
    }

    public void executeRunnable(String runnableId) {
        String activeConfigCategory = null;
        if (Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) {
            GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen;
            GuiElement element = wrapper.element;
            if (element instanceof SBHConfigEditor) {
                activeConfigCategory = ((SBHConfigEditor) element).getSelectedCategoryName();
            }
        }

        if (runnableId.equals("petDisplay")) {
            editOverlay(activeConfigCategory, 200, 16, misc.petDisplayPos);
            return;
        }

        if (runnableId.equals("testPos")) {
            editOverlay(activeConfigCategory, 200, 16, test.testPos);
            return;
        }
    }

    @Expose
    @Category(name = "Chat", desc = "Chat related features.")
    public Chat chat = new Chat();

    @Expose
    @Category(name = "Dungeon", desc = "Features that change the catacombs dungeon experience.")
    public Dungeon dungeon = new Dungeon();

    @Expose
    @Category(name = "Item", desc = "Changing the behavior around items and the inventory.")
    public Inventory item = new Inventory();

    @Expose
    @Category(name = "Bazaar", desc = "Bazaar settings.")
    public Bazaar bazaar = new Bazaar();

    @Expose
    @Category(name = "Misc", desc = "Settings without a big category")
    public Misc misc = new Misc();

    @Expose
    @Category(name = "Test", desc = "Test stuff")
    public Test test = new Test();

    public static class Chat {

        @Expose
        @ConfigOption(name = "Chat Filter Types", desc = "")
        @ConfigEditorAccordion(id = 1)
        public boolean filterTypes = false;


        @Expose
        @ConfigOption(name = "HyPixel Hub", desc = "Block messages outside SkyBlock in the HyPixel lobby: player joins, loot boxes, prototype lobby messages, radiating generosity and HyPixel tournaments.")
        @ConfigEditorBoolean
        @ConfigAccordionId(id = 1)
        public boolean hypixelHub = false;

        @Expose
        @ConfigOption(name = "Empty", desc = "Hide all the empty messages from the chat.")
        @ConfigEditorBoolean
        @ConfigAccordionId(id = 1)
        public boolean empty = false;

        @Expose
        @ConfigOption(name = "Warping", desc = "Block 'sending request to join ..' and 'warping ..' messages.")
        @ConfigEditorBoolean
        @ConfigAccordionId(id = 1)
        public boolean warping = false;

        @Expose
        @ConfigOption(name = "Welcome", desc = "Hide the 'welcome to skyblock' message.")
        @ConfigEditorBoolean
        @ConfigAccordionId(id = 1)
        public boolean welcome = false;

        //TODO remove
        @Expose
        @ConfigOption(name = "Others", desc = "Hide other annoying messages.")
        @ConfigEditorBoolean
        @ConfigAccordionId(id = 1)
        public boolean others = false;

        @Expose
        @ConfigOption(name = "Player Messages", desc = "Add a fancy new chat format for player messages.")
        @ConfigEditorBoolean
        public boolean playerMessages = false;

        @Expose
        @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages inside dungeon.")
        @ConfigEditorBoolean
        public boolean dungeonMessages = false;
    }

    public static class Dungeon {

        @Expose
        @ConfigOption(name = "Clicked Blocks", desc = "Highlight the following blocks when clicked in dungeon: Lever, Chest, Wither Essence")
        @ConfigEditorBoolean
        public boolean highlightClickedBlocks = false;
    }

    public static class Inventory {

        @Expose
        @ConfigOption(name = "Not Clickable Items", desc = "Hide items that are not clickable in " + "the current inventory: ah, bz, accessory bag, etc")
        @ConfigEditorBoolean
        public boolean hideNotClickableItems = false;

        @Expose
        @ConfigOption(name = "Master Star Number", desc = "Shows the Tier of the Master Star.")
        @ConfigEditorBoolean
        public boolean displayMasterStarNumber = false;

        @Expose
        @ConfigOption(name = "Master Skull Number", desc = "Shows the tier of the Master Skull accessory.")
        @ConfigEditorBoolean
        public boolean displayMasterSkullNumber = false;

        @Expose
        @ConfigOption(name = "Dungeon Head Floor", desc = "Shows the correct floor for golden and diamond heads.")
        @ConfigEditorBoolean
        public boolean displayDungeonHeadFloor = false;

        @Expose
        @ConfigOption(name = "New Year Cake", desc = "Shows the Number of the Year of New Year Cakes.")
        @ConfigEditorBoolean
        public boolean displayNewYearCakeNumber = false;

        @Expose
        @ConfigOption(name = "Pet Level", desc = "Shows the level of the pet when not maxed.")
        @ConfigEditorBoolean
        public boolean displayPetLevel = false;

        @Expose
        @ConfigOption(name = "Sack Name", desc = "Shows an abbreviation of the Sack name.")
        @ConfigEditorBoolean
        public boolean displaySackName = false;

        @Expose
        @ConfigOption(name = "Minion Tier", desc = "Shows the Minion Tier over Items.")
        @ConfigEditorBoolean
        public boolean displayMinionTier = false;
    }

    public static class Bazaar {

        @Expose
        @ConfigOption(name = "Order Helper", desc = "Show visual hints inside the Bazaar Manage Order view when items are ready to pickup or outbid.")
        @ConfigEditorBoolean
        public boolean orderHelper = false;
    }

    public static class Misc {

        @Expose
        @ConfigOption(name = "Pet Display", desc = "Shows the current active pet.")
        @ConfigEditorBoolean
        public boolean petDisplay = false;

        @Expose
        @ConfigOption(name = "Pet Display Position", desc = "")
        @ConfigEditorButton(runnableId = "petDisplay", buttonText = "Edit")
        public Position petDisplayPos = new Position(10, 10, false, true);

        @Expose
        @ConfigOption(name = "Exp Bottles", desc = "Hides all the experience bottles lying on the ground.")
        @ConfigEditorBoolean
        public boolean hideExpBottles = false;
    }

    public static class Test {

        @Expose
        @ConfigOption(name = "Enable Test", desc = "Enable Test logic")
        @ConfigEditorBoolean
        public boolean enabled = false;

        @Expose
        @ConfigOption(name = "Test Location", desc = "")
        @ConfigEditorButton(runnableId = "testPos", buttonText = "Edit")
        public Position testPos = new Position(10, 10, false, true);
    }
}