Add "Mods Only" Dynamic FOV option (#1680)

This commit is contained in:
George Paton authored and GitHub committed 2026-04-18 09:13:39 -07:00
1 parent 34a6967c71
commit 91f2cf9dfb
5 files changed
+43 -6

No files matched your search

@@ -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;
}
}
+2 -1
View File
@@ -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
@@ -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;
}
}