Skip to content

Commit

Permalink
UDOC-0 - Fix sliders not working in video settings and still have GUI…
Browse files Browse the repository at this point in the history
… scaling work; Remove disused config
  • Loading branch information
telvarost committed Jan 28, 2024
1 parent f06f308 commit 074627b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/github/telvarost/finalbeta/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ public static class ConfigFields {
@ConfigName("Fix minecart stopping on items")
public static Boolean FIX_MINECART_STOPPING_ON_ITEMS = true;

@ConfigName("Improved option/video menu controls")
@Comment("Adds controls for clouds, fog, and FOV")
public static Boolean IMPROVED_MENU_CONTROLS = true;
/** - At the current moment this is not toggle-able */
// @ConfigName("Improved option/video menu controls")
// @Comment("Adds controls for clouds, fog, and FOV")
// public static Boolean IMPROVED_MENU_CONTROLS = true;

@ConfigName("Use \"Shift + DROP_KEY\" to drop item stack")
public static Boolean STACK_DROP = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,4 @@ public abstract class OptionsScreenMixin extends ScreenBase {
OPTIONS = Arrays.copyOf(OPTIONS, OPTIONS.length + 1);
OptionsScreenMixin.OPTIONS[OptionsScreenMixin.OPTIONS.length - 1] = ModOptions.fovOption;
}

@Inject(method = "buttonClicked", at = @At("HEAD"), cancellable = true)
public void finalBeta_openImprovedControls(Button button, CallbackInfo ci) {
if (Config.ConfigFields.IMPROVED_MENU_CONTROLS) {
if (button.id == 100) {
this.minecraft.openScreen(new Controls(this, this.gameOptions));
ci.cancel();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import net.minecraft.client.gui.screen.menu.VideoSettings;
import net.minecraft.client.gui.widgets.Button;
import net.minecraft.client.gui.widgets.OptionButton;
import net.minecraft.client.gui.widgets.Slider;
import net.minecraft.client.options.GameOptions;
import net.minecraft.client.options.Option;
import net.minecraft.client.util.ScreenScaler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -46,6 +48,13 @@ protected void buttonClicked(Button arg, CallbackInfo ci) {
this.minecraft.options.saveOptions();
this.minecraft.openScreen(this.parent);
}

if (!(arg instanceof Slider)) {
ScreenScaler var2 = new ScreenScaler(this.minecraft.options, this.minecraft.actualWidth, this.minecraft.actualHeight);
int var3 = var2.getScaledWidth();
int var4 = var2.getScaledHeight();
this.init(this.minecraft, var3, var4);
}
}
ci.cancel();
}
Expand Down

0 comments on commit 074627b

Please sign in to comment.