diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
54 files changed, 1020 insertions, 372 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index aa9a9ef8..a5991e0f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -20,9 +20,9 @@ package kr.syeyoung.dungeonsguide.commands; import com.google.gson.JsonObject; import kr.syeyoung.dungeonsguide.DungeonsGuide; -import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; +import kr.syeyoung.dungeonsguide.config.guiconfig.nyu.GuiConfigV2; +import kr.syeyoung.dungeonsguide.config.guiconfig.old.GuiConfig; import kr.syeyoung.dungeonsguide.cosmetics.CosmeticsManager; -import kr.syeyoung.dungeonsguide.cosmetics.chatreplacers.*; import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; @@ -34,7 +34,6 @@ import kr.syeyoung.dungeonsguide.events.DungeonLeftEvent; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerOnJoin; import kr.syeyoung.dungeonsguide.features.impl.party.api.ApiFetchur; -import kr.syeyoung.dungeonsguide.party.PartyInviteViewer; import kr.syeyoung.dungeonsguide.party.PartyManager; import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; import kr.syeyoung.dungeonsguide.stomp.*; @@ -43,7 +42,6 @@ import kr.syeyoung.dungeonsguide.utils.MapUtils; import kr.syeyoung.dungeonsguide.wsresource.StaticResourceCache; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; -import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; @@ -399,7 +397,7 @@ public class CommandDungeonsGuide extends CommandBase { StaticResourceCache.INSTANCE.getResource(uid).thenAccept(a -> { sender.addChatMessage(new ChatComponentText(a.getResourceID()+": "+a.getValue()+": "+a.isExists())); }); - } else{ + } else { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui")); sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg help §7-§fShows command help")); @@ -425,7 +423,7 @@ public class CommandDungeonsGuide extends CommandBase { try { if (openConfig && e.phase == TickEvent.Phase.START ) { openConfig = false; - Minecraft.getMinecraft().displayGuiScreen(new GuiConfig()); + Minecraft.getMinecraft().displayGuiScreen(new GuiConfigV2()); } } catch (Throwable t) { t.printStackTrace(); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java deleted file mode 100644 index 61edf38d..00000000 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/ConfigPanelCreator.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 - * - * 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.config.guiconfig; - -import com.google.common.base.Function; -import com.google.common.base.Supplier; -import kr.syeyoung.dungeonsguide.gui.MPanel; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.Map; - -public class ConfigPanelCreator implements Function<String, MPanel> { - public static final ConfigPanelCreator INSTANCE = new ConfigPanelCreator(); - - public static final Map<String, Supplier<MPanel>> map = new HashMap<String, Supplier<MPanel>>(); - - @Nullable - @Override - public MPanel apply(@Nullable String input) { - if (!map.containsKey(input)) return null; - return map.get(input).get(); - } -} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/GuiGuiLocationConfig.java index b68c0b0c..645ba3a9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/GuiGuiLocationConfig.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/GuiGuiLocationConfig.java @@ -1,37 +1,33 @@ /* - * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod - * Copyright (C) 2021 cyoung06 + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 * - * 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 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. + * 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/>. + * 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.config.guiconfig; +package kr.syeyoung.dungeonsguide.config.guiconfig.location; +import kr.syeyoung.dungeonsguide.config.guiconfig.old.PanelDelegate; import kr.syeyoung.dungeonsguide.features.AbstractFeature; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.GuiFeature; import kr.syeyoung.dungeonsguide.gui.MGui; import kr.syeyoung.dungeonsguide.gui.MPanel; -import kr.syeyoung.dungeonsguide.gui.elements.MButton; import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.Vec3; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.awt.*; import java.io.IOException; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/Marker.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/Marker.java index 27ced7ee..7a0b9c58 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/Marker.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/location/Marker.java @@ -16,10 +16,9 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -package kr.syeyoung.dungeonsguide.config.guiconfig; +package kr.syeyoung.dungeonsguide.config.guiconfig.location; import lombok.AllArgsConstructor; -import lombok.Data; import lombok.Getter; import lombok.ToString; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java new file mode 100644 index 00000000..b22175a4 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/GuiConfigV2.java @@ -0,0 +1,46 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * 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.config.guiconfig.nyu; + +import kr.syeyoung.dungeonsguide.config.guiconfig.old.ConfigPanelCreator; +import kr.syeyoung.dungeonsguide.gui.MGui; +import net.minecraft.client.Minecraft; + +import java.awt.*; + +public class GuiConfigV2 extends MGui { + + private RootConfigPanel rootConfigPanel; + + public GuiConfigV2() { + rootConfigPanel = new RootConfigPanel(); + rootConfigPanel.setPageGenerator(ConfigPanelCreator.INSTANCE); + getMainPanel().add(rootConfigPanel); + } + + + @Override + public void initGui() { + super.initGui(); + int dw = Minecraft.getMinecraft().displayWidth; + int dh = Minecraft.getMinecraft().displayHeight; + rootConfigPanel.setBounds(new Rectangle((dw-1000)/2, (dh-800)/2, 1000,800)); + rootConfigPanel.setScale(2.0f); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java new file mode 100644 index 00000000..5d00d15a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MCategoryElement.java @@ -0,0 +1,75 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * 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.config.guiconfig.nyu; + +import kr.syeyoung.dungeonsguide.gui.MPanel; +import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import org.lwjgl.opengl.GL11; + +import java.awt.*; +import java.util.function.Consumer; + +public class MCategoryElement extends MPanel { + private String category; + private Consumer<String> onClick; + private int leftPad = 0; + private int offsetX; + private RootConfigPanel rootConfigPanel; + public MCategoryElement(String category, Consumer<String> onClick, int leftPad, int offsetX, RootConfigPanel rooot) { + this.category = category; + this.onClick = onClick; + this.leftPad = leftPad; + this.offsetX = offsetX; + this.rootConfigPanel = rooot; + } + + @Override + public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { + if (rootConfigPanel.getCurrentPage().equals(category)) { + GL11.glDisable(GL11.GL_SCISSOR_TEST); + Gui.drawRect(leftPad - offsetX, 0, getBounds().width, getBounds().height, RenderUtils.blendAlpha(0x141414, 0.13f)); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + } else if (lastAbsClip.contains(absMousex, absMousey)) { + GL11.glDisable(GL11.GL_SCISSOR_TEST); + Gui.drawRect(leftPad - offsetX, 0, getBounds().width, getBounds().height, RenderUtils.blendAlpha(0x141414, 0.09f)); + GL11.glEnable(GL11.GL_SCISSOR_TEST); + } + + + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + String name = category.substring(category.lastIndexOf(".")+1); + fr.drawString(name, leftPad,2,-1); + + } + + @Override + public Dimension getPreferredSize() { + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + return new Dimension(fr.getStringWidth(category.substring(category.lastIndexOf(".")+1)) + leftPad+10, fr.FONT_HEIGHT+4); + } + + @Override + public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { + if (!lastAbsClip.contains(absMouseX, absMouseY)) { return; } + if (onClick != null) onClick.accept(category); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MNotFound.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MNotFound.java new file mode 100644 index 00000000..0d58be44 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MNotFound.java @@ -0,0 +1,40 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * 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.config.guiconfig.nyu; + +import kr.syeyoung.dungeonsguide.gui.MPanel; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import org.lwjgl.opengl.GL11; + +import java.awt.*; + +public class MNotFound extends MPanel { + @Override + public void resize(int parentWidth, int parentHeight) { + setBounds(new Rectangle(0,0,parentWidth,parentHeight)); + } + + @Override + public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) { + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + fr.drawString("404 Not Found", (getBounds().width - fr.getStringWidth("404 Not Found")) / 2, (getBounds().height - fr.FONT_HEIGHT) / 2, -1); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java new file mode 100644 index 00000000..b81d96a2 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/RootConfigPanel.java @@ -0,0 +1,160 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 |
