-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
792 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package org.dimdev.toomanycrashes; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.font.TextRenderer; | ||
import net.minecraft.client.gui.screen.TitleScreen; | ||
import net.minecraft.client.gui.widget.ButtonWidget; | ||
import net.minecraft.client.resource.language.I18n; | ||
import net.minecraft.util.SystemUtil; | ||
import net.minecraft.util.crash.CrashReport; | ||
import net.minecraft.util.math.Box; | ||
|
||
import java.io.File; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class CrashScreen extends ProblemScreen { | ||
|
||
public CrashScreen(CrashReport report) { | ||
super(report); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
super.init(); | ||
ButtonWidget mainMenuButton = new ButtonWidget(width / 2 - 155, height / 4 + 120 + 12, 150, 20, I18n.translate("gui.toTitle"), | ||
button -> minecraft.openScreen(new TitleScreen())); | ||
|
||
if (ModConfig.instance().disableReturnToMainMenu) { | ||
mainMenuButton.active = false; | ||
mainMenuButton.setMessage(I18n.translate("toomanycrashes.gui.disabledByConfig")); | ||
} | ||
|
||
addButton(mainMenuButton); | ||
} | ||
|
||
|
||
@Override | ||
public void render(int mouseX, int mouseY, float partialTicks) { // TODO: localize number of lines | ||
renderBackground(); | ||
drawCenteredString(font, I18n.translate("toomanycrashes.crashscreen.title"), width / 2, height / 4 - 40, 0xFFFFFF); | ||
|
||
int textColor = 0xD0D0D0; | ||
int x = width / 2 - 155; | ||
int y = height / 4; | ||
|
||
drawString(font, I18n.translate("toomanycrashes.crashscreen.summary"), x, y, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph1.line1"), x, y += 18, textColor); | ||
|
||
drawCenteredString(font, getModListString(), width / 2, y += 11, 0xE0E000); | ||
|
||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph2.line1"), x, y += 11, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph2.line2"), x, y += 9, textColor); | ||
|
||
drawFileNameString(y); | ||
y += 11; | ||
|
||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph3.line1"), x, y += 12, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph3.line2"), x, y += 9, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph3.line3"), x, y += 9, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph3.line4"), x, y + 9, textColor); | ||
|
||
super.render(mouseX, mouseY, partialTicks); | ||
} | ||
} |
61 changes: 0 additions & 61 deletions
61
src/main/java/org/dimdev/toomanycrashes/CrashScreenGui.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/org/dimdev/toomanycrashes/InitErrorScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.dimdev.toomanycrashes; | ||
|
||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.gui.widget.AbstractButtonWidget; | ||
import net.minecraft.client.resource.language.I18n; | ||
import net.minecraft.util.crash.CrashReport; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class InitErrorScreen extends ProblemScreen { | ||
|
||
public InitErrorScreen(CrashReport report) { | ||
super(report); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
super.init(); | ||
AbstractButtonWidget getLinkButton = buttons.get(0); | ||
getLinkButton.x = width / 2 - 155; | ||
getLinkButton.y = height / 4 + 120 + 12; | ||
getLinkButton.setWidth(310); | ||
} | ||
|
||
@Override | ||
public void render(int mouseX, int mouseY, float partialTicks) { // TODO: localize number of lines | ||
renderBackground(); | ||
drawCenteredString(font, I18n.translate("toomanycrashes.initerrorscreen.title"), width / 2, height / 4 - 40, 0xFFFFFF); | ||
|
||
int textColor = 0xD0D0D0; | ||
int x = width / 2 - 155; | ||
int y = height / 4; | ||
|
||
drawString(font, I18n.translate("toomanycrashes.initerrorscreen.summary"), x, y, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph1.line1"), x, y += 18, textColor); | ||
|
||
drawCenteredString(font, getModListString(), width / 2, y += 11, 0xE0E000); | ||
|
||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph2.line1"), x, y += 11, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.crashscreen.paragraph2.line2"), x, y += 9, textColor); | ||
|
||
drawFileNameString(y); | ||
y += 11; | ||
|
||
drawString(font, I18n.translate("toomanycrashes.initerrorscreen.paragraph3.line1"), x, y += 12, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.initerrorscreen.paragraph3.line2"), x, y += 9, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.initerrorscreen.paragraph3.line3"), x, y += 9, textColor); | ||
drawString(font, I18n.translate("toomanycrashes.initerrorscreen.paragraph3.line4"), x, y + 9, textColor); | ||
|
||
super.render(mouseX, mouseY, partialTicks); | ||
} | ||
} |
Oops, something went wrong.