Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic max GUI scale + minor fixes #63

Open
wants to merge 3 commits into
base: 12.x/forge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: Build artifacts
run: ./gradlew build publishMods -Pbuild.release=true
- name: Upload assets to GitHub
uses: AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v3.0
with:
# Filter built files to disregard -sources and -dev, and leave only the minecraft-compatible jars.
files: 'build/libs/*[0-9].jar;LICENSE'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
Expand All @@ -23,4 +23,4 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: Vintagium
path: build/libs
path: build/libs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.client.GuiIngameForge;

import org.lwjgl.opengl.Display;

Expand Down Expand Up @@ -53,11 +52,12 @@ public static OptionPage general() {
.build())
.build());

int maxGuiScale = Math.max(3, Math.min(Minecraft.getMinecraft().displayWidth / 320, Minecraft.getMinecraft().displayHeight / 240));
groups.add(OptionGroup.createBuilder()
.add(OptionImpl.createBuilder(int.class, vanillaOpts)
.setName(new TextComponentTranslation("options.guiScale"))
.setTooltip(new TextComponentTranslation("sodium.options.gui_scale.tooltip"))
.setControl(option -> new SliderControl(option, 0, 3, 1, ControlValueFormatter.guiScale()))
.setControl(option -> new SliderControl(option, 0, maxGuiScale, 1, ControlValueFormatter.guiScale()))
.setBinding((opts, value) -> {
opts.guiScale = value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MixinChunkBuilder {
@Mutable
private int countRenderBuilders;

@Redirect(method = "<init>(I)V", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Queues;newArrayBlockingQueue(I)Ljava/util/concurrent/ArrayBlockingQueue;"))
@Redirect(method = "<init>(I)V", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Queues;newArrayBlockingQueue(I)Ljava/util/concurrent/ArrayBlockingQueue;", remap = false))
public ArrayBlockingQueue<?> modifyThreadPoolSize(int capacity) {
// Do not allow any resources to be allocated
this.countRenderBuilders = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private static long bytesToMb(long bytes) {
throw new UnsupportedOperationException();
}

@Redirect(method = "getDebugInfoRight", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Lists;newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;"))
@Redirect(method = "getDebugInfoRight", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Lists;newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;", remap = false))
private ArrayList<String> redirectRightTextEarly(Object[] elements) {
ArrayList<String> strings = Lists.newArrayList((String[]) elements);
strings.add("");
Expand Down