aboutsummaryrefslogtreecommitdiff
path: root/mod/src
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2023-02-24 15:45:34 +0900
committersyeyoung <cyoung06@naver.com>2023-02-24 15:45:34 +0900
commit6dbdbf581f2999d137c7bae8fa8363a33b8dfc57 (patch)
tree24b9cbb761828adf124f1a72e92fe9f648921dc8 /mod/src
parentbb318751e66f123b46a6c5f06a48f9f566f7eca3 (diff)
downloadSkyblock-Dungeons-Guide-6dbdbf581f2999d137c7bae8fa8363a33b8dfc57.tar.gz
Skyblock-Dungeons-Guide-6dbdbf581f2999d137c7bae8fa8363a33b8dfc57.tar.bz2
Skyblock-Dungeons-Guide-6dbdbf581f2999d137c7bae8fa8363a33b8dfc57.zip
- chroma and gui formatting
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'mod/src')
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/MessageWithLink.java61
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/VersionInfo.java91
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/WidgetUpdateLog.java50
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/MainConfigWidget.java4
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java2
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java4
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/Text.java35
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/richtext/shaders/ChromaShader.java16
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui6
-rw-r--r--mod/src/main/resources/assets/dungeonsguide/gui/update.gui66
-rw-r--r--mod/src/main/resources/versionMeta.properties20
11 files changed, 312 insertions, 43 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/MessageWithLink.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/MessageWithLink.java
new file mode 100644
index 00000000..98181c0a
--- /dev/null
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/MessageWithLink.java
@@ -0,0 +1,61 @@
+/*
+ * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ * Copyright (C) 2023 cyoung06 (syeyoung)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package kr.syeyoung.dungeonsguide.mod;
+
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import java.awt.*;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+public class MessageWithLink extends JEditorPane {
+ public MessageWithLink(String htmlBody) {
+ super("text/html", "<html><body style=\"" + getStyle() + "\">" + htmlBody + "</body></html>");
+ addHyperlinkListener(new HyperlinkListener() {
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+ try {
+ Desktop.getDesktop().browse(e.getURL().toURI());
+ } catch (IOException | URISyntaxException e2) {
+ e2.printStackTrace();
+ }
+ }
+ }
+ });
+ setEditable(false);
+ setBorder(null);
+ }
+
+ static StringBuffer getStyle() {
+ // for copying style
+ JLabel label = new JLabel();
+ Font font = label.getFont();
+ Color color = label.getBackground();
+
+ // create some css from the label's font
+ StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
+ style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
+ style.append("font-size:" + font.getSize() + "pt;");
+ style.append("background-color: rgb("+color.getRed()+","+color.getGreen()+","+color.getBlue()+");");
+ return style;
+ }
+} \ No newline at end of file
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/VersionInfo.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/VersionInfo.java
index 478a74e9..6f535038 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/VersionInfo.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/VersionInfo.java
@@ -22,14 +22,43 @@ import kr.syeyoung.dungeonsguide.launcher.Main;
import kr.syeyoung.dungeonsguide.launcher.branch.Update;
import kr.syeyoung.dungeonsguide.launcher.branch.UpdateBranch;
import kr.syeyoung.dungeonsguide.launcher.branch.UpdateRetrieverUtil;
+import kr.syeyoung.dungeonsguide.launcher.gui.screen.GuiDisplayer;
import kr.syeyoung.dungeonsguide.launcher.loader.*;
+import kr.syeyoung.dungeonsguide.mod.guiv2.GuiScreenAdapter;
+import kr.syeyoung.dungeonsguide.mod.guiv2.elements.GlobalHUDScale;
+import kr.syeyoung.dungeonsguide.mod.guiv2.elements.Scaler;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.ScaledResolution;
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.fml.common.FMLCommonHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import javax.swing.*;
+import java.io.IOException;
import java.util.Optional;
+import java.util.Properties;
public class VersionInfo {
- public static final String VERSION = "4.0.0-beta4.4";
+ public static final String VERSION;
+ public static final int MANDATORY_VERSION;
+
+ static {
+ int MANDATORY_VERSION1;
+ String VERSION1;
+ try {
+ Properties properties = new Properties();
+ properties.load(VersionInfo.class.getResourceAsStream("/versionMeta.properties"));
+ VERSION1 = properties.getProperty("VERSION");
+ MANDATORY_VERSION1 = Integer.parseInt(properties.getProperty("MANDATORY_VERSION", "0"));
+ } catch (Exception e) {
+ VERSION1 = "unknown";
+ MANDATORY_VERSION1 = 0;
+ e.printStackTrace();
+ }
+ MANDATORY_VERSION = MANDATORY_VERSION1;
+ VERSION = VERSION1;
+ }
public static IDGLoader getCurrentLoader() {
return Main.getMain().getCurrentLoader();
@@ -43,23 +72,26 @@ public class VersionInfo {
private static final Logger logger = LogManager.getLogger("OutdatedVersionWarning");
public static void checkAndOpen() {
try {
- if (VersionInfo.getCurrentLoader() instanceof DevEnvLoader) return;
-
- if (VersionInfo.getCurrentLoader() instanceof RemoteLoader) {
- RemoteLoader loader = (RemoteLoader) VersionInfo.getCurrentLoader();
- Update latestUpdate = UpdateRetrieverUtil.getLatestUpdates(loader.getBranchId(), 0).get(0);
- if (latestUpdate.getId() == loader.getUpdateId()) return;
-
- // update alarm gui
- // show newVersion name
- // show update logs
- // a button to try updating
-
- logger.info("Update Required!!");
- // TODO: after new gui framework.
- } else if (VersionInfo.getCurrentLoader() instanceof JarLoader || VersionInfo.getCurrentLoader() instanceof LocalLoader) {
+// if (VersionInfo.getCurrentLoader() instanceof DevEnvLoader) return;
+//
+// if (VersionInfo.getCurrentLoader() instanceof RemoteLoader) {
+// RemoteLoader loader = (RemoteLoader) VersionInfo.getCurrentLoader();
+// Update latestUpdate = UpdateRetrieverUtil.getLatestUpdates(loader.getBranchId(), 0).get(0);
+// if (latestUpdate.getId() == loader.getUpdateId()) return;
+//
+// Scaler scaler = new Scaler();
+// scaler.scale.setValue((double) new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+// scaler.child.setValue(new WidgetUpdateLog(
+// latestUpdate.getName(), latestUpdate.getUpdateLog()
+// ));
+// GuiDisplayer.INSTANCE.displayGui(new GuiScreenAdapter(scaler));
+//
+// logger.info("Update Required!!");
+// } else if (VersionInfo.getCurrentLoader() instanceof JarLoader || VersionInfo.getCurrentLoader() instanceof LocalLoader) {
UpdateBranch requiredUpdateBranch = UpdateRetrieverUtil.getUpdateBranches().stream().filter(a ->
Optional.ofNullable(a.getMetadata())
+ .filter(b -> b.has("additionalMeta"))
+ .map(b -> b.getJSONObject("additionalMeta"))
.filter(b -> b.has("type"))
.map(b -> b.getString("type"))
.filter(b -> b.equals("update-alarm-github"))
@@ -70,16 +102,27 @@ public class VersionInfo {
}
Update latestUpdate = UpdateRetrieverUtil.getLatestUpdates(requiredUpdateBranch.getId(), 0).get(0);
+ if (latestUpdate.getMetadata().optInt("mandatory_version",0 ) > (VersionInfo.MANDATORY_VERSION)) {
+ JOptionPane.showMessageDialog(null,
+ new MessageWithLink("Your version of Dungeons Guide requires a mandatory update!<br/><br/>" +
+ "Join our discord at <a href=\"https://discord.gg/dg\">https://discord.gg/dg</a><br/>" +
+ "Github at <a href=\"https://github.com/Dungeons-Guide/Skyblock-Dungeons-Guide\">https://github.com/Dungeons-Guide/Skyblock-Dungeons-Guide</a>")
+ , "Dungeons Guide Mandatory Update!", JOptionPane.WARNING_MESSAGE);
+ FMLCommonHandler.instance().exitJava(9999, false);
+ }
+
if (latestUpdate.getName().equals(VersionInfo.VERSION)) return;
logger.info("Update Required!!");
- // update alarm gui
- // show newVersion name
- // link to github url
- // show update logs
- // TODO: after new gui framework.
- } else {
- logger.error("Failed to check version: Unknown Loader: " + VersionInfo.getLoaderInfo() + " / " + VersionInfo.getCurrentLoader().getClass().getName());
- }
+
+ Scaler scaler = new Scaler();
+ scaler.scale.setValue((double) new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ scaler.child.setValue(new WidgetUpdateLog(
+ latestUpdate.getName(), latestUpdate.getUpdateLog()
+ ));
+ GuiDisplayer.INSTANCE.displayGui(new GuiScreenAdapter(scaler));
+// } else {
+// logger.error("Failed to check version: Unknown Loader: " + VersionInfo.getLoaderInfo() + " / " + VersionInfo.getCurrentLoader().getClass().getName());
+// }
} catch (Exception e) {
logger.error("Error while checking for updates: ",e);
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/WidgetUpdateLog.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/WidgetUpdateLog.java
new file mode 100644
index 00000000..cb7903e3
--- /dev/null
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/WidgetUpdateLog.java
@@ -0,0 +1,50 @@
+/*
+ * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ * Copyright (C) 2023 cyoung06 (syeyoung)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package kr.syeyoung.dungeonsguide.mod;
+
+import kr.syeyoung.dungeonsguide.launcher.Main;
+import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute;
+import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedImportOnlyWidget;
+import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.Bind;
+import kr.syeyoung.dungeonsguide.mod.guiv2.xml.annotations.On;
+import net.minecraft.client.Minecraft;
+import net.minecraft.util.ResourceLocation;
+
+public class WidgetUpdateLog extends AnnotatedImportOnlyWidget {
+ @Bind(variableName = "updatelog")
+ public final BindableAttribute<String> updateLog = new BindableAttribute<>(String.class);
+ @Bind(variableName = "version")
+ public final BindableAttribute<String> version = new BindableAttribute<>(String.class);
+
+ public WidgetUpdateLog(String version, String updateLog) {
+ super(new ResourceLocation("dungeonsguide:gui/update.gui"));
+ this.version.setValue(version);
+ this.updateLog.setValue(updateLog);
+ }
+
+ @On(functionName = "continue")
+ public void continueB() {
+ Minecraft.getMinecraft().displayGuiScreen(null);
+ }
+
+ @On(functionName = "unload")
+ public void unload() {
+ Main.getMain().unloadWithoutStacktraceReference();
+ }
+}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/MainConfigWidget.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/MainConfigWidget.java
index f22b0c07..28ad0008 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/MainConfigWidget.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/guiconfig/configv3/MainConfigWidget.java
@@ -18,6 +18,7 @@
package kr.syeyoung.dungeonsguide.mod.config.guiconfig.configv3;
+import kr.syeyoung.dungeonsguide.mod.VersionInfo;
import kr.syeyoung.dungeonsguide.mod.config.guiconfig.location2.HUDLocationConfig;
import kr.syeyoung.dungeonsguide.mod.features.AbstractFeature;
import kr.syeyoung.dungeonsguide.mod.features.FeatureRegistry;
@@ -43,6 +44,9 @@ public class MainConfigWidget extends AnnotatedImportOnlyWidget {
@Bind(variableName = "relocate")
public final BindableAttribute<Widget> relocate = new BindableAttribute<>(Widget.class);
+ @Bind(variableName = "version")
+ public final BindableAttribute<String> version = new BindableAttribute<>(String.class, VersionInfo.VERSION);
+
@Bind(variableName = "mainpage")
public final BindableAttribute<Widget> mainPage = new BindableAttribute<>(Widget.class, new MainPageWidget());
public MainConfigWidget() {
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java
index a031a8f3..0130a11f 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/config/types/AColor.java
@@ -56,7 +56,7 @@ public class AColor extends Color {
}
public Shader getShader() {
- if (chroma) return new ChromaShader(chromaSpeed, getRGB());
+ if (chroma) return new ChromaShader(this);
else return new SingleColorShader(getRGB());
}
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java
index 8a89ae25..c2155f21 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/features/text/TextStyle.java
@@ -47,7 +47,7 @@ public class TextStyle {
if (!color.isChroma())
linked.textShader = new SingleColorShader(color.getRGB());
else
- linked.textShader = new ChromaShader(color.getChromaSpeed(), color.getRGB());
+ linked.textShader = new ChromaShader(color);
}
public void setBackground(AColor background) {
@@ -55,7 +55,7 @@ public class TextStyle {
if (!background.isChroma())
linked.backgroundShader = new SingleColorShader(background.getRGB());
else
- linked.backgroundShader = new ChromaShader(background.getChromaSpeed(), background.getRGB());
+ linked.backgroundShader = new ChromaShader(color);
}
private ParentDelegatingTextStyle linked = new ParentDelegatingTextStyle();
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/Text.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/Text.java
index 3a161c55..1f981b92 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/Text.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/Text.java
@@ -18,12 +18,15 @@
package kr.syeyoung.dungeonsguide.mod.guiv2.elements;
+import kr.syeyoung.dungeonsguide.mod.config.types.AColor;
import kr.syeyoung.dungeonsguide.mod.guiv2.BindableAttribute;
import kr.syeyoung.dungeonsguide.mod.guiv2.DomElement;
import kr.syeyoung.dungeonsguide.mod.guiv2.Widget;
import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.BreakWord;
import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.RichText;
import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.TextSpan;
+import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.shaders.ChromaShader;
+import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.shaders.Shader;
import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.shaders.SingleColorShader;
import kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.styles.ParentDelegatingTextStyle;
import kr.syeyoung.dungeonsguide.mod.guiv2.xml.AnnotatedExportOnlyWidget;
@@ -139,13 +142,18 @@ public class Text extends AnnotatedExportOnlyWidget {
char c0 = text.charAt(i);
if (c0 == 167 && i + 1 < text.length()) {
if (!stringBuilder.toString().isEmpty()) {
+ AColor chroma =new AColor(255,0,0,255);
+ chroma.setChromaSpeed(0.3f);
+ chroma.setChroma(true);
+ Shader textShader = textColor == null ? null :
+ textColor== 0x33333333 ? new ChromaShader(chroma) : new SingleColorShader(textColor | 0xFF000000);
spans.add(new TextSpan(
new ParentDelegatingTextStyle()
- .setTextShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setTextShader(textShader)
.setBold(boldStyle)
- .setStrikeThroughShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setStrikeThroughShader(textShader)
.setStrikeThrough(strikethroughStyle)
- .setUnderlineShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setUnderlineShader(textShader)
.setUnderline(underlineStyle)
.setItalics(italicStyle),
stringBuilder.toString()
@@ -154,8 +162,8 @@ public class Text extends AnnotatedExportOnlyWidget {
}
- int i1 = "0123456789abcdefklmnor".indexOf(text.toLowerCase(Locale.ENGLISH).charAt(i + 1));
- if (i1 < 16) {
+ int i1 = "0123456789abcdefklmnorz".indexOf(text.toLowerCase(Locale.ENGLISH).charAt(i + 1));
+ if (i1 < 16 || i1 == 22) {
boldStyle = false;
strikethroughStyle = false;
underlineStyle = false;
@@ -163,7 +171,10 @@ public class Text extends AnnotatedExportOnlyWidget {
if (i1 < 0) {
i1 = 15;
}
- textColor = colorCode[i1];
+ if (i1 == 22)
+ textColor = 0x33333333;
+ else
+ textColor = colorCode[i1];
} else if (i1 == 16) {
} else if (i1 == 17) {
boldStyle = true;
@@ -188,13 +199,19 @@ public class Text extends AnnotatedExportOnlyWidget {
}
if (!stringBuilder.toString().isEmpty()) {
+ AColor chroma =new AColor(255,0,0,255);
+ chroma.setChromaSpeed(0.3f);
+ chroma.setChroma(true);
+ Shader textShader = textColor == null ? null :
+ textColor== 0x33333333 ? new ChromaShader(chroma) : new SingleColorShader(textColor | 0xFF000000);
+
spans.add(new TextSpan(
new ParentDelegatingTextStyle()
- .setTextShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setTextShader(textShader)
.setBold(boldStyle)
- .setStrikeThroughShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setStrikeThroughShader(textShader)
.setStrikeThrough(strikethroughStyle)
- .setUnderlineShader(textColor == null ? null : new SingleColorShader(textColor | 0xFF000000))
+ .setUnderlineShader(textShader)
.setUnderline(underlineStyle)
.setItalics(italicStyle),
stringBuilder.toString()
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/richtext/shaders/ChromaShader.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/richtext/shaders/ChromaShader.java
index 5e1e8bb1..8ee3c5d5 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/richtext/shaders/ChromaShader.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/guiv2/elements/richtext/shaders/ChromaShader.java
@@ -18,21 +18,25 @@
package kr.syeyoung.dungeonsguide.mod.guiv2.elements.richtext.shaders;
+import kr.syeyoung.dungeonsguide.mod.config.types.AColor;
+import kr.syeyoung.dungeonsguide.mod.utils.RenderUtils;
import net.minecraft.client.renderer.GlStateManager;
public class ChromaShader implements Shader {
- private float r, g, b, a;
- public ChromaShader(float chromaSpeed, int color) {
- r = ((color >> 16) & 0xFF) / 255.0f;
- g = ((color >> 8) & 0xFF) / 255.0f;
- b = ((color) & 0xFF) / 255.0f;
- a = ((color >> 24) & 0xFF) / 255.0f;
+ private AColor aColor;
+ public ChromaShader(AColor aColor) {
+ this.aColor = aColor;
}
// argb=
@Override
public void useShader() {
+ int color = RenderUtils.getColorAt(0,0,aColor);
+ float r = ((color >> 16) & 0xFF) / 255.0f;
+ float g = ((color >> 8) & 0xFF) / 255.0f;
+ float b = ((color) & 0xFF) / 255.0f;
+ float a = ((color >> 24) & 0xFF) / 255.0f;
GlStateManager.color(r,g,b,a);
}
diff --git a/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui b/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
index 305faa81..9e6b0f49 100644
--- a/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
+++ b/mod/src/main/resources/assets/dungeonsguide/gui/config/normalconfig.gui
@@ -34,7 +34,11 @@
/>
</aspectRatio>
<padding left="5" top="5" bottom="5" right="5">
- <Text text="Dungeons Guide v4.0 By syeyoung" color="0xFFFFFFFF"/>
+ <row>
+ <Text text="Dungeons Guide v" color="0xFFFFFFFF"/>
+ <Text bind:text="version" color="#FFFFFFFF"/>
+ <Text text=" By syeyoung" color="#FFFFFFFF"/>
+ </row>
</padding>
<size width="5"/>
<flexible>
diff --git a/mod/src/main/resources/assets/dungeonsguide/gui/update.gui b/mod/src/main/resources/assets/dungeonsguide/gui/update.gui
new file mode 100644
index 00000000..db6a9843
--- /dev/null
+++ b/mod/src/main/resources/assets/dungeonsguide/gui/update.gui
@@ -0,0 +1,66 @@
+<!--
+ ~ Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ ~ Copyright (C) 2023 cyoung06 (syeyoung)
+ ~
+ ~ This program is free software: you can redistribute it and/or modify
+ ~ it under the terms of the GNU Affero General Public License as published
+ ~ by the Free Software Foundation, either version 3 of the License, or
+ ~ (at your option) any later version.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ GNU Affero General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Affero General Public License
+ ~ along with this program. If not, see <https://www.gnu.org/licenses/>.
+ -->
+
+<bgcolor backgroundColor="#FF111111">
+ <align vAlign="CENTER">
+ <ConstrainedBox maxHeight="450">
+ <col crossAlign="CENTER">
+ <size width="0" height="10"/>
+ <Text text="New Dungeons Guide Version is Available!" color="#FFFFFFFF" size="16"/>
+ <size width="0" height="5"/>
+ <row mainAlign="CENTER">
+ <Text bind:text="version" size="8" color="#FFFFFFFF"/>
+ <Text text=" Update Log" size="8" color="#FFFFFFFF"/>
+ </row>
+ <size width="0" height="10"/>
+ <flexible>
+ <align hAlign="CENTER">
+ <padding left="10" right="10">
+ <border>
+ <line slot="left" dir="VERTICAL" thickness="1.0" color="#FFFFFFFF"/>
+ <line slot="top" dir="HORIZONTAL" thickness="1.0" color="#FFFFFFFF"/>
+ <line slot="bottom" dir="HORIZONTAL" thickness="1.0" color="#FFFFFFFF"/>
+ <line slot="right" dir="VERTICAL" thickness="1.0" color="#FFFFFFFF"/>
+ <ConstrainedBox maxWidth="600" slot="content">
+ <bgcolor backgroundColor="#FF222222">
+ <ScrollablePanel>
+ <padding left="5" top="5" right="5" bottom="5">
+ <Text bind:text="updatelog" color="#FFFFFFFF"/>
+ </padding>
+ </ScrollablePanel>
+ </bgcolor>
+ </ConstrainedBox>
+ </border>
+ </padding>
+ </align>
+ </flexible>
+ <size width="0" height="15"/>
+ <row mainAlign="CENTER">
+ <size width="200" height="20">
+ <RoundButton text="Unload DG and load new version" on:click="unload"/>
+ </size>
+ <size width="10" height="0"/>
+ <size width="80" height="20">
+ <RoundButton text="Continue" on:click="continue"/>
+ </size>
+ </row>
+ <size width="0" height="10"/>
+ </col>
+ </ConstrainedBox>
+ </align>
+</bgcolor> \ No newline at end of file
diff --git a/mod/src/main/resources/versionMeta.properties b/mod/src/main/resources/versionMeta.properties
new file mode 100644
index 00000000..4761f6c3
--- /dev/null
+++ b/mod/src/main/resources/versionMeta.properties
@@ -0,0 +1,20 @@
+#
+# Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+# Copyright (C) 2023 cyoung06 (syeyoung)
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+
+VERSION=4.0.0-beta4.0
+MANDATORY_VERSION=0 \ No newline at end of file