-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle exceptions when auto-initialising dialogs
- Loading branch information
Showing
5 changed files
with
39 additions
and
7 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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ public class SimpleDialog( | |
builder.check() | ||
title = builder.title | ||
builtLayout = builder.layout | ||
|
||
} | ||
|
||
/** | ||
|
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
16 changes: 16 additions & 0 deletions
16
test-mod/src/main/kotlin/com/noxcrew/sheeplib/testmod/ExceptionDialog.kt
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,16 @@ | ||
package com.noxcrew.sheeplib.testmod | ||
|
||
import com.noxcrew.sheeplib.dialog.Dialog | ||
import com.noxcrew.sheeplib.theme.DefaultTheme | ||
import com.noxcrew.sheeplib.theme.Themed | ||
import net.minecraft.client.gui.layouts.Layout | ||
|
||
/** | ||
* A dialog that throws an exception when built. | ||
* This is a class and not a simple dialog to build lazily. | ||
*/ | ||
public class ExceptionDialog(x: Int, y: Int): Dialog(x, y), Themed by DefaultTheme { | ||
override fun layout(): Layout { | ||
error("Test exception from the exception dialog. This is not a bug.") | ||
} | ||
} |
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