ChangelogScreen for 1.12.2
This commit is contained in:
@@ -131,7 +131,7 @@ if (isNotCommonProject) {
|
|||||||
'MixinConfigs': "${mod_id}.default.mixin.json,${mod_id}.mod.mixin.json",
|
'MixinConfigs': "${mod_id}.default.mixin.json,${mod_id}.mod.mixin.json",
|
||||||
'FMLCorePlugin': 'com.seibel.distanthorizons.cleanroom.DistantHorizonsLoadingPlugin',
|
'FMLCorePlugin': 'com.seibel.distanthorizons.cleanroom.DistantHorizonsLoadingPlugin',
|
||||||
'FMLCorePluginContainsFMLMod': true,
|
'FMLCorePluginContainsFMLMod': true,
|
||||||
'FMLAT': "src/main/resources/${gradle.ext.accessWidenerVersion}.distanthorizons_at.cfg"
|
'FMLAT': "${gradle.ext.accessWidenerVersion}.distanthorizons_at.cfg"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,6 +188,7 @@ if (isNotCommonProject) {
|
|||||||
if (gradle.ext.minecraft_version.equals("1.12.2")) {
|
if (gradle.ext.minecraft_version.equals("1.12.2")) {
|
||||||
cleanroom {
|
cleanroom {
|
||||||
loader gradle.ext.cleanroom_loader_version
|
loader gradle.ext.cleanroom_loader_version
|
||||||
|
accessTransformer project.file("src/main/resources/${gradle.ext.accessWidenerVersion}.distanthorizons_at.cfg")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fabric {
|
fabric {
|
||||||
|
|||||||
+13
-5
@@ -1,6 +1,5 @@
|
|||||||
package com.seibel.distanthorizons.common.commonMixins;
|
package com.seibel.distanthorizons.common.commonMixins;
|
||||||
|
|
||||||
#if MC_VER > MC_1_12_2
|
|
||||||
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
|
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
|
import com.seibel.distanthorizons.common.wrappers.gui.updater.UpdateModScreen;
|
||||||
import com.seibel.distanthorizons.core.config.Config;
|
import com.seibel.distanthorizons.core.config.Config;
|
||||||
@@ -13,7 +12,7 @@ import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
|||||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
#if MC_VER <= MC_1_12_2
|
#if MC_VER <= MC_1_12_2
|
||||||
|
import net.minecraft.client.gui.GuiMainMenu;
|
||||||
#else
|
#else
|
||||||
import net.minecraft.client.gui.screens.TitleScreen;
|
import net.minecraft.client.gui.screens.TitleScreen;
|
||||||
#endif
|
#endif
|
||||||
@@ -23,8 +22,11 @@ public class DhUpdateScreenBase
|
|||||||
{
|
{
|
||||||
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
||||||
|
|
||||||
private static final Minecraft MC = Minecraft #if MC_VER <= MC_1_12_2 .getMinecraft() #else .getInstance() #endif;
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private static final Minecraft MC = Minecraft.getMinecraft();
|
||||||
|
#else
|
||||||
|
private static final Minecraft MC = Minecraft.getInstance();
|
||||||
|
#endif
|
||||||
|
|
||||||
public static void tryShowUpdateScreenAndRunAutoUpdateStartup(Runnable runnable)
|
public static void tryShowUpdateScreenAndRunAutoUpdateStartup(Runnable runnable)
|
||||||
{
|
{
|
||||||
@@ -73,10 +75,17 @@ public class DhUpdateScreenBase
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
MC.displayGuiScreen(new UpdateModScreen(
|
||||||
|
new GuiMainMenu(),
|
||||||
|
versionId
|
||||||
|
));
|
||||||
|
#else
|
||||||
MC.setScreen(new UpdateModScreen(
|
MC.setScreen(new UpdateModScreen(
|
||||||
new TitleScreen(false),
|
new TitleScreen(false),
|
||||||
versionId
|
versionId
|
||||||
));
|
));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@@ -89,4 +98,3 @@ public class DhUpdateScreenBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
+36
-9
@@ -12,19 +12,15 @@ import java.util.function.Predicate;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui;
|
import com.seibel.distanthorizons.api.enums.config.DisallowSelectingViaConfigGui;
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
import com.seibel.distanthorizons.common.wrappers.gui.*;
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.GuiHelper;
|
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.TexturedButtonWidget;
|
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.config.ConfigGuiInfo;
|
import com.seibel.distanthorizons.common.wrappers.gui.config.ConfigGuiInfo;
|
||||||
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper;
|
import com.seibel.distanthorizons.common.wrappers.minecraft.MinecraftClientWrapper;
|
||||||
import com.seibel.distanthorizons.core.config.Config;
|
import com.seibel.distanthorizons.core.config.Config;
|
||||||
import com.seibel.distanthorizons.core.config.ConfigHandler;
|
import com.seibel.distanthorizons.core.config.ConfigHandler;
|
||||||
import com.seibel.distanthorizons.core.config.types.*;
|
import com.seibel.distanthorizons.core.config.types.*;
|
||||||
#if MC_VER <= MC_1_12_2
|
#if MC_VER <= MC_1_12_2
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.OnPressed;
|
|
||||||
#else
|
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.updater.ChangelogScreen;
|
|
||||||
#endif
|
#endif
|
||||||
|
import com.seibel.distanthorizons.common.wrappers.gui.updater.ChangelogScreen;
|
||||||
import com.seibel.distanthorizons.core.config.types.enums.EConfigCommentTextPosition;
|
import com.seibel.distanthorizons.core.config.types.enums.EConfigCommentTextPosition;
|
||||||
import com.seibel.distanthorizons.core.config.types.enums.EConfigValidity;
|
import com.seibel.distanthorizons.core.config.types.enums.EConfigValidity;
|
||||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||||
@@ -95,6 +91,10 @@ class DhConfigScreen extends DhScreen
|
|||||||
|
|
||||||
private static final MinecraftClientWrapper MC_CLIENT = MinecraftClientWrapper.INSTANCE;
|
private static final MinecraftClientWrapper MC_CLIENT = MinecraftClientWrapper.INSTANCE;
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private static final int changelogButton_id = 101;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MC_VER <= MC_1_12_2
|
#if MC_VER <= MC_1_12_2
|
||||||
private final GuiScreen parent;
|
private final GuiScreen parent;
|
||||||
#else
|
#else
|
||||||
@@ -176,13 +176,15 @@ class DhConfigScreen extends DhScreen
|
|||||||
ConfigHandler.INSTANCE.configFileHandler.loadFromFile();
|
ConfigHandler.INSTANCE.configFileHandler.loadFromFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MC_VER > MC_1_12_2
|
|
||||||
// Changelog button
|
// Changelog button
|
||||||
if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()
|
if (Config.Client.Advanced.AutoUpdater.enableAutoUpdater.get()
|
||||||
// we only have changelogs for stable builds
|
// we only have changelogs for stable builds
|
||||||
&& !ModInfo.IS_DEV_BUILD)
|
&& !ModInfo.IS_DEV_BUILD)
|
||||||
{
|
{
|
||||||
this.addBtn(new TexturedButtonWidget(
|
this.addBtn(new TexturedButtonWidget(
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
changelogButton_id,
|
||||||
|
#endif
|
||||||
// Where the button is on the screen
|
// Where the button is on the screen
|
||||||
this.width - 28, this.height - 28,
|
this.width - 28, this.height - 28,
|
||||||
// Width and height of the button
|
// Width and height of the button
|
||||||
@@ -200,6 +202,7 @@ class DhConfigScreen extends DhScreen
|
|||||||
#endif
|
#endif
|
||||||
20, 20,
|
20, 20,
|
||||||
// Create the button and tell it where to go
|
// Create the button and tell it where to go
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
(buttonWidget) -> {
|
(buttonWidget) -> {
|
||||||
ChangelogScreen changelogScreen = new ChangelogScreen(this);
|
ChangelogScreen changelogScreen = new ChangelogScreen(this);
|
||||||
if (changelogScreen.usable)
|
if (changelogScreen.usable)
|
||||||
@@ -211,11 +214,15 @@ class DhConfigScreen extends DhScreen
|
|||||||
LOGGER.warn("Changelog was not able to open");
|
LOGGER.warn("Changelog was not able to open");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
#endif
|
||||||
// Add a title to the button
|
// Add a title to the button
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Translatable(ModInfo.ID + ".updater.title").getFormattedText()
|
||||||
|
#else
|
||||||
Translatable(ModInfo.ID + ".updater.title")
|
Translatable(ModInfo.ID + ".updater.title")
|
||||||
|
#endif
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
// back button
|
// back button
|
||||||
@@ -1003,6 +1010,24 @@ class DhConfigScreen extends DhScreen
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if MC_VER <= MC_1_12_2
|
#if MC_VER <= MC_1_12_2
|
||||||
|
@Override
|
||||||
|
protected void actionPerformed(GuiButton button)
|
||||||
|
{
|
||||||
|
super.actionPerformed(button);
|
||||||
|
if(button.id == changelogButton_id)
|
||||||
|
{
|
||||||
|
ChangelogScreen changelogScreen = new ChangelogScreen(this);
|
||||||
|
if (changelogScreen.usable)
|
||||||
|
{
|
||||||
|
Minecraft.getMinecraft().displayGuiScreen(changelogScreen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGGER.warn("Changelog was not able to open");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws java.io.IOException
|
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws java.io.IOException
|
||||||
{
|
{
|
||||||
@@ -1077,7 +1102,9 @@ class DhConfigScreen extends DhScreen
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ConfigHandler.INSTANCE.configFileHandler.saveToFile();
|
ConfigHandler.INSTANCE.configFileHandler.saveToFile();
|
||||||
#if MC_VER > MC_1_12_2
|
#if MC_VER <= MC_1_12_2
|
||||||
|
// Handled by button to avoid recursive loop
|
||||||
|
#else
|
||||||
Objects.requireNonNull(this.minecraft).setScreen(this.parent);
|
Objects.requireNonNull(this.minecraft).setScreen(this.parent);
|
||||||
#endif
|
#endif
|
||||||
ClassicConfigGUI.CONFIG_CORE_INTERFACE.onScreenChangeListenerList.forEach((listener) -> listener.run());
|
ClassicConfigGUI.CONFIG_CORE_INTERFACE.onScreenChangeListenerList.forEach((listener) -> listener.run());
|
||||||
|
|||||||
+160
-19
@@ -1,6 +1,6 @@
|
|||||||
package com.seibel.distanthorizons.common.wrappers.gui.updater;
|
package com.seibel.distanthorizons.common.wrappers.gui.updater;
|
||||||
#if MC_VER > MC_1_12_2
|
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
||||||
|
import com.seibel.distanthorizons.common.wrappers.gui.classicConfig.ClassicConfigGUI;
|
||||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||||
@@ -8,19 +8,30 @@ import com.seibel.distanthorizons.coreapi.ModInfo;
|
|||||||
import com.seibel.distanthorizons.core.jar.installer.MarkdownFormatter;
|
import com.seibel.distanthorizons.core.jar.installer.MarkdownFormatter;
|
||||||
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.GuiListExtended;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
#else
|
||||||
import net.minecraft.client.gui.Font;
|
import net.minecraft.client.gui.Font;
|
||||||
import net.minecraft.client.gui.components.AbstractWidget;
|
import net.minecraft.client.gui.components.AbstractWidget;
|
||||||
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
|
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
|
||||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
#endif
|
||||||
import com.seibel.distanthorizons.core.logging.DhLogger;
|
import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||||
|
|
||||||
|
|
||||||
#if MC_VER >= MC_1_17_1
|
#if MC_VER >= MC_1_17_1
|
||||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MC_VER < MC_1_20_1
|
#if MC_VER <= MC_1_12_2
|
||||||
|
#elif MC_VER < MC_1_20_1
|
||||||
import net.minecraft.client.gui.GuiComponent;
|
import net.minecraft.client.gui.GuiComponent;
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
#elif MC_VER <= MC_1_21_11
|
#elif MC_VER <= MC_1_21_11
|
||||||
@@ -44,14 +55,22 @@ public class ChangelogScreen extends DhScreen
|
|||||||
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
||||||
|
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private GuiScreen parent;
|
||||||
|
#else
|
||||||
private Screen parent;
|
private Screen parent;
|
||||||
|
#endif
|
||||||
private String versionID;
|
private String versionID;
|
||||||
private List<String> changelog;
|
private List<String> changelog;
|
||||||
private TextArea changelogArea;
|
private TextArea changelogArea;
|
||||||
|
|
||||||
public boolean usable = false;
|
public boolean usable = false;
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public ChangelogScreen(GuiScreen parent)
|
||||||
|
#else
|
||||||
public ChangelogScreen(Screen parent)
|
public ChangelogScreen(Screen parent)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
this(parent, null);
|
this(parent, null);
|
||||||
|
|
||||||
@@ -86,7 +105,11 @@ public class ChangelogScreen extends DhScreen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public ChangelogScreen(GuiScreen parent, String versionID)
|
||||||
|
#else
|
||||||
public ChangelogScreen(Screen parent, String versionID)
|
public ChangelogScreen(Screen parent, String versionID)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
super(Translatable(ModInfo.ID + ".updater.title"));
|
super(Translatable(ModInfo.ID + ".updater.title"));
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
@@ -142,9 +165,18 @@ public class ChangelogScreen extends DhScreen
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void initGui()
|
||||||
|
#else
|
||||||
protected void init()
|
protected void init()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
super.initGui();
|
||||||
|
#else
|
||||||
super.init();
|
super.init();
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!this.usable)
|
if (!this.usable)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -153,12 +185,19 @@ public class ChangelogScreen extends DhScreen
|
|||||||
|
|
||||||
this.addBtn( // Close
|
this.addBtn( // Close
|
||||||
MakeBtn(Translatable(ModInfo.ID + ".general.back"), 5, this.height - 25, 100, 20, (btn) -> {
|
MakeBtn(Translatable(ModInfo.ID + ".general.back"), 5, this.height - 25, 100, 20, (btn) -> {
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Objects.requireNonNull(this.mc).displayGuiScreen(this.parent);
|
||||||
|
#else
|
||||||
this.onClose();
|
this.onClose();
|
||||||
|
#endif
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.changelogArea = new TextArea(this.mc, this.width * 2, this.height, 32, 32, 10);
|
||||||
|
#else
|
||||||
this.changelogArea = new TextArea(this.minecraft, this.width * 2, this.height, 32, 32, 10);
|
this.changelogArea = new TextArea(this.minecraft, this.width * 2, this.height, 32, 32, 10);
|
||||||
|
#endif
|
||||||
for (int i = 0; i < this.changelog.size(); i++)
|
for (int i = 0; i < this.changelog.size(); i++)
|
||||||
{
|
{
|
||||||
this.changelogArea.addButton(TextOrLiteral(this.changelog.get(i)));
|
this.changelogArea.addButton(TextOrLiteral(this.changelog.get(i)));
|
||||||
@@ -168,7 +207,9 @@ public class ChangelogScreen extends DhScreen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
#if MC_VER < MC_1_20_1
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float delta)
|
||||||
|
#elif MC_VER < MC_1_20_1
|
||||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta)
|
public void render(PoseStack matrices, int mouseX, int mouseY, float delta)
|
||||||
#elif MC_VER <= MC_1_21_11
|
#elif MC_VER <= MC_1_21_11
|
||||||
public void render(GuiGraphics matrices, int mouseX, int mouseY, float delta)
|
public void render(GuiGraphics matrices, int mouseX, int mouseY, float delta)
|
||||||
@@ -176,7 +217,9 @@ public class ChangelogScreen extends DhScreen
|
|||||||
public void extractRenderState(GuiGraphicsExtractor matrices, int mouseX, int mouseY, float delta)
|
public void extractRenderState(GuiGraphicsExtractor matrices, int mouseX, int mouseY, float delta)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if MC_VER < MC_1_20_2
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.drawDefaultBackground(); // Render background
|
||||||
|
#elif MC_VER < MC_1_20_2
|
||||||
this.renderBackground(matrices); // Render background
|
this.renderBackground(matrices); // Render background
|
||||||
#elif MC_VER < MC_1_21_6
|
#elif MC_VER < MC_1_21_6
|
||||||
this.renderBackground(matrices, mouseX, mouseY, delta); // Render background
|
this.renderBackground(matrices, mouseX, mouseY, delta); // Render background
|
||||||
@@ -200,7 +243,9 @@ public class ChangelogScreen extends DhScreen
|
|||||||
// This is a bit of a hack as we cannot scroll on this area
|
// This is a bit of a hack as we cannot scroll on this area
|
||||||
double scrollAmount = ((double) mouseY) / ((double) this.height) * 1.1 * maxScroll;
|
double scrollAmount = ((double) mouseY) / ((double) this.height) * 1.1 * maxScroll;
|
||||||
|
|
||||||
#if MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.changelogArea.amountScrolled = (float)scrollAmount;
|
||||||
|
#elif MC_VER == MC_1_16_5 || MC_VER == MC_1_17_1
|
||||||
this.changelogArea.setScrollAmount(scrollAmount);
|
this.changelogArea.setScrollAmount(scrollAmount);
|
||||||
#elif MC_VER <= MC_1_21_3
|
#elif MC_VER <= MC_1_21_3
|
||||||
this.changelogArea.scrollAmount = scrollAmount;
|
this.changelogArea.scrollAmount = scrollAmount;
|
||||||
@@ -208,9 +253,13 @@ public class ChangelogScreen extends DhScreen
|
|||||||
this.changelogArea.setScrollAmount(scrollAmount);
|
this.changelogArea.setScrollAmount(scrollAmount);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// render order matters, otherwise on
|
||||||
// render order matters, otherwise on 1.20.6+ the blurred background will render on top of the text
|
// 1.12.2- buttons won't render
|
||||||
#if MC_VER <= MC_1_21_11
|
// 1.20.6+ the blurred background will render on top of the text
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.changelogArea.drawScreen(mouseX, mouseY, delta); // Render the changelog
|
||||||
|
super.drawScreen(mouseX, mouseY, delta); // Render the buttons
|
||||||
|
#elif MC_VER <= MC_1_21_11
|
||||||
super.render(matrices, mouseX, mouseY, delta); // Render the buttons
|
super.render(matrices, mouseX, mouseY, delta); // Render the buttons
|
||||||
this.changelogArea.render(matrices, mouseX, mouseY, delta); // Render the changelog
|
this.changelogArea.render(matrices, mouseX, mouseY, delta); // Render the changelog
|
||||||
#else
|
#else
|
||||||
@@ -218,18 +267,44 @@ public class ChangelogScreen extends DhScreen
|
|||||||
this.changelogArea.extractRenderState(matrices, mouseX, mouseY, delta); // Render the changelog
|
this.changelogArea.extractRenderState(matrices, mouseX, mouseY, delta); // Render the changelog
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this.DhDrawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 0xFFFFFF); // Render title
|
// Render title
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.DhDrawCenteredString(this.title, this.width / 2, 15, 0xFFFFFF);
|
||||||
|
#else
|
||||||
|
this.DhDrawCenteredString(matrices, this.font, this.title, this.width / 2, 15, 0xFFFFFF);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void onGuiClosed()
|
||||||
|
#else
|
||||||
public void onClose()
|
public void onClose()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Objects.requireNonNull(this.minecraft).setScreen(this.parent); // Goto the parent screen
|
// Go to the parent screen
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
// Handled by button to avoid recursive loop
|
||||||
|
#else
|
||||||
|
Objects.requireNonNull(this.minecraft).setScreen(this.parent);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public static class TextArea extends GuiListExtended
|
||||||
|
#else
|
||||||
public static class TextArea extends ContainerObjectSelectionList<ButtonEntry>
|
public static class TextArea extends ContainerObjectSelectionList<ButtonEntry>
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public List<ButtonEntry> children = new ArrayList<>();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
FontRenderer textRenderer;
|
||||||
|
#else
|
||||||
Font textRenderer;
|
Font textRenderer;
|
||||||
|
#endif
|
||||||
|
|
||||||
public TextArea(Minecraft minecraftClient, int canvasWidth, int canvasHeight, int topMargin, int botMargin, int itemSpacing)
|
public TextArea(Minecraft minecraftClient, int canvasWidth, int canvasHeight, int topMargin, int botMargin, int itemSpacing)
|
||||||
{
|
{
|
||||||
@@ -238,63 +313,129 @@ public class ChangelogScreen extends DhScreen
|
|||||||
#else
|
#else
|
||||||
super(minecraftClient, canvasWidth, canvasHeight - (topMargin + botMargin), topMargin, itemSpacing);
|
super(minecraftClient, canvasWidth, canvasHeight - (topMargin + botMargin), topMargin, itemSpacing);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this.centerListVertically = false;
|
this.centerListVertically = false;
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.textRenderer = minecraftClient.fontRenderer;
|
||||||
|
#else
|
||||||
this.textRenderer = minecraftClient.font;
|
this.textRenderer = minecraftClient.font;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void addButton(ITextComponent text)
|
||||||
|
#else
|
||||||
public void addButton(Component text)
|
public void addButton(Component text)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.children.add(ButtonEntry.create(text));
|
||||||
|
#else
|
||||||
this.addEntry(ButtonEntry.create(text));
|
this.addEntry(ButtonEntry.create(text));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public int getListWidth()
|
||||||
|
#else
|
||||||
public int getRowWidth()
|
public int getRowWidth()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return 10000;
|
return 10_000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
@Override
|
||||||
|
protected int getSize()
|
||||||
|
{
|
||||||
|
return this.children.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IGuiListEntry getListEntry(int index)
|
||||||
|
{
|
||||||
|
return this.children.get(index);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public static class ButtonEntry implements GuiListExtended.IGuiListEntry
|
||||||
|
#else
|
||||||
public static class ButtonEntry extends ContainerObjectSelectionList.Entry<ButtonEntry>
|
public static class ButtonEntry extends ContainerObjectSelectionList.Entry<ButtonEntry>
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private static final FontRenderer textRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||||
|
#else
|
||||||
private static final Font textRenderer = Minecraft.getInstance().font;
|
private static final Font textRenderer = Minecraft.getInstance().font;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private final ITextComponent text;
|
||||||
|
#else
|
||||||
private final Component text;
|
private final Component text;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private final List<Gui> children = new ArrayList<>();
|
||||||
|
#else
|
||||||
private final List<AbstractWidget> children = new ArrayList<>();
|
private final List<AbstractWidget> children = new ArrayList<>();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private ButtonEntry(ITextComponent text) { this.text = text; }
|
||||||
|
#else
|
||||||
private ButtonEntry(Component text) { this.text = text; }
|
private ButtonEntry(Component text) { this.text = text; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public static ButtonEntry create(ITextComponent text)
|
||||||
|
#else
|
||||||
public static ButtonEntry create(Component text)
|
public static ButtonEntry create(Component text)
|
||||||
|
#endif
|
||||||
{ return new ButtonEntry(text); }
|
{ return new ButtonEntry(text); }
|
||||||
|
|
||||||
#if MC_VER < MC_1_20_1
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected, float tickDelta)
|
||||||
|
{ textRenderer.drawString(text.getFormattedText(), 12, y + 5, 0xFFFFFF); }
|
||||||
|
#elif MC_VER < MC_1_20_1
|
||||||
public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta)
|
public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta)
|
||||||
{ GuiComponent.drawString(matrices, textRenderer, text, 12, y + 5, 0xFFFFFF); }
|
{ GuiComponent.drawString(matrices, textRenderer, text, 12, y + 5, 0xFFFFFF); }
|
||||||
#elif MC_VER < MC_1_21_9
|
#elif MC_VER < MC_1_21_9
|
||||||
@Override
|
|
||||||
public void render(GuiGraphics matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta)
|
public void render(GuiGraphics matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta)
|
||||||
{ matrices.drawString(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
{ matrices.drawString(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
||||||
#elif MC_VER <= MC_1_21_11
|
#elif MC_VER <= MC_1_21_11
|
||||||
@Override
|
|
||||||
public void renderContent(GuiGraphics matrices, int y, int x, boolean hovered, float tickDelta)
|
public void renderContent(GuiGraphics matrices, int y, int x, boolean hovered, float tickDelta)
|
||||||
{ matrices.drawString(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
{ matrices.drawString(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
||||||
#else
|
#else
|
||||||
@Override
|
|
||||||
public void extractContent(GuiGraphicsExtractor matrices, int y, int x, boolean hovered, float tickDelta)
|
public void extractContent(GuiGraphicsExtractor matrices, int y, int x, boolean hovered, float tickDelta)
|
||||||
{ matrices.text(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
{ matrices.text(textRenderer, this.text, 12, y + 5, 0xFFFFFF); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
@Override
|
@Override
|
||||||
public List<? extends GuiEventListener> children() { return this.children; }
|
public List<? extends GuiEventListener> children() { return this.children; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MC_VER >= MC_1_17_1
|
#if MC_VER >= MC_1_17_1
|
||||||
@Override
|
@Override
|
||||||
public List<? extends NarratableEntry> narratables() { return this.children; }
|
public List<? extends NarratableEntry> narratables() { return this.children; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
@Override
|
||||||
|
public void updatePosition(int slotIndex, int x, int y, float partialTicks) { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY) { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) { }
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
+92
-15
@@ -1,5 +1,4 @@
|
|||||||
package com.seibel.distanthorizons.common.wrappers.gui.updater;
|
package com.seibel.distanthorizons.common.wrappers.gui.updater;
|
||||||
#if MC_VER > MC_1_12_2
|
|
||||||
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
|
import com.seibel.distanthorizons.api.enums.config.EDhApiUpdateBranch;
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
import com.seibel.distanthorizons.common.wrappers.gui.DhScreen;
|
||||||
import com.seibel.distanthorizons.common.wrappers.gui.TexturedButtonWidget;
|
import com.seibel.distanthorizons.common.wrappers.gui.TexturedButtonWidget;
|
||||||
@@ -10,10 +9,14 @@ import com.seibel.distanthorizons.core.config.Config;
|
|||||||
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
import com.seibel.distanthorizons.core.jar.installer.ModrinthGetter;
|
||||||
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
|
import com.seibel.distanthorizons.core.jar.updater.SelfUpdater;
|
||||||
import com.seibel.distanthorizons.core.logging.DhLogger;
|
import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
#else
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if MC_VER < MC_1_20_1
|
#if MC_VER <= MC_1_12_2
|
||||||
|
#elif MC_VER < MC_1_20_1
|
||||||
import com.mojang.blaze3d.vertex.PoseStack;
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
#elif MC_VER <= MC_1_21_11
|
#elif MC_VER <= MC_1_21_11
|
||||||
import net.minecraft.client.gui.GuiGraphics;
|
import net.minecraft.client.gui.GuiGraphics;
|
||||||
@@ -21,7 +24,9 @@ import net.minecraft.client.gui.GuiGraphics;
|
|||||||
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
import net.minecraft.client.gui.GuiGraphicsExtractor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MC_VER <= MC_1_21_10
|
#if MC_VER <= MC_1_12_2
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
#elif MC_VER <= MC_1_21_10
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
#else
|
#else
|
||||||
import net.minecraft.resources.Identifier;
|
import net.minecraft.resources.Identifier;
|
||||||
@@ -40,15 +45,26 @@ public class UpdateModScreen extends DhScreen
|
|||||||
{
|
{
|
||||||
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
private static final DhLogger LOGGER = new DhLoggerBuilder().build();
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private GuiScreen parent;
|
||||||
|
#else
|
||||||
private Screen parent;
|
private Screen parent;
|
||||||
|
#endif
|
||||||
private String newVersionID;
|
private String newVersionID;
|
||||||
|
|
||||||
private String currentVer;
|
private String currentVer;
|
||||||
private String nextVer;
|
private String nextVer;
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
private static final int logoButton_id = 100;
|
||||||
|
private static final int changelogButton_id = 101;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public UpdateModScreen(GuiScreen parent, String newVersionID) throws IllegalArgumentException
|
||||||
|
#else
|
||||||
public UpdateModScreen(Screen parent, String newVersionID) throws IllegalArgumentException
|
public UpdateModScreen(Screen parent, String newVersionID) throws IllegalArgumentException
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
super(Translatable(ModInfo.ID + ".updater.title"));
|
super(Translatable(ModInfo.ID + ".updater.title"));
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
@@ -76,10 +92,17 @@ public class UpdateModScreen extends DhScreen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void initGui()
|
||||||
|
#else
|
||||||
protected void init()
|
protected void init()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
super.initGui();
|
||||||
|
#else
|
||||||
super.init();
|
super.init();
|
||||||
|
#endif
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -87,6 +110,9 @@ public class UpdateModScreen extends DhScreen
|
|||||||
|
|
||||||
// Logo image
|
// Logo image
|
||||||
this.addBtn(new TexturedButtonWidget(
|
this.addBtn(new TexturedButtonWidget(
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
logoButton_id,
|
||||||
|
#endif
|
||||||
// Where the button is on the screen
|
// Where the button is on the screen
|
||||||
this.width / 2 - 95, this.height / 2 - 110,
|
this.width / 2 - 95, this.height / 2 - 110,
|
||||||
// Width and height of the button
|
// Width and height of the button
|
||||||
@@ -105,9 +131,15 @@ public class UpdateModScreen extends DhScreen
|
|||||||
195, 65,
|
195, 65,
|
||||||
// Create the button and tell it where to go
|
// Create the button and tell it where to go
|
||||||
// For now it goes to the client option by default
|
// For now it goes to the client option by default
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
(buttonWidget) -> LOGGER.info("Nice, you found an Easter egg :)"),
|
(buttonWidget) -> LOGGER.info("Nice, you found an Easter egg :)"),
|
||||||
|
#endif
|
||||||
// Add a title to the button
|
// Add a title to the button
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Translatable(ModInfo.ID + ".updater.title").getFormattedText(),
|
||||||
|
#else
|
||||||
Translatable(ModInfo.ID + ".updater.title"),
|
Translatable(ModInfo.ID + ".updater.title"),
|
||||||
|
#endif
|
||||||
// Dont render the background of the button
|
// Dont render the background of the button
|
||||||
false
|
false
|
||||||
));
|
));
|
||||||
@@ -120,6 +152,9 @@ public class UpdateModScreen extends DhScreen
|
|||||||
if (!ModInfo.IS_DEV_BUILD)
|
if (!ModInfo.IS_DEV_BUILD)
|
||||||
{
|
{
|
||||||
this.addBtn(new TexturedButtonWidget(
|
this.addBtn(new TexturedButtonWidget(
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
changelogButton_id,
|
||||||
|
#endif
|
||||||
// Where the button is on the screen
|
// Where the button is on the screen
|
||||||
this.width / 2 - 97, this.height / 2 + 8,
|
this.width / 2 - 97, this.height / 2 + 8,
|
||||||
// Width and height of the button
|
// Width and height of the button
|
||||||
@@ -137,9 +172,15 @@ public class UpdateModScreen extends DhScreen
|
|||||||
#endif
|
#endif
|
||||||
20, 20,
|
20, 20,
|
||||||
// Create the button and tell it where to go
|
// Create the button and tell it where to go
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
(buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)),
|
(buttonWidget) -> Objects.requireNonNull(this.minecraft).setScreen(new ChangelogScreen(this, this.newVersionID)),
|
||||||
|
#endif
|
||||||
// Add a title to the button
|
// Add a title to the button
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Translatable(ModInfo.ID + ".updater.title").getFormattedText()
|
||||||
|
#else
|
||||||
Translatable(ModInfo.ID + ".updater.title")
|
Translatable(ModInfo.ID + ".updater.title")
|
||||||
|
#endif
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,32 +188,50 @@ public class UpdateModScreen extends DhScreen
|
|||||||
this.addBtn( // Update
|
this.addBtn( // Update
|
||||||
MakeBtn(Translatable(ModInfo.ID + ".updater.update"), this.width / 2 - 75, this.height / 2 + 8, 150, 20, (btn) -> {
|
MakeBtn(Translatable(ModInfo.ID + ".updater.update"), this.width / 2 - 75, this.height / 2 + 8, 150, 20, (btn) -> {
|
||||||
SelfUpdater.updateMod();
|
SelfUpdater.updateMod();
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Objects.requireNonNull(this.mc).displayGuiScreen(this.parent);
|
||||||
|
#else
|
||||||
this.onClose();
|
this.onClose();
|
||||||
|
#endif
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
this.addBtn( // Silent update
|
this.addBtn( // Silent update
|
||||||
MakeBtn(Translatable(ModInfo.ID + ".updater.silent"), this.width / 2 - 75, this.height / 2 + 30, 150, 20, (btn) -> {
|
MakeBtn(Translatable(ModInfo.ID + ".updater.silent"), this.width / 2 - 75, this.height / 2 + 30, 150, 20, (btn) -> {
|
||||||
Config.Client.Advanced.AutoUpdater.enableSilentUpdates.set(true);
|
Config.Client.Advanced.AutoUpdater.enableSilentUpdates.set(true);
|
||||||
SelfUpdater.updateMod();
|
SelfUpdater.updateMod();
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Objects.requireNonNull(this.mc).displayGuiScreen(this.parent);
|
||||||
|
#else
|
||||||
this.onClose();
|
this.onClose();
|
||||||
|
#endif
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
this.addBtn( // Later (not now)
|
this.addBtn( // Later (not now)
|
||||||
MakeBtn(Translatable(ModInfo.ID + ".updater.later"), this.width / 2 + 2, this.height / 2 + 70, 100, 20, (btn) -> {
|
MakeBtn(Translatable(ModInfo.ID + ".updater.later"), this.width / 2 + 2, this.height / 2 + 70, 100, 20, (btn) -> {
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Objects.requireNonNull(this.mc).displayGuiScreen(this.parent);
|
||||||
|
#else
|
||||||
this.onClose();
|
this.onClose();
|
||||||
|
#endif
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
this.addBtn( // Never
|
this.addBtn( // Never
|
||||||
MakeBtn(Translatable(ModInfo.ID + ".updater.never"), this.width / 2 - 102, this.height / 2 + 70, 100, 20, (btn) -> {
|
MakeBtn(Translatable(ModInfo.ID + ".updater.never"), this.width / 2 - 102, this.height / 2 + 70, 100, 20, (btn) -> {
|
||||||
Config.Client.Advanced.AutoUpdater.enableAutoUpdater.set(false);
|
Config.Client.Advanced.AutoUpdater.enableAutoUpdater.set(false);
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
Objects.requireNonNull(this.mc).displayGuiScreen(this.parent);
|
||||||
|
#else
|
||||||
this.onClose();
|
this.onClose();
|
||||||
|
#endif
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
#if MC_VER < MC_1_20_1
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float delta)
|
||||||
|
#elif MC_VER < MC_1_20_1
|
||||||
public void render(PoseStack matrices, int mouseX, int mouseY, float delta)
|
public void render(PoseStack matrices, int mouseX, int mouseY, float delta)
|
||||||
#elif MC_VER <= MC_1_21_11
|
#elif MC_VER <= MC_1_21_11
|
||||||
public void render(GuiGraphics matrices, int mouseX, int mouseY, float delta)
|
public void render(GuiGraphics matrices, int mouseX, int mouseY, float delta)
|
||||||
@@ -180,7 +239,9 @@ public class UpdateModScreen extends DhScreen
|
|||||||
public void extractRenderState(GuiGraphicsExtractor matrices, int mouseX, int mouseY, float delta)
|
public void extractRenderState(GuiGraphicsExtractor matrices, int mouseX, int mouseY, float delta)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if MC_VER < MC_1_20_2
|
#if MC_VER <= MC_1_12_2
|
||||||
|
this.drawDefaultBackground(); // Render background
|
||||||
|
#elif MC_VER < MC_1_20_2
|
||||||
this.renderBackground(matrices); // Render background
|
this.renderBackground(matrices); // Render background
|
||||||
#elif MC_VER < MC_1_21_6
|
#elif MC_VER < MC_1_21_6
|
||||||
this.renderBackground(matrices, mouseX, mouseY, delta); // Render background
|
this.renderBackground(matrices, mouseX, mouseY, delta); // Render background
|
||||||
@@ -188,14 +249,19 @@ public class UpdateModScreen extends DhScreen
|
|||||||
// background blur is already being rendered, rendering again causes the game to crash
|
// background blur is already being rendered, rendering again causes the game to crash
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MC_VER <= MC_1_21_11
|
#if MC_VER <= MC_1_12_2
|
||||||
|
super.drawScreen(mouseX, mouseY, delta); // Render the buttons
|
||||||
|
#elif MC_VER <= MC_1_21_11
|
||||||
super.render(matrices, mouseX, mouseY, delta); // Render the buttons
|
super.render(matrices, mouseX, mouseY, delta); // Render the buttons
|
||||||
#else
|
#else
|
||||||
super.extractRenderState(matrices, mouseX, mouseY, delta);
|
super.extractRenderState(matrices, mouseX, mouseY, delta);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Render the text's
|
// Render the text's
|
||||||
this.DhDrawCenteredString(matrices, this.font,
|
this.DhDrawCenteredString(
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
|
matrices, this.font,
|
||||||
|
#endif
|
||||||
Translatable(ModInfo.ID + ".updater.text1"),
|
Translatable(ModInfo.ID + ".updater.text1"),
|
||||||
this.width / 2, this.height / 2 - 35,
|
this.width / 2, this.height / 2 - 35,
|
||||||
#if MC_VER < MC_1_21_6
|
#if MC_VER < MC_1_21_6
|
||||||
@@ -204,7 +270,10 @@ public class UpdateModScreen extends DhScreen
|
|||||||
0xFFFFFFFF // ARGB
|
0xFFFFFFFF // ARGB
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
this.DhDrawCenteredString(matrices, this.font,
|
this.DhDrawCenteredString(
|
||||||
|
#if MC_VER > MC_1_12_2
|
||||||
|
matrices, this.font,
|
||||||
|
#endif
|
||||||
Translatable(ModInfo.ID + ".updater.text2", this.currentVer, this.nextVer),
|
Translatable(ModInfo.ID + ".updater.text2", this.currentVer, this.nextVer),
|
||||||
this.width / 2, this.height / 2 - 20,
|
this.width / 2, this.height / 2 - 20,
|
||||||
#if MC_VER < MC_1_21_6
|
#if MC_VER < MC_1_21_6
|
||||||
@@ -216,10 +285,18 @@ public class UpdateModScreen extends DhScreen
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
public void onGuiClosed()
|
||||||
|
#else
|
||||||
public void onClose()
|
public void onClose()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Objects.requireNonNull(this.minecraft).setScreen(this.parent); // Go to the parent screen
|
// Go to the parent screen
|
||||||
|
#if MC_VER <= MC_1_12_2
|
||||||
|
// Handled by button to avoid recursive loop
|
||||||
|
#else
|
||||||
|
Objects.requireNonNull(this.minecraft).setScreen(this.parent);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
public net.minecraft.client.renderer.EntityRenderer getFOVModifier(FZ)F
|
public net.minecraft.client.renderer.EntityRenderer getFOVModifier(FZ)F
|
||||||
public net.minecraft.client.renderer.ActiveRenderInfo MODELVIEW
|
public net.minecraft.client.renderer.ActiveRenderInfo MODELVIEW
|
||||||
public net.minecraft.client.renderer.ActiveRenderInfo PROJECTION
|
public net.minecraft.client.renderer.ActiveRenderInfo PROJECTION
|
||||||
|
public net.minecraft.client.gui.GuiSlot amountScrolled
|
||||||
Reference in New Issue
Block a user