aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2023-03-29 21:59:35 +0200
committerGitHub <noreply@github.com>2023-03-29 21:59:35 +0200
commit74dddef692b944a16e82f7f55ddb9846abaec2e8 (patch)
tree9607abb880d04125226befcf946cbfebbac7e2ae
parent0a6ae67c122057dddbc8c6c94aa8484aa5f654e9 (diff)
parent96808d7d3c2dd1abd8d619b4b97d075db6a154e0 (diff)
downloadSkyHanni-74dddef692b944a16e82f7f55ddb9846abaec2e8.tar.gz
SkyHanni-74dddef692b944a16e82f7f55ddb9846abaec2e8.tar.bz2
SkyHanni-74dddef692b944a16e82f7f55ddb9846abaec2e8.zip
Merge pull request #22
The non controversial config changes
-rw-r--r--build.gradle.kts14
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java4
-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/ConfigGuiManager.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/ConfigManager.kt50
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Features.java252
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt9
-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.java11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java34
-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.kt9
-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
81 files changed, 231 insertions, 6746 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 641c114b3..c020d8936 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,9 @@ dependencies {
implementation("com.github.hannibal002:notenoughupdates:4957f0b:all")
devenvMod("com.github.hannibal002:notenoughupdates:4957f0b:all")
+
+ shadowModImpl("com.github.notenoughupdates:moulconfig:df01eda")
+ devenvMod("com.github.notenoughupdates:moulconfig:df01eda:test")
}
// Minecraft configuration:
@@ -121,15 +128,14 @@ val remapJar by tasks.named<net.fabricmc.loom.task.RemapJarTask>("remapJar") {
tasks.shadowJar {
archiveClassifier.set("all-dev")
- configurations = listOf(shadowImpl)
+ configurations = listOf(shadowImpl, shadowModImpl)
doLast {
configurations.forEach {
println("Config: ${it.files}")
}
}
- // 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)
@@ -141,4 +147,4 @@ compileKotlin.kotlinOptions {
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
-} \ No newline at end of file
+}
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index a242ccbc8..073c4e514 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -84,6 +84,9 @@ public class SkyHanniMod {
public static RepoManager repo;
public static ConfigManager configManager;
private static Logger logger;
+ public static org.slf4j.Logger getLogger(String name) {
+ return org.slf4j.LoggerFactory.getLogger("SkyHanni." + name);
+ }
public static List<Object> modules = new ArrayList<>();
public static Job globalJob = JobKt.Job(null);
@@ -244,7 +247,6 @@ public class SkyHanniMod {
configManager = new ConfigManager();
configManager.firstLoad();
- new FirstConfigLoadedEvent().postAndCatch();
MinecraftConsoleFilter.Companion.initLogging();
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;
-