From d41a4605894f82243e58073ebd0f91f274bc430e Mon Sep 17 00:00:00 2001
From: FalsePattern <30945458+FalsePattern@users.noreply.github.com>
Date: Sat, 30 Jul 2022 23:26:25 +0200
Subject: [PATCH] TOASTED. R O A S T E D.
---
.../lib/internal/FalsePatternLib.java | 8 +-
.../internal/{ => config}/LibraryConfig.java | 17 +-
.../{ => config}/LibraryGuiConfig.java | 6 +-
.../{ => config}/LibraryGuiFactory.java | 2 +-
.../lib/internal/config/ToastConfig.java | 55 ++++++
.../dependencies/DependencyLoaderImpl.java | 2 +-
.../lib/internal/impl/toast/GuiToastImpl.java | 186 ++++++++++++++++++
.../lib/internal/proxy/ClientProxy.java | 21 +-
.../lib/internal/proxy/CommonProxy.java | 9 +-
.../com/falsepattern/lib/toasts/GuiToast.java | 49 +++++
.../com/falsepattern/lib/toasts/IToast.java | 70 +++++++
.../falsepattern/lib/toasts/SimpleToast.java | 126 ++++++++++++
.../falsepattern/lib/toasts/icon/ToastBG.java | 70 +++++++
.../lib/toasts/icon/ToastIcon.java | 52 +++++
.../lib/toasts/icon/ToastTexture.java | 55 ++++++
.../lib/updates/UpdateChecker.java | 2 +-
.../com/falsepattern/lib/util/RenderUtil.java | 60 +++++-
.../assets/falsepatternlib/lang/en_US.lang | 6 +
.../assets/falsepatternlib/sounds.json | 14 ++
.../falsepatternlib/sounds/toast/in.ogg | Bin 0 -> 20040 bytes
.../falsepatternlib/sounds/toast/out.ogg | Bin 0 -> 19939 bytes
.../textures/gui/toast_dark.png | Bin 0 -> 587 bytes
.../textures/gui/toast_dark_rounded.png | Bin 0 -> 611 bytes
.../textures/gui/toast_narrator.png | Bin 0 -> 661 bytes
.../textures/gui/toast_narrator_rounded.png | Bin 0 -> 690 bytes
.../textures/gui/toast_white.png | Bin 0 -> 587 bytes
.../textures/gui/toast_white_rounded.png | Bin 0 -> 611 bytes
27 files changed, 787 insertions(+), 23 deletions(-)
rename src/main/java/com/falsepattern/lib/internal/{ => config}/LibraryConfig.java (67%)
rename src/main/java/com/falsepattern/lib/internal/{ => config}/LibraryGuiConfig.java (86%)
rename src/main/java/com/falsepattern/lib/internal/{ => config}/LibraryGuiFactory.java (96%)
create mode 100644 src/main/java/com/falsepattern/lib/internal/config/ToastConfig.java
create mode 100644 src/main/java/com/falsepattern/lib/internal/impl/toast/GuiToastImpl.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/GuiToast.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/IToast.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/SimpleToast.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/icon/ToastBG.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/icon/ToastIcon.java
create mode 100644 src/main/java/com/falsepattern/lib/toasts/icon/ToastTexture.java
create mode 100644 src/main/resources/assets/falsepatternlib/sounds.json
create mode 100644 src/main/resources/assets/falsepatternlib/sounds/toast/in.ogg
create mode 100644 src/main/resources/assets/falsepatternlib/sounds/toast/out.ogg
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_dark.png
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_dark_rounded.png
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_narrator.png
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_narrator_rounded.png
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_white.png
create mode 100644 src/main/resources/assets/falsepatternlib/textures/gui/toast_white_rounded.png
diff --git a/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java b/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java
index b5b8bf9..8b990d4 100644
--- a/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java
+++ b/src/main/java/com/falsepattern/lib/internal/FalsePatternLib.java
@@ -23,6 +23,7 @@ package com.falsepattern.lib.internal;
import com.falsepattern.lib.internal.proxy.CommonProxy;
import cpw.mods.fml.common.*;
+import cpw.mods.fml.common.event.FMLConstructionEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@@ -41,7 +42,7 @@ import org.apache.logging.log4j.Logger;
name = Tags.MODNAME,
version = Tags.VERSION,
acceptedMinecraftVersions = "[1.7.10]",
- guiFactory = Tags.GROUPNAME + ".internal.LibraryGuiFactory",
+ guiFactory = Tags.GROUPNAME + ".internal.config.LibraryGuiFactory",
acceptableRemoteVersions = "*")
public class FalsePatternLib {
public static final String UPDATE_URL = "https://falsepattern.com/mc/versions.json";
@@ -58,6 +59,11 @@ public class FalsePatternLib {
log.info("Version " + Tags.VERSION + " initialized!");
}
+ @Mod.EventHandler
+ public void construct(FMLConstructionEvent e) {
+ proxy.construct(e);
+ }
+
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e) {
proxy.preInit(e);
diff --git a/src/main/java/com/falsepattern/lib/internal/LibraryConfig.java b/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java
similarity index 67%
rename from src/main/java/com/falsepattern/lib/internal/LibraryConfig.java
rename to src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java
index 1e18a00..e648872 100644
--- a/src/main/java/com/falsepattern/lib/internal/LibraryConfig.java
+++ b/src/main/java/com/falsepattern/lib/internal/config/LibraryConfig.java
@@ -18,21 +18,24 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED" + * shall be included in all copies or substantial portions of the Software. + *
+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser 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 General Public License for more details. + *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see
+ * The above copyright notice, this permission notice and the word "SNEED"
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see <+T3pWr
zsg+(CQUn@HZh4jHm;8EP |^lOWLnkGdWbP+=>lu^uH-&L%{
z*-lc}89`dEO_01;Op4pnj9+Q+2x-k)JnoOdY1vvfqH&^$`Rf> chatFuture;
+ @Override
+ public void construct(FMLConstructionEvent e) {
+ super.construct(e);
+ GuiToastImpl.initialize(Minecraft.getMinecraft());
+ }
+
@Override
public void preInit(FMLPreInitializationEvent e) {
super.preInit(e);
diff --git a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java
index 50ad1b0..a6f4795 100644
--- a/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java
+++ b/src/main/java/com/falsepattern/lib/internal/proxy/CommonProxy.java
@@ -23,10 +23,13 @@ package com.falsepattern.lib.internal.proxy;
import com.falsepattern.lib.config.ConfigException;
import com.falsepattern.lib.config.ConfigurationManager;
import com.falsepattern.lib.internal.FalsePatternLib;
-import com.falsepattern.lib.internal.LibraryConfig;
+import com.falsepattern.lib.internal.config.LibraryConfig;
+import com.falsepattern.lib.internal.config.ToastConfig;
import com.falsepattern.lib.internal.impl.config.ConfigurationManagerImpl;
import com.falsepattern.lib.updates.ModUpdateInfo;
import com.falsepattern.lib.updates.UpdateChecker;
+
+import cpw.mods.fml.common.event.FMLConstructionEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import lombok.val;
@@ -39,10 +42,14 @@ public class CommonProxy {
protected CompletableFuture
> updatesFuture;
+ public void construct(FMLConstructionEvent e) {
+ }
+
public void preInit(FMLPreInitializationEvent e) {
ConfigurationManagerImpl.registerBus();
try {
ConfigurationManager.registerConfig(LibraryConfig.class);
+ ConfigurationManager.registerConfig(ToastConfig.class);
} catch (ConfigException ex) {
FalsePatternLib.getLog().error("Failed to register config!", ex);
}
diff --git a/src/main/java/com/falsepattern/lib/toasts/GuiToast.java b/src/main/java/com/falsepattern/lib/toasts/GuiToast.java
new file mode 100644
index 0000000..9f15bb8
--- /dev/null
+++ b/src/main/java/com/falsepattern/lib/toasts/GuiToast.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2022 FalsePattern
+ * All Rights Reserved
+ *
ID}
zUe#enUByl0OK?~|
zdZ%{6t8GvVK!>(YM2hsGU!rp-)TiqCrd!ITOm6hjSZBdMPPxA&OI=s&LI}0Qp(zn{
zv(Iwh_dW=I{b0fI>x1*0=Z|ai_J>Z$1t^%hc9*a618$li4=Vb96y#`*5%0|@u<+g2
zf1bd%R>^3WdMVQ|$*J12@CwJHl@}`KH?i+cS%rP1I{@nR@H%#>PK=-WeAlTc#N-j?
zs%%r)*cf*s#!Ch2#IrM=(~Qs(;5(eoDaltLC+&|G>1VLFPq*Qz)EbGp!P}L_bVTq^=)hWQv)O5S6Jx1gxV`
zWVj`h3YJ~^Y}BA~CTk#1({QV)dbYpXTUgxu`u0z3AnolrcFgAEKXV0xB2S)eN97_c
zPzv4|Z)AglmHJC=8^$#@A0-OurK86c)O&MPVs%Q#c)Vitup>|uu9vK^wd|OEos7DQ
z=5Z$MUc?a9_=JVh<N6(YLnKyF1E1iN**rkU>`7pg}8sNz}Y-(~5FG
z%hwE_Z-ocrpA?MbO)4vS;;SQ~g#CApTo+no^@4Ax%8IIKzWw%1K0og
h)3eWo+r38wii0YTy>G*%m^-=@k7Zz>@sUO>!1`j3G>-+dun^DgcRX!5%w)1
zj10dnOCAw3;U?e;#mbTq5CA)