forge170-shaders #13

Merged
embeddedt merged 13 commits from mitchej123/celeritas:forge170-shaders into stonecutter 2025-05-23 21:54:43 -04:00
7 changed files with 13 additions and 15 deletions
Showing only changes of commit e16609c872 - Show all commits

No files matched your search

@@ -496,4 +496,8 @@ public class IrisCommon {
public static NamespacedId getLastDimension() {
return lastDimension;
}
public static String getCurrentPackName() {
return currentPackName;
}
}
@@ -212,11 +212,6 @@ public class Iris {
return stored;
}
public static String getCurrentPackName() {
return IrisCommon.currentPackName;
}
public static boolean isFallback() {
return IrisCommon.fallback;
}
@@ -2,7 +2,6 @@ package net.irisshaders.iris.gui.element;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import net.irisshaders.iris.Iris;
import net.irisshaders.iris.IrisCommon;
import net.irisshaders.iris.gui.FileDialogUtil;
import net.irisshaders.iris.gui.GuiUtil;
@@ -282,7 +281,7 @@ public class ShaderPackOptionList extends IrisContainerObjectSelectionList<Shade
FileDialogUtil.fileSelectDialog(
FileDialogUtil.DialogType.OPEN, "Import Shader Settings from File",
IrisCommon.getShaderpacksDirectory().resolve(Iris.getCurrentPackName() + ".txt"),
IrisCommon.getShaderpacksDirectory().resolve(IrisCommon.getCurrentPackName() + ".txt"),
"Shader Pack Settings (.txt)", "*.txt")
.whenComplete((path, err) -> {
if (err != null) {
@@ -318,7 +317,7 @@ public class ShaderPackOptionList extends IrisContainerObjectSelectionList<Shade
FileDialogUtil.fileSelectDialog(
FileDialogUtil.DialogType.SAVE, "Export Shader Settings to File",
IrisCommon.getShaderpacksDirectory().resolve(Iris.getCurrentPackName() + ".txt"),
IrisCommon.getShaderpacksDirectory().resolve(IrisCommon.getCurrentPackName() + ".txt"),
"Shader Pack Settings (.txt)", "*.txt")
.whenComplete((path, err) -> {
if (err != null) {
@@ -332,7 +331,7 @@ public class ShaderPackOptionList extends IrisContainerObjectSelectionList<Shade
// Dirty way of getting the currently applied settings as a Properties, directly
// opens and copies out of the saved settings file if it is present
Path sourceTxtPath = IrisCommon.getShaderpacksDirectory().resolve(Iris.getCurrentPackName() + ".txt");
Path sourceTxtPath = IrisCommon.getShaderpacksDirectory().resolve(IrisCommon.getCurrentPackName() + ".txt");
if (Files.exists(sourceTxtPath)) {
try (InputStream in = Files.newInputStream(sourceTxtPath)) {
toSave.load(in);
@@ -1,6 +1,7 @@
package net.irisshaders.iris.gui.element.widget;
import net.irisshaders.iris.Iris;
import net.irisshaders.iris.IrisCommon;
import net.irisshaders.iris.gui.GuiUtil;
import net.irisshaders.iris.gui.NavigationController;
import net.irisshaders.iris.gui.element.ShaderPackOptionList;
@@ -28,7 +29,7 @@ public final class OptionMenuConstructor {
static {
registerScreen(OptionMenuMainElementScreen.class, screen ->
new ElementWidgetScreenData(Component.literal(Iris.getCurrentPackName()).append(Iris.isFallback() ? " (fallback)" : "").withStyle(ChatFormatting.BOLD), false));
new ElementWidgetScreenData(Component.literal(IrisCommon.getCurrentPackName()).append(Iris.isFallback() ? " (fallback)" : "").withStyle(ChatFormatting.BOLD), false));
registerScreen(OptionMenuSubElementScreen.class, screen ->
new ElementWidgetScreenData(GuiUtil.translateOrDefault(Component.literal(screen.screenId), "screen." + screen.screenId), true));
@@ -33,7 +33,6 @@ import java.io.InputStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -555,7 +554,7 @@ public class ShaderPackScreen extends Screen implements HudHideable {
// If the pack is being changed, clear pending options from the previous pack to
// avoid possible undefined behavior from applying one pack's options to another pack
if (!name.equals(Iris.getCurrentPackName())) {
if (!name.equals(IrisCommon.getCurrentPackName())) {
IrisCommon.clearShaderPackOptionQueue();
}
@@ -61,7 +61,7 @@ public abstract class MixinDebugScreenOverlay {
@ModifyExpressionValue(method = "getSystemInformation", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/Lists;newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;"))
private ArrayList<String> redirectRightTextEarly(ArrayList<String> messages) {
if (IrisCommon.getIrisConfig().areShadersEnabled()) {
messages.add("Shaderpack: " + Iris.getCurrentPackName() + (Iris.isFallback() ? " (fallback)" : ""));
messages.add("Shaderpack: " + IrisCommon.getCurrentPackName() + (Iris.isFallback() ? " (fallback)" : ""));
IrisCommon.getCurrentPack().ifPresent(pack -> {
messages.add(pack.getProfileInfo());
});
@@ -21,10 +21,10 @@ public abstract class MixinSystemReport {
@Inject(at = @At("RETURN"), method = "<init>")
private void fillSystemDetails(CallbackInfo ci) {
if (Iris.getCurrentPackName() == null) return; // this also gets called at startup for some reason
if (IrisCommon.getCurrentPackName() == null) return; // this also gets called at startup for some reason
this.setDetail("Loaded Shaderpack", () -> {
StringBuilder sb = new StringBuilder(Iris.getCurrentPackName() + (Iris.isFallback() ? " (fallback)" : ""));
StringBuilder sb = new StringBuilder(IrisCommon.getCurrentPackName() + (Iris.isFallback() ? " (fallback)" : ""));
IrisCommon.getCurrentPack().ifPresent(pack -> {
sb.append("\n\t\t");
sb.append(pack.getProfileInfo());