aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-03-25 03:02:33 +0100
committernea <nea@nea.moe>2023-03-26 16:37:00 +0200
commit8e60ad16e8047b2020b6c9812f63fead5c24b38f (patch)
tree8a772952d673b08a466962f773efccf89b2364bf
parentbe9c21fcce084b7c271222a71d9e72762075d2a3 (diff)
downloadSkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.tar.gz
SkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.tar.bz2
SkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.zip
The non controversial config changes
-rw-r--r--build.gradle.kts9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigEditor.java884
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigGuiForgeInterop.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java248
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/ChromaColour.java111
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GlScissorStack.java104
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GuiElement.java30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GuiElementBoolean.java147
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GuiElementColour.java449
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java685
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/GuiScreenElementWrapper.java53
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/Config.java24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/KeybindHelper.java67
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/PositionNew.java211
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/Category.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigAccordionId.java31
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorAccordion.java31
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorBoolean.java31
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorButton.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorColour.java29
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorDraggableList.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorDropdown.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorFSR.java33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorKeybind.java31
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorSlider.java35
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorText.java29
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigOption.java35
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditor.java82
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorAccordion.java101
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorBoolean.java71
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorButton.java87
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorColour.java88
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorDraggableList.java342
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorDropdown.java202
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorFSR.java82
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorKeybind.java113
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorSlider.java152
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorText.java103
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/struct/ConfigProcessor.java219
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/GuiElementSlider.java124
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/Line.java115
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/MiscUtils.java127
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/Splitters.java26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/StringUtils.java77
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/Vec3Comparable.java148
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpUtils.java43
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpingFloat.java86
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpingInteger.java94
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/render/GuiRenderUtils.java391
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/util/render/TextRenderUtils.java345
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Ashfang.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Bazaar.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Chat.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/CommandsFeatures.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DamageIndicator.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/DevData.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Diana.java6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Dungeon.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Fishing.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/GUI.java13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java36
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/ItemAbilities.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/MarkedPlayers.java11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Minions.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Misc.java21
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Mobs.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Summonings.java8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenCustomKeybinds.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt39
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt4
80 files changed, 181 insertions, 6737 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 8f2f36e77..8eeec210f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -40,6 +40,10 @@ val shadowImpl by configurations.creating {
configurations.implementation.get().extendsFrom(this)
}
+val shadowModImpl by configurations.creating {
+ configurations.modImplementation.get().extendsFrom(this)
+}
+
val devenvMod by configurations.creating {
isTransitive = false
isVisible = false
@@ -66,6 +70,8 @@ dependencies {
implementation("com.github.hannibal002:notenoughupdates:4957f0b:all")
devenvMod("com.github.hannibal002:notenoughupdates:4957f0b:all")
+
+ shadowModImpl("com.github.notenoughupdates:moulconfig:444eda2")
}
// Minecraft configuration:
@@ -128,8 +134,7 @@ tasks.shadowJar {
}
}
- // If you want to include other dependencies and shadow them, you can relocate them in here
-// fun relocate(name: String) = relocate(name, "com.examplemod.deps.$name")
+ relocate("io.github.moulberry.moulconfig", "at.hannibal2.skyhanni.deps.moulconfig")
}
tasks.assemble.get().dependsOn(tasks.remapJar)
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index f3909ebce..3b2100afc 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -52,6 +52,7 @@ import at.hannibal2.skyhanni.test.LorenzTest;
import at.hannibal2.skyhanni.test.PacketTest;
import at.hannibal2.skyhanni.utils.MinecraftConsoleFilter;
import at.hannibal2.skyhanni.utils.TabListData;
+import io.github.moulberry.moulconfig.processor.MoulConfigProcessor;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlinx.coroutines.*;
import net.minecraft.client.Minecraft;
diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigEditor.java b/src/main/java/at/hannibal2/skyhanni/config/ConfigEditor.java
deleted file mode 100644
index f0e4398d5..000000000
--- a/src/main/java/at/hannibal2/skyhanni/config/ConfigEditor.java
+++ /dev/null
@@ -1,884 +0,0 @@
-/*
- * Copyright (C) 2022 NotEnoughUpdates contributors
- *
- * This file is part of NotEnoughUpdates.
- *
- * NotEnoughUpdates is free software: you can redistribute it
- * and/or modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation, either
- * version 3 of the License, or (at your option) any later version.
- *
- * NotEnoughUpdates is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
- */
-
-package at.hannibal2.skyhanni.config;
-
-import at.hannibal2.skyhanni.SkyHanniMod;
-import at.hannibal2.skyhanni.config.core.GlScissorStack;
-import at.hannibal2.skyhanni.config.core.GuiElement;
-import at.hannibal2.skyhanni.config.core.GuiElementTextField;
-import at.hannibal2.skyhanni.config.core.config.gui.GuiOptionEditor;
-import at.hannibal2.skyhanni.config.core.config.gui.GuiOptionEditorAccordion;
-import at.hannibal2.skyhanni.config.core.config.struct.ConfigProcessor;
-import at.hannibal2.skyhanni.config.core.util.lerp.LerpUtils;
-import at.hannibal2.skyhanni.config.core.util.lerp.LerpingInteger;
-import at.hannibal2.skyhanni.config.core.util.render.GuiRenderUtils;
-import at.hannibal2.skyhanni.config.core.util.render.TextRenderUtils;
-import at.hannibal2.skyhanni.utils.StringUtils;
-import com.google.common.collect.Lists;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.Gui;
-import net.minecraft.client.gui.ScaledResolution;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.input.Keyboard;
-import org.lwjgl.input.Mouse;
-import org.lwjgl.opengl.GL11;
-
-import java.awt.*;
-import java.net.URI;
-import java.util.List;
-import java.util.*;
-
-import static at.hannibal2.skyhanni.config.GuiTextures.DISCORD;
-import static at.hannibal2.skyhanni.config.GuiTextures.GITHUB;
-
-public class ConfigEditor extends GuiElement {
- private static final ResourceLocation[] socialsIco = new ResourceLocation[]{
- DISCORD, GITHUB
- };
- private static final String[] socialsLink = new String[]{
- "https://discord.gg/8DXVN4BJz3",
- "https://github.com/hannibal002/SkyHanni"
- };
- private static final ResourceLocation SEARCH_ICON = new ResourceLocation("notenoughupdates:core/search.png");
- public static ConfigEditor editor = new ConfigEditor(SkyHanniMod.feature);
- private final long openedMillis;
- private final LerpingInteger optionsScroll = new LerpingInteger(0, 150);
- private final LerpingInteger categoryScroll = new LerpingInteger(0, 150);
- private final LinkedHashMap<String, ConfigProcessor.ProcessedCategory> processedConfig;
- private final TreeMap<String, Set<ConfigProcessor.ProcessedOption>> searchOptionMap = new TreeMap<>();
- private final HashMap<ConfigProcessor.ProcessedOption, ConfigProcessor.ProcessedCategory> categoryForOption =
- new HashMap<>();
- private final LerpingInteger minimumSearchSize = new LerpingInteger(0, 150);
- private final GuiElementTextField searchField = new GuiElementTextField("", 0, 20, 0);
- private String selectedCategory = null;
- private Set<ConfigProcessor.ProcessedCategory> searchedCategories = null;
- private Map<ConfigProcessor.ProcessedCategory, Set<Integer>> searchedAccordions = null;
- private Set<ConfigProcessor.ProcessedOption> searchedOptions = null;
- private float optionsBarStart;
- private float optionsBarend;
- private int lastMouseX = 0;
- private int keyboardScrollXCutoff = 0;
-
- public ConfigEditor(Features config) {
- this(config, null);
- }
-
- public ConfigEditor(Features config, String categoryOpen) {
- this.openedMillis = System.currentTimeMillis();
- this.processedConfig = ConfigProcessor.create(config);
-
- for (ConfigProcessor.ProcessedCategory category : processedConfig.values()) {
- for (ConfigProcessor.ProcessedOption option : category.options.values()) {
- categoryForOption.put(option, category);
-
- String combined = category.name + " " + category.desc + " " + option.name + " " + option.desc;
- combined = combined.replaceAll("[^a-zA-Z_ ]", "").toLowerCase();
- for (String word : combined.split("[ _]")) {
- searchOptionMap.computeIfAbsent(word, k -> new HashSet<>()).add(option);
- }
- }
- }
-
- if (categoryOpen != null) {
- for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
- if (category.getValue().name.equalsIgnoreCase(categoryOpen)) {
- selectedCategory = category.getKey();
- break;
- }
- }
- if (selectedCategory == null) {
- for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
- if (category.getValue().name.toLowerCase().startsWith(categoryOpen.toLowerCase())) {
- selectedCategory = category.getKey();
- break;
- }
- }
- }
- if (selectedCategory == null) {
- for (Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
- if (category.getValue().name.toLowerCase().contains(categoryOpen.toLowerCase())) {
- selectedCategory = category.getKey();
- break;
- }
- }
- }
- }
-
- editor = this;
- }
-
- private LinkedHashMap<String, ConfigProcessor.ProcessedCategory> getCurrentConfigEditing() {
- LinkedHashMap<String, ConfigProcessor.ProcessedCategory> newMap = new LinkedHashMap<>(processedConfig);
- if (searchedCategories != null) newMap.values().retainAll(searchedCategories);
- return newMap;
- }
-
- private LinkedHashMap<String, ConfigProcessor.ProcessedOption> getOptionsInCategory(ConfigProcessor.ProcessedCategory cat) {
- LinkedHashMap<String, ConfigProcessor.ProcessedOption> newMap = new LinkedHashMap<>(cat.options);
-
- if (searchedOptions != null) {
<