mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-10-26 14:24:30 +00:00
Add "Mods Only" Dynamic FOV option (#1680)
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
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
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user