|
6 | 6 | import gregtech.api.mui.factory.CoverGuiFactory; |
7 | 7 | import gregtech.api.mui.factory.MetaItemGuiFactory; |
8 | 8 | import gregtech.api.mui.factory.MetaTileEntityGuiFactory; |
| 9 | +import gregtech.api.util.GTLog; |
9 | 10 |
|
10 | 11 | import net.minecraft.item.ItemStack; |
11 | 12 |
|
12 | 13 | import com.cleanroommc.modularui.api.IPanelHandler; |
| 14 | +import com.cleanroommc.modularui.api.drawable.IKey; |
13 | 15 | import com.cleanroommc.modularui.factory.GuiManager; |
14 | 16 | import com.cleanroommc.modularui.screen.ModularPanel; |
15 | 17 | import com.cleanroommc.modularui.utils.Alignment; |
16 | 18 | import com.cleanroommc.modularui.widgets.ButtonWidget; |
| 19 | +import com.cleanroommc.modularui.widgets.RichTextWidget; |
17 | 20 | import org.jetbrains.annotations.ApiStatus; |
18 | 21 | import org.jetbrains.annotations.NotNull; |
19 | 22 |
|
20 | 23 | public class GTGuis { |
21 | 24 |
|
22 | 25 | public static final int DEFAULT_WIDTH = 176, DEFAULT_HIEGHT = 166; |
23 | 26 |
|
| 27 | + private static final ModularPanel ERROR = createPanel("error") |
| 28 | + .size(100) |
| 29 | + .child(new RichTextWidget() |
| 30 | + .sizeRel(1) |
| 31 | + .margin(6) |
| 32 | + .align(Alignment.Center) |
| 33 | + .alignment(Alignment.Center) |
| 34 | + .textBuilder(richText -> { |
| 35 | + richText.addLine(IKey.str("ERROR!").style(IKey.RED, IKey.ITALIC)).newLine(); |
| 36 | + richText.addLine("You shouldn't be able to see this. If you do, report it to a dev."); |
| 37 | + })); |
| 38 | + |
| 39 | + public static ModularPanel errorPanel() { |
| 40 | + GTLog.logger.error("Error Panel Opened!", new Throwable()); |
| 41 | + return ERROR; |
| 42 | + } |
| 43 | + |
24 | 44 | @ApiStatus.Internal |
25 | 45 | public static void registerFactories() { |
26 | 46 | GuiManager.registerFactory(MetaTileEntityGuiFactory.INSTANCE); |
|
0 commit comments