aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-08-11 15:43:43 +0900
committersyeyoung <cyong06@naver.com>2021-08-11 15:43:43 +0900
commit21ec99c3e45e4557e228d026c148207b1227c14b (patch)
tree6b9972492da511c351cc07a9d215dd3b0ab77def /src/main/java/kr/syeyoung/dungeonsguide/features
parenta48cb5c96e16fae589cb7d4f09146a17b3787924 (diff)
downloadSkyblock-Dungeons-Guide-21ec99c3e45e4557e228d026c148207b1227c14b.tar.gz
Skyblock-Dungeons-Guide-21ec99c3e45e4557e228d026c148207b1227c14b.tar.bz2
Skyblock-Dungeons-Guide-21ec99c3e45e4557e228d026c148207b1227c14b.zip
- X Started playing skyblock alarm
- Better Scrollbar - Modal Message - Inviting Friends in discord
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java128
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java109
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java3
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java5
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java20
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java58
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java8
9 files changed, 314 insertions, 19 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java
index b95da68a..de025698 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/inviteViewer/PartyJoinRequest.java
@@ -35,7 +35,6 @@ public class PartyJoinRequest {
username = GameSDK.readString(discordUser.username);
discriminator = GameSDK.readString(discordUser.discriminator);
avatar = GameSDK.readString(discordUser.avatar);
- System.out.println(username+"/"+discriminator+"/"+avatar);
}
private String username, discriminator, avatar;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java
new file mode 100644
index 00000000..253d0256
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInvite.java
@@ -0,0 +1,128 @@
+/*
+ * 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.features.impl.discord.invteTooltip;
+
+import com.sun.jna.Pointer;
+import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordActivityActionType;
+import kr.syeyoung.dungeonsguide.gamesdk.jna.enumuration.EDiscordRelationshipType;
+import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordActivityManager;
+import kr.syeyoung.dungeonsguide.gamesdk.jna.interfacestruct.IDiscordCore;
+import kr.syeyoung.dungeonsguide.gamesdk.jna.typedef.DiscordSnowflake;
+import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.gui.elements.*;
+import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation;
+import kr.syeyoung.dungeonsguide.rpc.RichPresenceManager;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+
+import java.awt.*;
+import java.util.HashSet;
+import java.util.Set;
+
+public class MTooltipInvite extends MModal {
+ private MScrollablePanel mScrollablePanel;
+ private MList list;
+ private MTextField search;
+ private MButton close;
+ private Set<Long> invited = new HashSet<>();
+ public MTooltipInvite() {
+ setTitle("Invite Discord Friend");
+ mScrollablePanel = new MScrollablePanel(1);
+ mScrollablePanel.setHideScrollBarWhenNotNecessary(true);
+ add(mScrollablePanel);
+
+ list = new MList() {
+ @Override
+ public void resize(int parentWidth, int parentHeight) {
+ setSize(new Dimension(parentWidth, 9999));
+ realignChildren();
+ }
+ };
+ list.setGap(1);
+ list.setDrawLine(true);
+ list.setGapLineColor(RenderUtils.blendAlpha(0x141414, 0.13f));
+ mScrollablePanel.add(list);
+ mScrollablePanel.getScrollBarY().setWidth(5);
+
+ search = new MTextField() {
+ @Override
+ public void edit(String str) {
+ super.edit(str); resetListContent();
+ }
+ };
+ search.setPlaceHolder("Search...");
+ add(search);
+
+ close = new MButton();
+ close.setText("X");
+ close.setBackground( RenderUtils.blendAlpha(0x141414, 0.20f));
+ close.setHover( RenderUtils.blendAlpha(0x141414, 0.25f));
+ close.setClicked( RenderUtils.blendAlpha(0x141414, 0.24f));
+ close.setOnActionPerformed(this::close);
+ addSuper(close);
+ resetListContent();
+ }
+
+ @Override
+ public void onBoundsUpdate() {
+ super.onBoundsUpdate();
+ Dimension effDim = getModalContent().getSize();
+ search.setBounds(new Rectangle(5,2,effDim.width-10, 15));
+ mScrollablePanel.setBounds(new Rectangle(10,18,effDim.width-20, effDim.height-25));
+ close.setBounds(new Rectangle(getModalContent().getBounds().x + effDim.width-15,getModalContent().getBounds().y - 16,15,15));
+ }
+
+ @Override
+ public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) {
+ GlStateManager.pushMatrix();
+ super.render(absMousex, absMousey, relMousex0, relMousey0, partialTicks, scissor);
+ GlStateManager.popMatrix();
+
+ Dimension modalSize = getModalSize();
+ Dimension effDim = getEffectiveDimension();
+ int x = (effDim.width-modalSize.width)/2;
+ int y = (effDim.height - modalSize.height)/2;
+ GlStateManager.translate(x,y, 0);
+ }
+
+ private void resetListContent() {
+ for (MPanel childComponent : list.getChildComponents()) {
+ list.remove(childComponent);
+ }
+
+ String searchTxt = search.getText().trim().toLowerCase();
+ for (JDiscordRelation value : RichPresenceManager.INSTANCE.getRelationMap().values()) {
+// if (value.getDiscordActivity().getApplicationId() != 816298079732498473L) continue;
+ if (value.getDiscordRelationshipType() == EDiscordRelationshipType.DiscordRelationshipType_Blocked) continue;
+ if (!searchTxt.isEmpty() && !(value.getDiscordUser().getUsername().toLowerCase().contains(searchTxt))) continue;
+ list.add(new MTooltipInviteElement(value, invited.contains(value.getDiscordUser().getId()), this::invite));
+ }
+ setBounds(getBounds());
+ }
+
+ public void invite(long id) {
+ invited.add(id);
+ IDiscordCore iDiscordCore = RichPresenceManager.INSTANCE.getIDiscordCore();
+ IDiscordActivityManager iDiscordActivityManager = iDiscordCore.GetActivityManager.getActivityManager(iDiscordCore);
+ iDiscordActivityManager.SendInvite.sendInvite(iDiscordActivityManager, new DiscordSnowflake(id), EDiscordActivityActionType.DiscordActivityActionType_Join, "Dungeons Guide RPC Invite TESt", Pointer.NULL, (callbackData, result) -> {
+ System.out.println("Discord returned "+result+" For inviting "+id);
+ });
+ }
+}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java
new file mode 100644
index 00000000..4445f5a6
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/invteTooltip/MTooltipInviteElement.java
@@ -0,0 +1,109 @@
+/*
+ * 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.features.impl.discord.invteTooltip;
+
+import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
+import kr.syeyoung.dungeonsguide.features.impl.discord.inviteViewer.ImageTexture;
+import kr.syeyoung.dungeonsguide.gui.MPanel;
+import kr.syeyoung.dungeonsguide.gui.elements.MButton;
+import kr.syeyoung.dungeonsguide.rpc.JDiscordRelation;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+
+import java.awt.*;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.function.Consumer;
+
+public class MTooltipInviteElement extends MPanel {
+ private JDiscordRelation relation;
+ private MButton invite;
+ public MTooltipInviteElement(JDiscordRelation jDiscordRelation, boolean invited, Consumer<Long> inviteCallback) {
+ this.relation = jDiscordRelation;
+ this.invite = new MButton();
+ if (!invited) {
+ invite.setText("Invite");
+ invite.setRoundness(2);
+ invite.setBorder(0xFF02EE67);
+ invite.setHover(RenderUtils.blendAlpha(0x141414, 0.2f));
+ invite.setBackground(RenderUtils.blendAlpha(0x141414, 0.17f));
+ invite.setForeground(new Color(0xFF02EE67));
+
+ invite.setOnActionPerformed(() -> {
+ if (invite.isEnabled())
+ inviteCallback.accept(jDiscordRelation.getDiscordUser().getId());
+
+ invite.setText("Sent");
+ invite.setRoundness(2);
+ invite.setHover(0); invite.setBorder(0);
+ invite.setBackground(0); invite.setDisabled(0); invite.setEnabled(false);
+ invite.setForeground(new Color(0xFF02EE67));
+ });
+ } else {
+ invite.setText("Sent");
+ invite.setRoundness(2);
+ invite.setHover(0);
+ invite.setBackground(0); invite.setDisabled(0); invite.setEnabled(false);
+ invite.setForeground(new Color(0xFF02EE67));
+ }
+
+ add(invite);
+ }
+
+ @Override
+ public void render(int absMousex, int absMousey, int relMousex0, int relMousey0, float partialTicks, Rectangle scissor) {
+ if (lastAbsClip.contains(absMousex, absMousey) && getTooltipsOpen() == 0) {
+ RenderUtils.drawRoundedRectangle(0,0,bounds.width, bounds.height, 3, Math.PI/8, RenderUtils.blendAlpha(0x141414, 0.17f));
+ GlStateManager.enableTexture2D();
+ }
+
+ FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
+ if (!relation.getDiscordUser().getAvatar().isEmpty()){
+ String avatar = "https://cdn.discordapp.com/avatars/"+Long.toUnsignedString(relation.getDiscordUser().getId())+"/"+relation.getDiscordUser().getAvatar()+"."+(relation.getDiscordUser().getAvatar().startsWith("a_") ? "gif":"png");
+ Future<ImageTexture> loadedImageFuture = FeatureRegistry.DISCORD_ASKTOJOIN.loadImage(avatar);
+ ImageTexture loadedImage = null;
+ if (loadedImageFuture.isDone()) {
+ try {
+ loadedImage = loadedImageFuture.get();
+ } catch (InterruptedException | ExecutionException e) {
+ e.printStackTrace();
+ }
+ }
+ if (loadedImage != null) {
+ loadedImage.drawFrameAndIncrement( 3,3,bounds.height-6,bounds.height-6);
+ } else {
+ Gui.drawRect(3, 3, bounds.height - 6, bounds.height-6, 0xFF4E4E4E);
+ }
+ }
+ fr.drawString(relation.getDiscordUser().getUsername()+"#"+relation.getDiscordUser().getDiscriminator(), bounds.height,(bounds.height-fr.FONT_HEIGHT)/2, -1);
+ }
+
+ @Override
+ public Dimension getPreferredSize() {
+ return new Dimension(100, 20);
+ }
+
+ @Override
+ public void onBoundsUpdate() {
+ invite.setBounds(new Rectangle(bounds.width-53,2,50,bounds.height-4));
+ }
+}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java
index d003b165..4f071e51 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/discord/onlinealarm/PlayingDGAlarm.java
@@ -95,7 +95,6 @@ public class PlayingDGAlarm extends SimpleFeature implements DiscordUserUpdateLi
public void renderRequest(PlayerOnline online, int x, int y, int width, int height) {
GlStateManager.pushMatrix();
- online.setEnd(System.currentTimeMillis()+600000);
GlStateManager.translate(x,y,0);
Gui.drawRect(0, 0,width,height, 0xFF23272a);
@@ -154,7 +153,7 @@ public class PlayingDGAlarm extends SimpleFeature implements DiscordUserUpdateLi
public void onDiscordUserUpdate(DiscordUserUpdateEvent event) {
JDiscordRelation prev = event.getPrev(), current = event.getCurrent();
if (!isDisplayable(prev) && isDisplayable(current)) {
- notif.add(new PlayerOnline(current, System.currentTimeMillis()+600000));
+ notif.add(new PlayerOnline(current, System.currentTimeMillis()+3000));
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java
index 076fc0ce..f00a34d8 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeaturePenguins.java
@@ -67,7 +67,6 @@ public class FeaturePenguins extends SimpleFeature implements PlayerRenderListen
}
@Override
public void onTextureStitch(TextureStitchEvent event) {
- System.out.println("STICH!");
if (event instanceof TextureStitchEvent.Pre) {
objModel = null;
ResourceLocation modelResourceLocation = new ResourceLocation("dungeonsguide:models/penguin.obj");
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java
index 7a06911f..5e14fb13 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java
@@ -36,7 +36,10 @@ public class FeatureCustomPartyFinder extends SimpleFeature implements GuiOpenLi
@Getter
@Setter
- private String whitelist = "", blacklist = "", highlight ="";
+ private String whitelist = "", blacklist = "", highlight ="", blacklistClass = "";
+ @Getter
+ @Setter
+ private int minimumCata;
GuiCustomPartyFinder guiCustomPartyFinder;
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java
index e699b99c..b73a2024 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinder.java
@@ -21,8 +21,10 @@ package kr.syeyoung.dungeonsguide.features.impl.party.customgui;
import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfigV2;
import kr.syeyoung.dungeonsguide.events.WindowUpdateEvent;
import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
+import kr.syeyoung.dungeonsguide.features.impl.discord.invteTooltip.MTooltipInvite;
import kr.syeyoung.dungeonsguide.gui.MPanel;
import kr.syeyoung.dungeonsguide.gui.elements.*;
+import kr.syeyoung.dungeonsguide.party.PartyManager;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import lombok.Getter;
import net.minecraft.client.Minecraft;
@@ -58,7 +60,7 @@ public class PanelPartyFinder extends MPanel {
private MButton previous;
private MButton next;
- private MButton settings;
+ private MButton settings, discordInvite;
private int page = 1;
private Map<Integer, PanelPartyListElement> panelPartyListElementMap = new HashMap<>();
@@ -111,6 +113,21 @@ public class PanelPartyFinder extends MPanel {
guiConfigV2.getRootConfigPanel().setCurrentPageAndPushHistory("ROOT."+ FeatureRegistry.PARTYKICKER_CUSTOM.getCategory());
Minecraft.getMinecraft().displayGuiScreen(guiConfigV2);
});
+ discordInvite = new MButton();
+ discordInvite.setText("Invite Discord Friends");
+ discordInvite.setOnActionPerformed(() -> {
+ if (PartyManager.INSTANCE.isAllowAskToJoin()) {
+ MTooltipInvite mTooltipInvite = new MTooltipInvite();
+ mTooltipInvite.setScale( new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ mTooltipInvite.open(this);
+ } else {
+ MModalMessage mTooltipInvite = new MModalMessage("Error", "You need to have Ask To Join Enabled to use this feature. Run /dg atj to enable ask to join", () -> {});
+ mTooltipInvite.setScale( new ScaledResolution(Minecraft.getMinecraft()).getScaleFactor());
+ mTooltipInvite.open(this);
+ }
+ });
+ discordInvite.setBackground(RenderUtils.blendAlpha(0xFF141414, 0.05f));
+ add(discordInvite);
add(settings);
navigation = new MPanelScaledGUI() {
@Override
@@ -150,6 +167,7 @@ public class PanelPartyFinder extends MPanel {
scrollablePanel.setBounds(new Rectangle(0, navigation.getBounds().y+navigation.getBounds().height, 3*bounds.width/5, bounds.height - (navigation.getBounds().y+navigation.getBounds().height)));
goBack.setBounds(new Rectangle(0,0, fr.FONT_HEIGHT*2+20, fr.FONT_HEIGHT*2+20));
settings.setBounds(new Rectangle(bounds.width - 75, 0, 75, fr.FONT_HEIGHT*2+20));
+ discordInvite.setBounds(new Rectangle(bounds.width-275, 0, 200, fr.FONT_HEIGHT*2+20));
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java
index 509ee5c5..0d132648 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyFinderSettings.java
@@ -21,6 +21,7 @@ package kr.syeyoung.dungeonsguide.features.impl.party.customgui;
import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.gui.MPanel;
import kr.syeyoung.dungeonsguide.gui.elements.*;
+import kr.syeyoung.dungeonsguide.utils.TextUtils;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.Minecraft;
@@ -36,14 +37,17 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumChatFormatting;
import java.awt.*;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class PanelPartyFinderSettings extends MPanelScaledGUI {
private PanelPartyFinder panelPartyFinder;
private MButton refresh = new MButton(), createNew = new MButton(), settings = new MButton();
- private MPassiveLabelAndElement filterCantjoin, filterWhitelistNote, filterBlacklistNote, plaeHighlightNote; private MToggleButton filterCantjoinButton;
- private MTextField filterWhitelist, filterBlacklist, highlightNote;
+ private MPassiveLabelAndElement filterCantjoin, filterWhitelistNote, filterBlacklistNote, plaeHighlightNote, cataLv,blacklistClass; private MToggleButton filterCantjoinButton;
+ private MTextField filterWhitelist, filterBlacklist, highlightNote, blacklistClassTxt;
+ private MIntegerSelectionButton integerSelection;
@Getter @Setter
boolean delistable = false;
@@ -98,21 +102,42 @@ public class PanelPartyFinderSettings extends MPanelScaledGUI {
FeatureRegistry.PARTYKICKER_CUSTOM.setHighlight(str);
}
};
+ blacklistClassTxt = new MTextField() {
+ @Override
+ public void edit(String str) {
+ super.edit(str);
+ FeatureRegistry.PARTYKICKER_CUSTOM.setBlacklistClass(str);
+ panelPartyFinder.onChestUpdate(null);
+ }
+ };
filterWhitelist.setText(FeatureRegistry.PARTYKICKER_CUSTOM.getWhitelist());
filterBlacklist.setText(FeatureRegistry.PARTYKICKER_CUSTOM.getBlacklist());
highlightNote.setText(FeatureRegistry.PARTYKICKER_CUSTOM.getHighlight());
+ blacklistClassTxt.setText(FeatureRegistry.PARTYKICKER_CUSTOM.getBlacklistClass());
filterWhitelistNote = new MPassiveLabelAndElement("Whitelist Note", filterWhitelist);
filterBlacklistNote = new MPassiveLabelAndElement("Blacklist Note", filterBlacklist);
plaeHighlightNote = new MPassiveLabelAndElement("Highlight Note", highlightNote);
+ blacklistClass = new MPassiveLabelAndElement("Blacklist Class", blacklistClassTxt);
filterWhitelistNote.setDivideRatio(0.5);
filterBlacklistNote.setDivideRatio(0.5);
plaeHighlightNote.setDivideRatio(0.5);
+ blacklistClass.setDivideRatio(0.5);
add(filterWhitelistNote);
add(filterBlacklistNote);
add(plaeHighlightNote);
+ add(blacklistClass);
+ }
+ {
+ integerSelection = new MIntegerSelectionButton(FeatureRegistry.PARTYKICKER_CUSTOM.getMinimumCata());
+ integerSelection.setOnUpdate(() -> {
+ FeatureRegistry.PARTYKICKER_CUSTOM.setMinimumCata(integerSelection.getData());
+ panelPartyFinder.onChestUpdate(null);
+ });
+ cataLv = new MPassiveLabelAndElement("Minimum Cata Lv", integerSelection);
+ cataLv.setDivideRatio(0.5); add(cataLv);
}
}
@@ -197,18 +222,25 @@ public class PanelPartyFinderSettings extends MPanelScaledGUI {
@Override
public void onBoundsUpdate() {
Dimension bounds = getEffectiveDimension();
- refresh.setBounds(new Rectangle(5,5,(bounds.width-10)/2,20));
- createNew.setBounds(new Rectangle(bounds.width/2,5,(bounds.width-10)/2,20));
- filterCantjoin.setBounds(new Rectangle(5,30,bounds.width-10,20));
- filterWhitelistNote.setBounds(new Rectangle(5,55,bounds.width-10,20));
- filterBlacklistNote.setBounds(new Rectangle(5,80,bounds.width-10,20));
- plaeHighlightNote.setBounds(new Rectangle(5,105,bounds.width-10,20));
- settings.setBounds(new Rectangle(5,130,bounds.width-10,20));
+ refresh.setBounds(new Rectangle(5,5,(bounds.width-10)/2,15));
+ createNew.setBounds(new Rectangle(bounds.width/2,5,(bounds.width-10)/2,15));
+ filterCantjoin.setBounds(new Rectangle(5,22,bounds.width-10,15));
+ filterWhitelistNote.setBounds(new Rectangle(5,39,bounds.width-10,15));
+ filterBlacklistNote.setBounds(new Rectangle(5,56,bounds.width-10,15));
+ plaeHighlightNote.setBounds(new Rectangle(5,73,bounds.width-10,15));
+ cataLv.setBounds(new Rectangle(5,90,bounds.width-10,15));
+ blacklistClass.setBounds(new Rectangle(5,107,bounds.width-10,15));
+ settings.setBounds(new Rectangle(5,124,bounds.width-10,15));
}
public boolean filter(ItemStack itemStack) {
NBTTagCompound stackTagCompound = itemStack.getTagCompound();
String note = "";
+ int dLV = 0;
+ Set<String> invalidClasses = new HashSet<>();
+ for (String s : blacklistClassTxt.getText().split(",")) {
+ invalidClasses.add(s.toLowerCase());
+ }
if (stackTagCompound.hasKey("display", 10)) {
NBTTagCompound nbttagcompound = stackTagCompound.getCompoundTag("display");
@@ -221,9 +253,17 @@ public class PanelPartyFinderSettings extends MPanelScaledGUI {
if (str.startsWith("§7§7Note:")) {
note = str.substring(12);
}
+ if (str.startsWith("§7Dungeon Level Required: §b")) {
+ dLV = Integer.parseInt(str.substring(28));
+ }
+ if (str.startsWith(" ") && str.contains(":")) {
+ String clazz = TextUtils.stripColor(str).trim().split(" ")[1];
+ if (invalidClasses.contains(clazz.toLowerCase())) return false;
+ }
}
}
}
+ if (integerSelection.getData() >dLV) return false;
if (!filterBlacklist.getText().isEmpty() && note.toLowerCase().contains(filterBlacklist.getText().toLowerCase())) return false;
if (!filterWhitelist.getText().isEmpty() && !note.toLowerCase().contains(filterWhitelist.getText().toLowerCase())) return false;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java
index f347c5d0..ba38c15e 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/PanelPartyListElement.java
@@ -106,7 +106,7 @@ public class PanelPartyListElement extends MPanel {
if (cantjoin) {}
else if (clicked) {
color = RenderUtils.blendAlpha(0x141414, 0.10f);
- } else if (lastAbsClip.contains(absMousex, absMousey)) {
+ } else if (lastAbsClip.contains(absMousex, absMousey) && (getTooltipsOpen() == 0 || (mTooltip != null && mTooltip.isOpen()))) {
color = RenderUtils.blendAlpha(0x141414, 0.12f);
}
if (cantjoin) {}
@@ -150,7 +150,7 @@ public class PanelPartyListElement extends MPanel {
fr.drawString(sideNote, 0,0,-1);
GlStateManager.popMatrix();
- if (lastAbsClip.contains(absMousex, absMousey) && (mTooltip == null || !mTooltip.isOpen())) {
+ if (lastAbsClip.contains(absMousex, absMousey) && (mTooltip == null || !mTooltip.isOpen()) && getTooltipsOpen() == 0) {
if (mTooltip != null) mTooltip.close();
List<String> list = itemStack.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips);
for (int i = 0; i < list.size(); ++i) {
@@ -183,7 +183,7 @@ public class PanelPartyListElement extends MPanel {
boolean clicked = false;
@Override
public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) {
- if (lastAbsClip.contains(absMouseX, absMouseY)) {
+ if (lastAbsClip.contains(absMouseX, absMouseY)&& (getTooltipsOpen() == 0 || (mTooltip != null && mTooltip.isOpen()))) {
clicked = true;
GuiChest chest = panelPartyFinder.getGuiCustomPartyFinder().getGuiChest();
@@ -198,7 +198,7 @@ public class PanelPartyListElement extends MPanel {
@Override
public void mouseMoved(int absMouseX, int absMouseY, int relMouseX0, int relMouseY0) {
- if (lastAbsClip.contains(absMouseX, absMouseY)) {
+ if (lastAbsClip.contains(absMouseX, absMouseY) && (getTooltipsOpen() == 0 || (mTooltip != null && mTooltip.isOpen()))) {
setCursor(EnumCursor.POINTING_HAND);
}
}