Fix incorrect layering of vanilla gui additions (fixes #385)
This commit is contained in:
@@ -38,7 +38,8 @@ public class GuiBackgroundProcesses extends EventRegistrations {
|
||||
//#endif
|
||||
if (guiScreen != getMinecraft().currentScreen) return; // people tend to construct GuiScreens without opening them
|
||||
|
||||
VanillaGuiScreen.setup(guiScreen).setLayout(new CustomLayout<GuiScreen>() {
|
||||
VanillaGuiScreen vanillaGui = VanillaGuiScreen.wrap(guiScreen);
|
||||
vanillaGui.setLayout(new CustomLayout<GuiScreen>(vanillaGui.getLayout()) {
|
||||
@Override
|
||||
protected void layout(GuiScreen container, int width, int height) {
|
||||
pos(panel, width - 5 - width(panel), 5);
|
||||
@@ -76,6 +77,11 @@ public class GuiBackgroundProcesses extends EventRegistrations {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayer() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReadableDimension getMinSize() {
|
||||
ReadableDimension minSize = inner.getMinSize();
|
||||
|
||||
@@ -102,7 +102,7 @@ public class RestoreReplayGui extends AbstractGuiScreen<RestoreReplayGui> {
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Recovering replay file:", e);
|
||||
CrashReport crashReport = CrashReport.create(e, "Recovering replay file");
|
||||
core.runLater(() -> Utils.error(LOGGER, VanillaGuiScreen.setup(getMinecraft().currentScreen), crashReport, () -> {}));
|
||||
core.runLater(() -> Utils.error(LOGGER, VanillaGuiScreen.wrap(getMinecraft().currentScreen), crashReport, () -> {}));
|
||||
} finally {
|
||||
core.runLater(() -> core.getBackgroundProcesses().removeProcess(savingProcess));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user