diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/OneConfig.java | 3 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java (renamed from src/main/java/cc/polyfrost/oneconfig/hud/interfaces/BasicHud.java) | 2 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java | 1 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/hud/interfaces/TextHud.java | 94 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/test/TestHud.java | 2 |
8 files changed, 6 insertions, 102 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/OneConfig.java b/src/main/java/cc/polyfrost/oneconfig/OneConfig.java index eced81e..62bff81 100644 --- a/src/main/java/cc/polyfrost/oneconfig/OneConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/OneConfig.java @@ -72,9 +72,8 @@ public class OneConfig { loadedOtherMods.add(metadata); String author = metadata.authorList.size() > 0 ? metadata.authorList.get(0) : ""; Mod newMod = new Mod(metadata.name, ModType.OTHER, author, metadata.version); - if (newMod.name.equals("Minecraft Coder Pack") || newMod.name.equals("Forge Mod Loader") || newMod.name.equals("Minecraft Forge")) { // TODO add oneconfig + if (newMod.name.equals("Minecraft Coder Pack") || newMod.name.equals("Forge Mod Loader") || newMod.name.equals("Minecraft Forge") || newMod.name.equals("OneConfig")) continue; - } if (modData.add(newMod)) loadedMods.add(newMod); // anti duplicate fix } } diff --git a/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java b/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java index 0fe06ab..efa9e9f 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/OneConfigConfig.java @@ -14,7 +14,6 @@ public class OneConfigConfig extends Config { public static String currentProfile = "Default Profile"; - // TODO i dont know how this works so this is just gonna be here for now public static final int TRANSPARENT = new Color(0, 0, 0, 0).getRGB(); // Transparent // button sidebar normal public static final int BLACK = new Color(0,0,0,255).getRGB(); // Black @@ -51,6 +50,7 @@ public class OneConfigConfig extends Config { public static float CORNER_RADIUS_WIN = 20f; public static float CORNER_RADIUS = 12f; + public static boolean thirdPartyAll = false; public OneConfigConfig() { super(null, "OneConfig.json"); diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java index c3437fa..a67c1d1 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java @@ -1,7 +1,7 @@ package cc.polyfrost.oneconfig.gui; import cc.polyfrost.oneconfig.hud.HudCore; -import cc.polyfrost.oneconfig.hud.interfaces.BasicHud; +import cc.polyfrost.oneconfig.hud.BasicHud; import cc.polyfrost.oneconfig.lwjgl.RenderManager; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java index fc20d35..f9b930b 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/ModsPage.java @@ -48,7 +48,7 @@ public class ModsPage extends Page { int iX = x + 16; int iY = y + 72; for (ModCard modCard : modCards) { - if (modCategories.get(0).isToggled() || (modCategories.get(1).isToggled() && modCard.getModData().modType == ModType.PVP) || (modCategories.get(2).isToggled() && modCard.getModData().modType == ModType.HUD) || (modCategories.get(3).isToggled() && modCard.getModData().modType == ModType.UTIL_QOL) || (modCategories.get(4).isToggled() && modCard.getModData().modType == ModType.HYPIXEL) || (modCategories.get(5).isToggled() && modCard.getModData().modType == ModType.SKYBLOCK) || (modCategories.get(6).isToggled() && modCard.getModData().modType == ModType.OTHER)) { + if (modCategories.get(0).isToggled() && (OneConfigConfig.thirdPartyAll || modCard.getModData().modType != ModType.OTHER) || (modCategories.get(1).isToggled() && modCard.getModData().modType == ModType.PVP) || (modCategories.get(2).isToggled() && modCard.getModData().modType == ModType.HUD) || (modCategories.get(3).isToggled() && modCard.getModData().modType == ModType.UTIL_QOL) || (modCategories.get(4).isToggled() && modCard.getModData().modType == ModType.HYPIXEL) || (modCategories.get(5).isToggled() && modCard.getModData().modType == ModType.SKYBLOCK) || (modCategories.get(6).isToggled() && modCard.getModData().modType == ModType.OTHER)) { modCard.draw(vg, iX, iY); iX += 260; if (iX > x + 796) { diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/interfaces/BasicHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java index e87b33d..12bc162 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/interfaces/BasicHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/BasicHud.java @@ -1,4 +1,4 @@ -package cc.polyfrost.oneconfig.hud.interfaces; +package cc.polyfrost.oneconfig.hud; import cc.polyfrost.oneconfig.lwjgl.RenderManager; diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java b/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java index 072ba70..60ade17 100644 --- a/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java +++ b/src/main/java/cc/polyfrost/oneconfig/hud/HudCore.java @@ -1,6 +1,5 @@ package cc.polyfrost.oneconfig.hud; -import cc.polyfrost.oneconfig.hud.interfaces.BasicHud; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraftforge.client.event.RenderGameOverlayEvent; diff --git a/src/main/java/cc/polyfrost/oneconfig/hud/interfaces/TextHud.java b/src/main/java/cc/polyfrost/oneconfig/hud/interfaces/TextHud.java deleted file mode 100644 index 0027786..0000000 --- a/src/main/java/cc/polyfrost/oneconfig/hud/interfaces/TextHud.java +++ /dev/null @@ -1,94 +0,0 @@ -package cc.polyfrost.oneconfig.hud.interfaces; - -import cc.polyfrost.oneconfig.lwjgl.RenderManager; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; - -import java.util.List; - -public class TextHud extends BasicHud { - /** - * Currently doesn't work because of double extend, will have to be redone somehow (I have no idea how yet) - */ - private final FontRenderer fb = Minecraft.getMinecraft().fontRendererObj; - boolean shadow = false; - boolean doExample = false; - private List<String> cachedLines; - private int cachedWidth; - private int cachedHeight; - private List<String> cachedExampleLines; - private int cachedExampleWidth; - private int cachedExampleHeight; - - protected List<String> update() { - return null; - } - - @SubscribeEvent - private void onTick(TickEvent.ClientTickEvent event) { - if (event.phase != TickEvent.Phase.START) return; - cachedLines = update(); - if (cachedLines != null) { - cachedHeight = cachedLines.size() * (fb.FONT_HEIGHT + 3); - cachedWidth = 0; - for (String line : cachedLines) { - int width = fb.getStringWidth(line); - if (width > cachedWidth) cachedWidth = width; - } - } - if (doExample) { - cachedExampleLines = updateExample(); - if (cachedExampleLines != null) { - cachedExampleHeight = cachedExampleLines.size() * 12; - cachedExampleWidth = 0; - for (String line : cachedExampleLines) { - int width = fb.getStringWidth(line); - if (width > cachedExampleWidth) cachedExampleWidth = width; - } - } - } - } - - protected List<String> updateExample() { - return update(); - } - - @Override - public void draw(int x, int y, float scale) { - if (cachedLines != null) drawText(cachedLines, x, y, scale); - } - - @Override - public void drawExample(int x, int y, float scale) { - doExample = true; - if (cachedExampleLines != null) drawText(cachedExampleLines, x, y, scale); - } - - private void drawText(List<String> lines, int x, int y, float scale) { - for (int i = 0; i < lines.size(); i++) { - RenderManager.drawScaledString(lines.get(i), x, y + i * 12, 0xffffff, shadow, scale); - } - } - - @Override - public int getWidth(float scale) { - return (int) (cachedWidth * scale); - } - - @Override - public int getHeight(float scale) { - return (int) (cachedHeight * scale); - } - - @Override - public int getExampleWidth(float scale) { - return (int) (cachedExampleWidth * scale); - } - - @Override - public int getExampleHeight(float scale) { - return (int) (cachedExampleHeight * scale); - } -} diff --git a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java index ccb7c6b..e225987 100644 --- a/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java +++ b/src/main/java/cc/polyfrost/oneconfig/test/TestHud.java @@ -1,6 +1,6 @@ package cc.polyfrost.oneconfig.test; -import cc.polyfrost.oneconfig.hud.interfaces.BasicHud; +import cc.polyfrost.oneconfig.hud.BasicHud; import cc.polyfrost.oneconfig.lwjgl.RenderManager; import net.minecraft.client.Minecraft; |