diff --git a/common/src/main/java/com/seibel/lod/common/Config.java b/common/src/main/java/com/seibel/lod/common/Config.java index 25c7f4f0f..e3f0e8306 100644 --- a/common/src/main/java/com/seibel/lod/common/Config.java +++ b/common/src/main/java/com/seibel/lod/common/Config.java @@ -25,6 +25,8 @@ import com.seibel.lod.core.enums.rendering.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IAdvanced.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.*; +import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.IFogQuality.IAdvancedFog; +import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IGraphics.IFogQuality.IAdvancedFog.IHeightFog; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IWorldGenerator; @@ -153,6 +155,84 @@ public class Config public static String _disableVanillaFog = IFogQuality.DISABLE_VANILLA_FOG_DESC; @ConfigAnnotations.Entry public static boolean disableVanillaFog = IFogQuality.DISABLE_VANILLA_FOG_DEFAULT; + + @ConfigAnnotations.ScreenEntry + public static AdvancedFog advancedFog; + + public static class AdvancedFog { + static final double SQRT2 = 1.4142135623730951; + + @ConfigAnnotations.FileComment + public static String _farFogStart = IAdvancedFog.FAR_FOG_START_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = SQRT2) + public static double farFogStart = IAdvancedFog.FAR_FOG_START_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _farFogEnd = IAdvancedFog.FAR_FOG_END_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = SQRT2) + public static double farFogEnd = IAdvancedFog.FAR_FOG_END_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _farFogMin = IAdvancedFog.FAR_FOG_MIN_DESC; + @ConfigAnnotations.Entry(minValue = -5.0, maxValue = SQRT2) + public static double farFogMin = IAdvancedFog.FAR_FOG_MIN_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _farFogMax = IAdvancedFog.FAR_FOG_MAX_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = 5.0) + public static double farFogMax = IAdvancedFog.FAR_FOG_MAX_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _farFogType = IAdvancedFog.FAR_FOG_TYPE_DESC; + @ConfigAnnotations.Entry + public static FogSetting.Type farFogType = IAdvancedFog.FAR_FOG_TYPE_DEFAULT; + + @ConfigAnnotations.FileComment + public static String _farFogDensity = IAdvancedFog.FAR_FOG_DENSITY_DESC; + @ConfigAnnotations.Entry(minValue = 0.01, maxValue = 50.0) + public static double farFogDensity = IAdvancedFog.FAR_FOG_DENSITY_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.ScreenEntry + public static HeightFog HeightFog; + + public static class HeightFog { + + @ConfigAnnotations.FileComment + public static String _heightFogTMode = IHeightFog.HEIGHT_FOG_MODE_DESC; + @ConfigAnnotations.Entry + public static HeightFogMode heightFogMode = IHeightFog.HEIGHT_FOG_MODE_DEFAULT; + + @ConfigAnnotations.FileComment + public static String _heightFogStart = IHeightFog.HEIGHT_FOG_START_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = SQRT2) + public static double heightFogStart = IHeightFog.HEIGHT_FOG_START_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _heightFogEnd = IHeightFog.HEIGHT_FOG_END_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = SQRT2) + public static double heightFogEnd = IHeightFog.HEIGHT_FOG_END_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _heightFogMin = IHeightFog.HEIGHT_FOG_MIN_DESC; + @ConfigAnnotations.Entry(minValue = -5.0, maxValue = SQRT2) + public static double heightFogMin = IHeightFog.HEIGHT_FOG_MIN_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _heightFogMax = IHeightFog.HEIGHT_FOG_MAX_DESC; + @ConfigAnnotations.Entry(minValue = 0.0, maxValue = 5.0) + public static double heightFogMax = IHeightFog.HEIGHT_FOG_MAX_MIN_DEFAULT_MAX.defaultValue; + + @ConfigAnnotations.FileComment + public static String _heightFogType = IHeightFog.HEIGHT_FOG_TYPE_DESC; + @ConfigAnnotations.Entry + public static FogSetting.Type heightFogType = IHeightFog.HEIGHT_FOG_TYPE_DEFAULT; + + @ConfigAnnotations.FileComment + public static String _heightFogDensity = IHeightFog.HEIGHT_FOG_DENSITY_DESC; + @ConfigAnnotations.Entry(minValue = 0.01, maxValue = 50.0) + public static double heightFogDensity = IHeightFog.HEIGHT_FOG_DENSITY_MIN_DEFAULT_MAX.defaultValue; + } + } } diff --git a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java index 6bc9ce8f3..57299f134 100644 --- a/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java +++ b/common/src/main/java/com/seibel/lod/common/wrappers/config/LodConfigWrapperSingleton.java @@ -3,7 +3,6 @@ package com.seibel.lod.common.wrappers.config; import com.seibel.lod.core.enums.config.*; import com.seibel.lod.core.enums.rendering.*; import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton; -import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton.IClient.IMultiplayer; import com.seibel.lod.common.Config; /** @@ -211,6 +210,13 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton public static class FogQuality implements IFogQuality { + public final IAdvancedFog advancedFog; + + FogQuality() + { + advancedFog = new AdvancedFog(); + } + @Override public FogDistance getFogDistance() { @@ -263,6 +269,149 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.disableVanillaFog").value = newDisableVanillaFog; ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.disableVanillaFog"); } + + @Override + public IAdvancedFog advancedFog() { + return advancedFog; + } + + public static class AdvancedFog implements IAdvancedFog { + public final IHeightFog heightFog; + + public AdvancedFog() { + heightFog = new HeightFog(); + } + + @Override + public double getFarFogStart() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogStart; + } + @Override + public double getFarFogEnd() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogEnd; + } + @Override + public double getFarFogMin() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogMin; + } + @Override + public double getFarFogMax() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogMax; + } + @Override + public FogSetting.Type getFarFogType() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogType; + } + @Override + public double getFarFogDensity() { + return Config.Client.Graphics.FogQuality.AdvancedFog.farFogDensity; + } + + @Override + public void setFarFogStart(double newFarFogStart) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogStart").value = newFarFogStart; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogStart"); + } + @Override + public void setFarFogEnd(double newFarFogEnd) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogEnd").value = newFarFogEnd; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogEnd"); + } + @Override + public void setFarFogMin(double newFarFogMin) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogMin").value = newFarFogMin; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogMin"); + } + @Override + public void setFarFogMax(double newFarFogMax) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogMax").value = newFarFogMax; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogMax"); + } + @Override + public void setFarFogType(FogSetting.Type newFarFogType) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogType").value = newFarFogType; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogType"); + } + @Override + public void setFarFogDensity(double newFarFogDensity) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.farFogDensity").value = newFarFogDensity; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.farFogDensity"); + } + + @Override + public IHeightFog heightFog() { + return heightFog; + } + + public static class HeightFog implements IHeightFog { + + @Override + public HeightFogMode getHeightFogMode() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMode; + } + @Override + public double getHeightFogStart() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogStart; + } + @Override + public double getHeightFogEnd() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogEnd; + } + @Override + public double getHeightFogMin() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMin; + } + @Override + public double getHeightFogMax() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogMax; + } + @Override + public FogSetting.Type getHeightFogType() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogType; + } + @Override + public double getHeightFogDensity() { + return Config.Client.Graphics.FogQuality.AdvancedFog.HeightFog.heightFogDensity; + } + + @Override + public void setHeightFogType(HeightFogMode newHeightFogMode) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogMode").value = newHeightFogMode; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogMode"); + } + @Override + public void setHeightFogStart(double newHeightFogStart) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogStart").value = newHeightFogStart; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogStart"); + } + @Override + public void setHeightFogEnd(double newHeightFogEnd) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogEnd").value = newHeightFogEnd; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogEnd"); + } + @Override + public void setHeightFogMin(double newHeightFogMin) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogMin").value = newHeightFogMin; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogMin"); + } + @Override + public void setHeightFogMax(double newHeightFogMax) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogMax").value = newHeightFogMax; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogMax"); + } + @Override + public void setHeightFogType(FogSetting.Type newHeightFogType) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogType").value = newHeightFogType; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogType"); + } + @Override + public void setHeightFogDensity(double newHeightFogDensity) { + ConfigGui.editSingleOption.getEntry("client.graphics.fogQuality.advancedFog.heightFog.heightFogDensity").value = newHeightFogDensity; + ConfigGui.editSingleOption.saveOption("client.graphics.fogQuality.advancedFog.heightFog.heightFogDensity"); + } + } + } + } diff --git a/core b/core index d2056d824..1c0e7839c 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit d2056d824f5cb7aa6b40aa747b8e2de7c06cd8a8 +Subproject commit 1c0e7839c066ed96754de3f46186a240dd7fcc66