diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index 0784ea9d0..d086e3527 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java @@ -131,6 +131,8 @@ public class Config // since they aren't part of "client" config class // TODO determine their destination programically instead of hard coding the value + public static ConfigUIComment advancedHeader = new ConfigUIComment.Builder().setParentConfigClass(Advanced.class).build(); + public static ConfigCategory graphics = new ConfigCategory.Builder().set(Graphics.class).build(); public static ConfigCategory worldGenerator = new ConfigCategory.Builder().set(Common.WorldGenerator.class).setDestination("common.worldGenerator").build(); public static ConfigCategory multiplayer = new ConfigCategory.Builder().set(Multiplayer.class).build(); @@ -146,23 +148,32 @@ public class Config public static class Graphics { + public static ConfigUIComment advancedGraphicsHeader = new ConfigUIComment.Builder().setParentConfigClass(Graphics.class).build(); + public static ConfigCategory quality = new ConfigCategory.Builder().set(Quality.class).build(); + public static ConfigUISpacer qualitySpacer = new ConfigUISpacer.Builder().build(); public static ConfigUiLinkedEntry quickEnableSsao = new ConfigUiLinkedEntry(Ssao.enableSsao); public static ConfigCategory ssao = new ConfigCategory.Builder().set(Ssao.class).build(); + public static ConfigUISpacer ssaoSpacer = new ConfigUISpacer.Builder().build(); + public static ConfigUiLinkedEntry quickEnableGenericRendering = new ConfigUiLinkedEntry(GenericRendering.enableGenericRendering); public static ConfigCategory genericRendering = new ConfigCategory.Builder().set(GenericRendering.class).build(); + public static ConfigUISpacer genericRenderingSpacer = new ConfigUISpacer.Builder().build(); public static ConfigUiLinkedEntry quickEnableDhFog = new ConfigUiLinkedEntry(Fog.enableDhFog); public static ConfigUiLinkedEntry quickEnableMcFog = new ConfigUiLinkedEntry(Fog.enableVanillaFog); public static ConfigCategory fog = new ConfigCategory.Builder().set(Fog.class).build(); + public static ConfigUISpacer fogSpacer = new ConfigUISpacer.Builder().build(); public static ConfigUiLinkedEntry quickEnableNoiseTexture = new ConfigUiLinkedEntry(NoiseTexture.enableNoiseTexture); public static ConfigCategory noiseTexture = new ConfigCategory.Builder().set(NoiseTexture.class).build(); + public static ConfigUISpacer noiseTextureSpacer = new ConfigUISpacer.Builder().build(); public static ConfigUiLinkedEntry quickEnableCaveCulling = new ConfigUiLinkedEntry(Culling.enableCaveCulling); public static ConfigCategory culling = new ConfigCategory.Builder().set(Culling.class).build(); + public static ConfigUISpacer cullingSpacer = new ConfigUISpacer.Builder().build(); public static ConfigCategory experimental = new ConfigCategory.Builder().set(Experimental.class).build(); @@ -170,6 +181,8 @@ public class Config public static class Quality { + public static ConfigUIComment qualityHeader = new ConfigUIComment.Builder().setParentConfigClass(Quality.class).build(); + public static ConfigEntry lodChunkRenderDistanceRadius = new ConfigEntry.Builder() .setMinDefaultMax(32, 256, 4096) .comment("" + @@ -351,6 +364,8 @@ public class Config public static class Ssao { + public static ConfigUIComment ssaoHeader = new ConfigUIComment.Builder().setParentConfigClass(Ssao.class).build(); + public static ConfigEntry enableSsao = new ConfigEntry.Builder() .set(true) .comment("Enable Screen Space Ambient Occlusion") @@ -413,6 +428,8 @@ public class Config public static class GenericRendering { + public static ConfigUIComment genericRendererHeader = new ConfigUIComment.Builder().setParentConfigClass(GenericRendering.class).build(); + public static ConfigEntry enableGenericRendering = new ConfigEntry.Builder() .set(true) .comment("" @@ -460,6 +477,8 @@ public class Config + public static ConfigUIComment fogHeader = new ConfigUIComment.Builder().setParentConfigClass(Fog.class).build(); + public static ConfigEntry enableDhFog = new ConfigEntry.Builder() .set(true) .comment("" @@ -561,6 +580,8 @@ public class Config public static class HeightFog { + public static ConfigUIComment heightFogHeader = new ConfigUIComment.Builder().setParentConfigClass(HeightFog.class).build(); + public static ConfigEntry heightFogMixMode = new ConfigEntry.Builder() .set(EDhApiHeightFogMixMode.SPHERICAL) .comment("" @@ -656,6 +677,8 @@ public class Config public static class NoiseTexture { + public static ConfigUIComment noiseTextureHeader = new ConfigUIComment.Builder().setParentConfigClass(NoiseTexture.class).build(); + public static ConfigEntry enableNoiseTexture = new ConfigEntry.Builder() .set(true) .comment("" @@ -690,6 +713,8 @@ public class Config public static class Culling { + public static ConfigUIComment cullingHeader = new ConfigUIComment.Builder().setParentConfigClass(Culling.class).build(); + public static ConfigEntry overdrawPrevention = new ConfigEntry.Builder() .setMinDefaultMax(0.0, 0.0, 1.0) // TODO change -1 to auto .comment("" @@ -814,6 +839,8 @@ public class Config public static class Experimental { + public static ConfigUIComment experimentalHeader = new ConfigUIComment.Builder().setParentConfigClass(Experimental.class).build(); + public static ConfigEntry earthCurveRatio = new ConfigEntry.Builder() .setMinDefaultMax(0, 0, 5000) .comment("" @@ -836,6 +863,8 @@ public class Config public static class AutoUpdater { + public static ConfigUIComment autoUpdaterHeader = new ConfigUIComment.Builder().setParentConfigClass(AutoUpdater.class).build(); + public static ConfigEntry enableAutoUpdater = new ConfigEntry.Builder() .set(!isRunningInDevEnvironment()) .comment("" @@ -863,6 +892,8 @@ public class Config public static class Multiplayer { + public static ConfigUIComment multiplayerHeader = new ConfigUIComment.Builder().setParentConfigClass(Multiplayer.class).build(); + public static ConfigEntry serverFolderNameMode = new ConfigEntry.Builder() .set(EDhApiServerFolderNameMode.NAME_ONLY) .comment("" @@ -879,6 +910,8 @@ public class Config public static class Debugging { + public static ConfigUIComment debuggingHeader = new ConfigUIComment.Builder().setParentConfigClass(Debugging.class).build(); + public static ConfigEntry rendererMode = new ConfigEntry.Builder() .set(EDhApiRendererMode.DEFAULT) .comment("" @@ -967,6 +1000,8 @@ public class Config public static class DebugWireframe { + public static ConfigUIComment debugWireframeHeader = new ConfigUIComment.Builder().setParentConfigClass(DebugWireframe.class).build(); + public static ConfigEntry enableRendering = new ConfigEntry.Builder() .set(false) .comment("" @@ -1016,6 +1051,8 @@ public class Config public static class OpenGl { + public static ConfigUIComment openGlHeader = new ConfigUIComment.Builder().setParentConfigClass(OpenGl.class).build(); + public static ConfigEntry overrideVanillaGLLogger = new ConfigEntry.Builder() .set(true) .comment("" @@ -1063,6 +1100,8 @@ public class Config public static class ColumnBuilderDebugging { + public static ConfigUIComment columnBuilderDebuggingHeader = new ConfigUIComment.Builder().setParentConfigClass(ColumnBuilderDebugging.class).build(); + public static ConfigEntry columnBuilderDebugEnable = new ConfigEntry.Builder() .set(false) .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) @@ -1104,6 +1143,8 @@ public class Config public static class F3Screen { + public static ConfigUIComment f3ScreenHeader = new ConfigUIComment.Builder().setParentConfigClass(F3Screen.class).build(); + public static ConfigEntry showPlayerPos = new ConfigEntry.Builder() .set(true) .comment("Shows the player's LOD position.") @@ -1147,8 +1188,10 @@ public class Config // This will throw a warning when opened in the default ui to tell you about it not showing public static class ExampleConfigScreen { + public static ConfigUIComment exampleConfigHeader = new ConfigUIComment.Builder().setParentConfigClass(ExampleConfigScreen.class).build(); + // Defined in the lang, just a note about this screen - public static ConfigUIComment debugConfigScreenNote = new ConfigUIComment(); + public static ConfigUIComment debugConfigScreenNote = new ConfigUIComment.Builder().setTextPosition(EConfigCommentTextPosition.CENTER_OF_SCREEN).build(); public static ConfigEntry boolTest = new ConfigEntry.Builder() .set(false) @@ -1156,6 +1199,7 @@ public class Config public static ConfigEntry byteTest = new ConfigEntry.Builder() .set((byte) 8) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigEntry intTest = new ConfigEntry.Builder() @@ -1168,14 +1212,17 @@ public class Config public static ConfigEntry shortTest = new ConfigEntry.Builder() .set((short) 69) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigEntry longTest = new ConfigEntry.Builder() .set(42069L) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigEntry floatTest = new ConfigEntry.Builder() .set(0.42069f) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigEntry stringTest = new ConfigEntry.Builder() @@ -1184,10 +1231,12 @@ public class Config public static ConfigEntry> listTest = new ConfigEntry.Builder>() .set(new ArrayList(Arrays.asList("option 1", "option 2", "option 3"))) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigEntry> mapTest = new ConfigEntry.Builder>() .set(new HashMap()) + .setAppearance(EConfigEntryAppearance.ONLY_IN_FILE) // no GUI renderer set up currently .build(); public static ConfigUIButton uiButtonTest = new ConfigUIButton(() -> @@ -1231,6 +1280,8 @@ public class Config { public static class WorldGenerator { + public static ConfigUIComment worldGeneratorHeader = new ConfigUIComment.Builder().setParentConfigClass(WorldGenerator.class).build(); + public static ConfigEntry enableDistantGeneration = new ConfigEntry.Builder() .setChatCommandName("generation.enable") .set(true) @@ -1324,6 +1375,8 @@ public class Config public static class LodBuilding { + public static ConfigUIComment lodBuildingHeader = new ConfigUIComment.Builder().setParentConfigClass(LodBuilding.class).build(); + public static ConfigEntry disableUnchangedChunkCheck = new ConfigEntry.Builder() .set(false) // enabling this can be quite detrimental to performance, @@ -1445,6 +1498,8 @@ public class Config public static class Experimental { + public static ConfigUIComment experimentalHeader = new ConfigUIComment.Builder().setParentConfigClass(Experimental.class).build(); + public static ConfigEntry upsampleLowerDetailLodsToFillHoles = new ConfigEntry.Builder() .set(false) .comment("" @@ -1467,6 +1522,8 @@ public class Config public static class MultiThreading { + public static ConfigUIComment multiThreadingHeader = new ConfigUIComment.Builder().setParentConfigClass(MultiThreading.class).build(); + public static final ConfigEntry numberOfThreads = new ConfigEntry.Builder() .setChatCommandName("threading.numberOfThreads") .setMinDefaultMax(1, @@ -1495,6 +1552,8 @@ public class Config public static class Logging { + public static ConfigUIComment loggingHeader = new ConfigUIComment.Builder().setParentConfigClass(Logging.class).build(); + // TODO add change all option // TODO default to error chat and info file public static ConfigEntry logWorldGenEvent = new ConfigEntry.Builder() @@ -1549,6 +1608,7 @@ public class Config public static class Warning { + public static ConfigUIComment warningHeader = new ConfigUIComment.Builder().setParentConfigClass(Warning.class).build(); public static ConfigEntry showLowMemoryWarningOnStartup = new ConfigEntry.Builder() .set(true) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java index e51595793..ebc3378dc 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/ConfigBase.java @@ -20,11 +20,9 @@ package com.seibel.distanthorizons.core.config; import com.seibel.distanthorizons.core.config.file.ConfigFileHandling; +import com.seibel.distanthorizons.core.config.types.*; +import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; -import com.seibel.distanthorizons.core.config.types.AbstractConfigType; -import com.seibel.distanthorizons.core.config.types.ConfigCategory; -import com.seibel.distanthorizons.core.config.types.ConfigEntry; -import com.seibel.distanthorizons.core.config.types.ConfigUiLinkedEntry; import com.seibel.distanthorizons.core.wrapperInterfaces.config.ILangWrapper; import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper; import org.apache.logging.log4j.LogManager; @@ -41,7 +39,7 @@ import java.util.*; * @author Ran * @version 2023-8-26 */ -// Init the config after singletons have been blinded +// Init the config after singletons have been bound public class ConfigBase { /** Our own config instance, don't modify unless you are the DH mod */ @@ -198,11 +196,11 @@ public class ConfigBase * Used for checking that all the lang files for the config exist. * This is just to re-format the lang or check if there is something in the lang that is missing * - * @param onlyShowNew If disabled then it would basically remake the config lang + * @param onlyShowMissing If false then this will remake the entire config lang * @param checkEnums Checks if all the lang for the enum's exist */ @SuppressWarnings("unchecked") - public String generateLang(boolean onlyShowNew, boolean checkEnums) + public String generateLang(boolean onlyShowMissing, boolean checkEnums) { ILangWrapper langWrapper = SingletonInjector.INSTANCE.get(ILangWrapper.class); List>> enumList = new ArrayList<>(); @@ -213,42 +211,74 @@ public class ConfigBase String separator = "\":\n \""; String ending = "\",\n"; + // config entries for (AbstractConfigType entry : this.entries) { - String entryPrefix = "lod.config." + entry.getNameWCategory(); + String entryPrefix = "distanthorizons.config." + entry.getNameWCategory(); - if (checkEnums && entry.getType().isEnum() && !enumList.contains(entry.getType())) - { // Put it in an enum list to work with at the end + if (checkEnums + && entry.getType().isEnum() + && !enumList.contains(entry.getType())) + { + // Put it in an enum list to work with at the end enumList.add((Class>) entry.getType()); } - if (!onlyShowNew || langWrapper.langExists(entryPrefix)) + + // config file items don't need lang entries + if (!entry.getAppearance().showInGui) { - if (!ConfigUiLinkedEntry.class.isAssignableFrom(entry.getClass())) - { // If it is a linked item, dont generate the base lang - generatedLang += starter - + entryPrefix - + separator - + langWrapper.getLang(entryPrefix) - + ending - ; - } - - // Adds tooltips - if (langWrapper.langExists(entryPrefix + ".@tooltip")) - { - generatedLang += starter - + entryPrefix + ".@tooltip" - + separator - + langWrapper.getLang(entryPrefix + ".@tooltip") - .replaceAll("\n", "\\\\n") - .replaceAll("\"", "\\\\\"") - + ending - ; - } + continue; + } + + // some entries don't need localization + if (ConfigUiLinkedEntry.class.isAssignableFrom(entry.getClass()) + || ConfigUISpacer.class.isAssignableFrom(entry.getClass())) + { + continue; + } + + if (ConfigUIComment.class.isAssignableFrom(entry.getClass()) + && ((ConfigUIComment)entry).parentConfigPath != null) + { + // TODO this could potentially add the same item multiple times + entryPrefix = "distanthorizons.config." + ((ConfigUIComment)entry).parentConfigPath; + } + + + if (langWrapper.langExists(entryPrefix) + && onlyShowMissing) + { + continue; + } + + + generatedLang += starter + + entryPrefix + + separator + + langWrapper.getLang(entryPrefix) + + ending + ; + + // only add tooltips for entries that are also missing + // their primary lang + // this is done since not all menu items need a tooltip + if (!langWrapper.langExists(entryPrefix + ".@tooltip") + || !onlyShowMissing) + { + generatedLang += starter + + entryPrefix + ".@tooltip" + + separator + + langWrapper.getLang(entryPrefix + ".@tooltip") + .replaceAll("\n", "\\\\n") + .replaceAll("\"", "\\\\\"") + + ending + ; } } + + // enums if (!enumList.isEmpty()) { generatedLang += "\n"; // Separate the main lang with the enum's @@ -257,9 +287,10 @@ public class ConfigBase { for (Object enumStr : new ArrayList(EnumSet.allOf(anEnum))) { - String enumPrefix = "lod.config.enum." + anEnum.getSimpleName() + "." + enumStr.toString(); + String enumPrefix = "distanthorizons.config.enum." + anEnum.getSimpleName() + "." + enumStr.toString(); - if (!onlyShowNew || langWrapper.langExists(enumPrefix)) + if (!langWrapper.langExists(enumPrefix) + || !onlyShowMissing) { generatedLang += starter + enumPrefix @@ -272,11 +303,6 @@ public class ConfigBase } } - // trim to remove any newlines/spaces - // that may be present when no lang entries need changing - // then we can check length != 0 if any items are missing and need adding - generatedLang = generatedLang.trim(); - return generatedLang; } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java index 12c5344ca..1008dfe75 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigEntry.java @@ -94,6 +94,8 @@ public class ConfigEntry extends AbstractConfigType> implem } @Override public T getApiValue() { return this.apiValue; } + @Override + public boolean apiValuePresent() { return this.apiValue != null; } @Override public boolean getAllowApiOverride() { return this.allowApiOverride; } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java index 206cd50e4..46dbb0e40 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUIComment.java @@ -19,7 +19,13 @@ package com.seibel.distanthorizons.core.config.types; +import com.seibel.distanthorizons.core.config.Config; +import com.seibel.distanthorizons.core.config.types.enums.EConfigCommentTextPosition; import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance; +import com.seibel.distanthorizons.core.logging.DhLoggerBuilder; +import org.apache.logging.log4j.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Adds something like a ConfigEntry but without a button to change the input @@ -28,11 +34,25 @@ import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance */ public class ConfigUIComment extends AbstractConfigType { - public ConfigUIComment() + private static final Logger LOGGER = DhLoggerBuilder.getLogger(); + + + public String parentConfigPath = null; + @Nullable + public EConfigCommentTextPosition textPosition = null; + + + + public ConfigUIComment() { this(null, null); } + public ConfigUIComment(String parentConfigPath, EConfigCommentTextPosition textPosition) { super(EConfigEntryAppearance.ONLY_IN_GUI, ""); + this.parentConfigPath = parentConfigPath; + this.textPosition = textPosition; } + + /** Appearance shouldn't be changed */ @Override public void setAppearance(EConfigEntryAppearance newAppearance) { } @@ -41,26 +61,102 @@ public class ConfigUIComment extends AbstractConfigType @Override public void set(String newValue) { } + + public static class Builder extends AbstractConfigType.Builder { + public String tempParentConfigPath = null; + public EConfigCommentTextPosition tempTextPosition = null; + + + /** Appearance shouldn't be changed */ + @Deprecated @Override - public Builder setAppearance(EConfigEntryAppearance newAppearance) - { - return this; - } + public Builder setAppearance(EConfigEntryAppearance newAppearance) { return this; } /** Pointless to set the value */ + @Deprecated @Override public Builder set(String newValue) + { return this; } + + + public Builder setParentConfigClass(@NotNull Class parentConfigClass) { + // expected format: "Config.Client.Advanced" + String packageName = parentConfigClass.getPackage().getName(); // com.seibel.distanthorizons.core.config + String fullName = parentConfigClass.getName(); // com.seibel.distanthorizons.core.config.Config$Common$MultiThreading + + try + { + String configPath = fullName.substring( + packageName.length() + // "com.seibel.distanthorizons.core.config" + 1 + // "." before "Config" + Config.class.getSimpleName().length() + // "Config" + 1); // "$" before the inner class name + + // configPath after substring: + // Config$Common$MultiThreading + + this.tempParentConfigPath = convertPackageNameToLangPath(configPath); // client.advanced.graphics.Quality + } + catch (Exception e) + { + this.tempParentConfigPath = parentConfigClass.getSimpleName(); + LOGGER.warn("Failed to parse config class: ["+fullName+"], error: ["+e.getMessage()+"], defaulting to: ["+this.tempParentConfigPath+"].", e); + } + return this; } + /** + * example: + * input: "Client$Advanced$multiThreading" + * output: "client.advanced.multiThreading" + */ + public static String convertPackageNameToLangPath(String input) + { + StringBuilder result = new StringBuilder(input.length()); + + for (int i = 0; i < input.length(); i++) + { + char ch = input.charAt(i); + if (i == 0) + { + result.append(Character.toLowerCase(ch)); + continue; + } + + // replace '$' -> '.' to match lang path naming + if (ch == '$') + { + result.append('.'); + continue; + } + + char lastCh = input.charAt(i-1); + if (lastCh == '$') + { + result.append(Character.toLowerCase(ch)); + continue; + } + + result.append(ch); + } + return result.toString(); + } + + + public Builder setTextPosition(EConfigCommentTextPosition textPosition) + { + this.tempTextPosition = textPosition; + return this; + } + + public ConfigUIComment build() - { - return new ConfigUIComment(); - } + { return new ConfigUIComment(this.tempParentConfigPath, this.tempTextPosition); } } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUISpacer.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUISpacer.java new file mode 100644 index 000000000..43d870cdf --- /dev/null +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUISpacer.java @@ -0,0 +1,59 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020 James Seibel + * + * This program 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, version 3. + * + * This program 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 this program. If not, see . + */ + +package com.seibel.distanthorizons.core.config.types; + +import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance; + +/** + * Adds empty space the height of a button. + * Useful for separating different categories. + */ +public class ConfigUISpacer extends AbstractConfigType +{ + public ConfigUISpacer() + { super(EConfigEntryAppearance.ONLY_IN_GUI, ""); } + + + + /** Appearance shouldn't be changed */ + @Override + public void setAppearance(EConfigEntryAppearance newAppearance) { } + + /** Pointless to set the value */ + @Override + public void set(String newValue) { } + + + + public static class Builder extends AbstractConfigType.Builder + { + /** Appearance shouldn't be changed */ + @Override + public Builder setAppearance(EConfigEntryAppearance newAppearance) { return this; } + + /** Pointless to set the value */ + @Override + public Builder set(String newValue) { return this; } + + public ConfigUISpacer build() { return new ConfigUISpacer(); } + + } + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUiLinkedEntry.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUiLinkedEntry.java index 7c04be21e..2e515951f 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUiLinkedEntry.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/ConfigUiLinkedEntry.java @@ -27,7 +27,6 @@ import com.seibel.distanthorizons.core.config.types.enums.EConfigEntryAppearance * * @author coolGi */ -@Deprecated // FIXME doesn't work with localization public class ConfigUiLinkedEntry extends AbstractConfigType, ConfigUiLinkedEntry> { public ConfigUiLinkedEntry(AbstractConfigType value) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigCommentTextPosition.java b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigCommentTextPosition.java new file mode 100644 index 000000000..2266b90b7 --- /dev/null +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/types/enums/EConfigCommentTextPosition.java @@ -0,0 +1,32 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020 James Seibel + * + * This program 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, version 3. + * + * This program 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 this program. If not, see . + */ + +package com.seibel.distanthorizons.core.config.types.enums; + +/** + * RIGHT_OVER_BUTTONS
+ * CENTER_OF_SCREEN
+ * CENTERED_OVER_BUTTONS
+ */ +public enum EConfigCommentTextPosition +{ + RIGHT_JUSTIFIED, + CENTER_OF_SCREEN, + CENTERED_OVER_BUTTONS, +} diff --git a/core/src/main/resources/assets/distanthorizons/lang/en_us.json b/core/src/main/resources/assets/distanthorizons/lang/en_us.json index 6cd9460a7..52391a019 100644 --- a/core/src/main/resources/assets/distanthorizons/lang/en_us.json +++ b/core/src/main/resources/assets/distanthorizons/lang/en_us.json @@ -22,6 +22,12 @@ "Cancel", "distanthorizons.general.reset": "Reset", + "distanthorizons.general.spacer": + "", + "distanthorizons.general.apiOverride": + "API LOCK", + "distanthorizons.general.disabledByApi.@tooltip": + "This option is controlled by another mod via DH's API \nso it cannot be changed via the UI or config file.",