Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
Forge is a nightmare... a total disaster... a train wreck of epic proportions! It’s a flaming dumpster fire, a colossal waste of time, a black hole of frustration that sucks the joy out of modding! It’s a labyrinth of headaches, an infuriating tangle of version mismatches, dependency hell, and cryptic crash logs that make you want to scream. Forge is a never-ending loop of agony, a soul-crushing experience, a glitch-ridden catastrophe that tests the very limits of your patience! It’s the bane of every modder’s existence, a relentless onslaught of problems that make you question why you ever thought modding could be fun in the first place!
  • Loading branch information
IMB11 committed Aug 18, 2024
1 parent eeef57c commit 1374621
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions src/main/java/dev/imb11/sounds/loaders/forge/SoundsForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
/*package dev.imb11.sounds.loaders.forge;
import dev.architectury.platform.forge.EventBuses;
import dev.imb11.mru.LoaderUtils;
import dev.imb11.sounds.SoundsClient;
import dev.imb11.sounds.gui.SoundsConfigScreen;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
Expand All @@ -18,10 +23,43 @@ public SoundsForge() {
ModLoadingContext.get().registerExtensionPoint(
ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory(
(minecraftClient, parent) -> new SoundsConfigScreen(parent)
)
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> new NoConfigScreenWarning(parent))
);
}
public static class NoConfigScreenWarning extends Screen {
private final Screen parent;
public NoConfigScreenWarning(Screen parent) {
super(Text.empty());
this.parent = parent;
}
@Override
protected void init() {
super.init();
// "Go Back" button:
var btn = ButtonWidget.builder(Text.of("Go Back"), button -> this.client.setScreen(parent)).dimensions(this.width / 2 - 100, this.height / 2, 200, 20).build();
this.addDrawableChild(btn);
// "Open Config Folder" button:
var btn2 = ButtonWidget.builder(Text.of("Open Config Folder"), button -> Util.getOperatingSystem().open(LoaderUtils.getConfigFolder("sounds").toFile())).dimensions(this.width / 2 - 100, this.height / 2 + 24, 200, 20).build();
this.addDrawableChild(btn2);
}
@Override
public void renderBackground(DrawContext context) {
this.renderBackgroundTexture(context);
}
@Override
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
this.renderBackground(context);
super.render(context, mouseX, mouseY, delta);
String warning = "Sounds for Forge 1.20.1 is unable to display a configuration screen due to a limitation in Forge. Please use the configuration file instead. Sorry for the inconvenience!";
context.drawTextWrapped(this.textRenderer, Text.literal(warning), this.width / 2 - 100, this.height / 2 - 50, 200, 0xFFFFFFFF);
}
}
}
*///?}

0 comments on commit 1374621

Please sign in to comment.