Skip to content

Commit 07881b3

Browse files
committed
Add config option to disable "Return to Main Menu" button on crash screen
1 parent 94d2c6c commit 07881b3

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/main/java/org/dimdev/vanillafix/ModConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public static class Fixes {
4848
}
4949

5050
public static class Crashes {
51+
@Name("disableReturnToMainMenu")
52+
@LangKey("vanillafix.crashes.disableReturnToMainMenu")
53+
public boolean disableReturnToMainMenu = false;
54+
5155
@Name("scheduledTaskproblemAction")
5256
@LangKey("vanillafix.crashes.scheduledTaskproblemAction")
5357
public ProblemAction scheduledTaskAction = ProblemAction.NOTIFICATION;

src/main/java/org/dimdev/vanillafix/crashes/GuiCrashScreen.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.crash.CrashReport;
88
import net.minecraftforge.fml.relauncher.Side;
99
import net.minecraftforge.fml.relauncher.SideOnly;
10+
import org.dimdev.vanillafix.ModConfig;
1011

1112
@SideOnly(Side.CLIENT)
1213
public class GuiCrashScreen extends GuiProblemScreen {
@@ -18,7 +19,12 @@ public GuiCrashScreen(CrashReport report) {
1819
@Override
1920
public void initGui() {
2021
super.initGui();
21-
buttonList.add(new GuiOptionButton(0, width / 2 - 155, height / 4 + 120 + 12, I18n.format("gui.toTitle")));
22+
GuiOptionButton mainMenuButton = new GuiOptionButton(0, width / 2 - 155, height / 4 + 120 + 12, I18n.format("gui.toTitle"));
23+
buttonList.add(mainMenuButton);
24+
if (ModConfig.crashes.disableReturnToMainMenu) {
25+
mainMenuButton.enabled = false;
26+
mainMenuButton.displayString = I18n.format("vanillafix.gui.disabledByConfig");
27+
}
2228
}
2329

2430
@Override

src/main/resources/assets/vanillafix/lang/en_us.lang

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ vanillafix.gui.getLink=Get link
22
vanillafix.gui.failed=[Failed]
33
vanillafix.gui.keepPlaying=Keep playing
44
vanillafix.gui.restart=Restart Minecraft
5+
vanillafix.gui.disabledByConfig=Disabled by config
56

67
vanillafix.crashscreen.title=Minecraft crashed!
78
vanillafix.crashscreen.summary=Minecraft ran into a problem and crashed.
@@ -50,6 +51,8 @@ vanillafix.fixes=Enable/Disable Fixes
5051
vanillafix.fixes.tooltip=Control which fixes are enabled and disabled.
5152
vanillafix.crashes=Crash Options
5253
vanillafix.crashes.tooltip=Options on how crashes are handled
54+
vanillafix.crashes.disableReturnToMainMenu=Disable Return to Main Menu
55+
vanillafix.crashes.disableReturnToMainMenu.tooltip=Disables the "Return to Main Menu" button on the crash screen, forcing the user to close the game after a crash. The crash screen will still show the suspected mods and offer to upload the crash report.
5356
vanillafix.crashes.problemAction.log=Log
5457
vanillafix.crashes.problemAction.notification=Notification
5558
vanillafix.crashes.problemAction.warningScreen=Warning Screen
@@ -63,7 +66,6 @@ vanillafix.crashes.replaceErrorNotifications.tooltip=When several errors occur i
6366
vanillafix.crashes.hasteURL=Haste URL
6467
vanillafix.crashes.hasteURL.tooltip=The URL to the root of the haste instance to upload crash reports to, without a trailing slash.
6568

66-
6769
vanillafix.debug.switch_profiler.help=F3 + S = Cycle client <-> integrated server profiler
6870
vanillafix.debug.switch_profiler.server=Using server profiler
6971
vanillafix.debug.switch_profiler.client=Using client profiler

0 commit comments

Comments
 (0)