Skip to content

Commit

Permalink
rename unofficial settings to speedrun settings, make planar on by de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
tildejustin committed Jun 6, 2024
1 parent 97c2613 commit 0b17e19
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static OptionPage quality() {

public static OptionPage advanced() {
boolean disableBlacklist = SodiumClientMod.options().advanced.disableDriverBlacklist;
boolean usePlanarFog = SodiumClientMod.options().unofficial.usePlanarFog;

List<OptionGroup> groups = new ArrayList<>();

Expand Down Expand Up @@ -328,7 +327,7 @@ public static OptionPage unofficial() {
"in areas with thick fog such as in the nether. This is vanilla behavior on systems where GL_NV_fog_distance is unavailable, but is not " +
"considered desirable for any reason other than visibility. This option is not included in official releases of Sodium.")
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.unofficial.usePlanarFog = value, opts -> opts.unofficial.usePlanarFog)
.setBinding((opts, value) -> opts.speedrun.usePlanarFog = value, opts -> opts.speedrun.usePlanarFog)
.setImpact(OptionImpact.MEDIUM)
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
.build()
Expand All @@ -337,14 +336,14 @@ public static OptionPage unofficial() {
.setName("Show Entity Culling")
.setTooltip("If enabled, Entity Culling will be added to the vanilla menu so it can be toggled while in a world.")
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.unofficial.showEntityCulling = value, opts -> opts.unofficial.showEntityCulling)
.setBinding((opts, value) -> opts.speedrun.showEntityCulling = value, opts -> opts.speedrun.showEntityCulling)
.build()
)
.add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
.setName("Show Fog Occlusion")
.setTooltip("If enabled, Fog Occlusion will be added to the vanilla menu so it can be toggled while in a world.")
.setControl(TickBoxControl::new)
.setBinding((opts, value) -> opts.unofficial.showFogOcclusion = value, opts -> opts.unofficial.showFogOcclusion)
.setBinding((opts, value) -> opts.speedrun.showFogOcclusion = value, opts -> opts.speedrun.showFogOcclusion)
.build()
)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class SodiumGameOptions {
public final QualitySettings quality = new QualitySettings();
public final AdvancedSettings advanced = new AdvancedSettings();
public final UnofficialSettings unofficial = new UnofficialSettings();
public final SpeedrunSettings speedrun = new SpeedrunSettings();

private File file;

Expand All @@ -46,7 +46,7 @@ public static class QualitySettings {
public boolean enableVignette = true;
}

public static class UnofficialSettings {
public static class SpeedrunSettings {
public boolean usePlanarFog = true;
public boolean showEntityCulling = true;
public boolean showFogOcclusion = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ private void init(Camera camera, FrustumExtended frustum, int frame, boolean spe

if (dist != 0.0f) {
this.useFogCulling = true;
if (SodiumClientMod.options().unofficial.usePlanarFog) {
if (SodiumClientMod.options().speedrun.usePlanarFog) {
this.usePlanarFog = true;
}
this.fogRenderCutoff = Math.max(FOG_PLANE_MIN_DISTANCE, dist * dist);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static ChunkFogMode getActiveMode() {

int mode = GL11.glGetInteger(GL11.GL_FOG_MODE);

boolean usePlanarFog = SodiumClientMod.options().unofficial.usePlanarFog;
boolean usePlanarFog = SodiumClientMod.options().speedrun.usePlanarFog;

switch (mode) {
case GL11.GL_EXP2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public abstract class MixinBackgroundRenderer {
@Redirect(method = "applyFog", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setupNvFogDistance()V"))
private static void redirectSetupNvFogDistance() {
if (SodiumClientMod.options().unofficial.usePlanarFog) {
if (SodiumClientMod.options().speedrun.usePlanarFog) {
return;
} else {
RenderSystem.setupNvFogDistance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public MixinVideoOptionsScreen(Screen parent, GameOptions gameOptions, Text titl
@Redirect(method = "init", at=@At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/ButtonListWidget;addAll([Lnet/minecraft/client/options/Option;)V"))
private void optionsSwap(ButtonListWidget list, Option[] old_options) {
List<Option> options = new ArrayList<>(Arrays.asList(old_options));
SodiumGameOptions.UnofficialSettings speedrunSettings = SodiumClientMod.options().unofficial;
SodiumGameOptions.SpeedrunSettings speedrunSettings = SodiumClientMod.options().speedrun;
if (speedrunSettings.showEntityCulling) {
options.add(VanillaOptions.ENTITY_CULLING);
}
Expand Down

0 comments on commit 0b17e19

Please sign in to comment.