diff --git a/src/main/java/com/gtnewhorizons/angelica/proxy/ClientProxy.java b/src/main/java/com/gtnewhorizons/angelica/proxy/ClientProxy.java index 77bf4b572..554f4c9e3 100644 --- a/src/main/java/com/gtnewhorizons/angelica/proxy/ClientProxy.java +++ b/src/main/java/com/gtnewhorizons/angelica/proxy/ClientProxy.java @@ -43,6 +43,7 @@ import cpw.mods.fml.relauncher.ReflectionHelper; import jss.notfine.core.Settings; import jss.notfine.gui.GuiCustomMenu; import jss.notfine.gui.NotFineGameOptionPages; +import jss.notfine.gui.options.named.FOVMode; import me.flashyreese.mods.reeses_sodium_options.client.gui.ReeseSodiumVideoOptionsScreen; import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions; import me.jellysquid.mods.sodium.client.gui.SodiumOptionsGUI; @@ -342,10 +343,19 @@ public final class ClientProxy extends CommonProxy { } } - // This is a bit of a hack to prevent the FOV from being modified by other mods + // This only disables FOV changes from vanilla, leaving mod FOV changes untouched + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onFOVModifierUpdateEarly(FOVUpdateEvent event) { + if(Settings.DYNAMIC_FOV.option.getStore() == FOVMode.MODS) { + event.fov = 1.0F; + event.newfov = 1.0F; + } + } + + // This removes all FOV dynamics, both from vanilla (speed/sprinting), and mods @SubscribeEvent(priority = EventPriority.LOWEST) - public void onFOVModifierUpdate(FOVUpdateEvent event) { - if (!(boolean) Settings.DYNAMIC_FOV.option.getStore()) { + public void onFOVModifierUpdateLate(FOVUpdateEvent event) { + if(Settings.DYNAMIC_FOV.option.getStore() == FOVMode.NONE) { event.newfov = 1.0F; } } diff --git a/src/main/java/jss/notfine/core/Settings.java b/src/main/java/jss/notfine/core/Settings.java index c2d47f321..3deaab463 100644 --- a/src/main/java/jss/notfine/core/Settings.java +++ b/src/main/java/jss/notfine/core/Settings.java @@ -11,6 +11,7 @@ import jss.notfine.gui.options.control.NotFineControlValueFormatter; import jss.notfine.gui.options.named.AlwaysNever; import jss.notfine.gui.options.named.BackgroundSelect; import jss.notfine.gui.options.named.DownfallQuality; +import jss.notfine.gui.options.named.FOVMode; import jss.notfine.gui.options.named.GraphicsQualityOff; import jss.notfine.gui.options.named.LeavesQuality; import jss.notfine.gui.options.named.GraphicsToggle; @@ -49,7 +50,7 @@ public enum Settings { SettingsManager.downfallDistanceUpdated(); } }, - DYNAMIC_FOV(new NotFineOptionTickBox(true, null)), + DYNAMIC_FOV(new NotFineOptionCycling<>(FOVMode.ALL, OptionImpact.VARIES)), HURT_SHAKE(new NotFineOptionSliderPercentage(100, 0, 300, 5, OptionImpact.LOW)), DYNAMIC_LIGHTS(new NotFineOptionCycling<>(DynamicLightsMode.FANCY, OptionImpact.VARIES)){ @Override diff --git a/src/main/java/jss/notfine/gui/options/named/FOVMode.java b/src/main/java/jss/notfine/gui/options/named/FOVMode.java new file mode 100644 index 000000000..7b7269eab --- /dev/null +++ b/src/main/java/jss/notfine/gui/options/named/FOVMode.java @@ -0,0 +1,21 @@ +package jss.notfine.gui.options.named; + +import me.jellysquid.mods.sodium.client.gui.options.named.NamedState; + +public enum FOVMode implements NamedState { + ALL("options.fov.all"), + MODS("options.fov.mods"), + NONE("options.fov.none"); + + private final String name; + + FOVMode(String name) { + this.name = name; + } + + @Override + public String getKey() { + return this.name; + } + +} diff --git a/src/main/resources/META-INF/notfine_at.cfg b/src/main/resources/META-INF/notfine_at.cfg index 404ad6c87..beeffbabb 100644 --- a/src/main/resources/META-INF/notfine_at.cfg +++ b/src/main/resources/META-INF/notfine_at.cfg @@ -13,4 +13,6 @@ public net.minecraft.block.BlockLeaves field_150129_M #For the interpolated icon class public net.minecraft.client.renderer.texture.TextureAtlasSprite field_110982_k #animationMetadata #For interpolated icon mixin -public net.minecraft.client.resources.SimpleResource field_110530_g #mcmetaJson \ No newline at end of file +public net.minecraft.client.resources.SimpleResource field_110530_g #mcmetaJson +#To prevent mods from un-disabling FOV changes +public-f net.minecraftforge.client.event.FOVUpdateEvent fov # fov \ No newline at end of file diff --git a/src/main/resources/assets/notfine/lang/en_US.lang b/src/main/resources/assets/notfine/lang/en_US.lang index 1cf9aff2a..dc5c44661 100644 --- a/src/main/resources/assets/notfine/lang/en_US.lang +++ b/src/main/resources/assets/notfine/lang/en_US.lang @@ -19,13 +19,16 @@ options.gui_background.tooltip=Background options.downfall_distance=Weather Effects options.downfall_distance.tooltip=Weather Effects options.dynamic_fov=Dynamic FOV -options.dynamic_fov.tooltip=If enabled, the game's field of view will change based on the player's speed. +options.dynamic_fov.tooltip=Depending on the mode, the game's field of view will change based on the player's speed or from certain mod interactions (including tool zooming/weapon scopes). options.horizon=Horizon options.horizon.tooltip=Horizon options.terrain_fog=Terrain Fog options.terrain_fog.tooltip=Terrain Fog (aka View Distance Fog) options.fog_near_distance=Near Fog Distance options.fog_near_distance.tooltip=Distance away from the player when the view distance fog will start (0%% opacity then linear increase to render distance) +options.fov.all=Enabled +options.fov.mods=Mods Only +options.fov.none=Disabled options.mode_cloud_translucency=Cloud Translucency options.mode_cloud_translucency.tooltip=Cloud Translucency options.mode_clouds=Clouds