diff options
| author | nea <nea@nea.moe> | 2023-03-25 03:02:33 +0100 |
|---|---|---|
| committer | nea <nea@nea.moe> | 2023-03-26 16:37:00 +0200 |
| commit | 8e60ad16e8047b2020b6c9812f63fead5c24b38f (patch) | |
| tree | 8a772952d673b08a466962f773efccf89b2364bf | |
| parent | be9c21fcce084b7c271222a71d9e72762075d2a3 (diff) | |
| download | SkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.tar.gz SkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.tar.bz2 SkyHanni-8e60ad16e8047b2020b6c9812f63fead5c24b38f.zip | |
The non controversial config changes
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) { < |
