diff options
8 files changed, 52 insertions, 26 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java index 8fdd694..3e72057 100644 --- a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java +++ b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigCategoryScrolling.java @@ -604,8 +604,10 @@ public class MooConfigCategoryScrolling extends GuiListExtended { public void checkHover(int mouseX, int mouseY) { if (undoHoverChecker != null && undoHoverChecker.checkHover(mouseX, mouseY)) { GuiHelper.drawHoveringText(Collections.singletonList(I18n.format("fml.configgui.tooltip.undoChanges")), mouseX, mouseY, parent.width, parent.height, 300); + GlStateManager.disableLighting(); } else if (defaultHoverChecker != null && defaultHoverChecker.checkHover(mouseX, mouseY)) { GuiHelper.drawHoveringText(Collections.singletonList(I18n.format("fml.configgui.tooltip.resetToDefault")), mouseX, mouseY, parent.width, parent.height, 300); + GlStateManager.disableLighting(); } } diff --git a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java index 3d676ad..05e03aa 100644 --- a/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java +++ b/src/main/java/de/cowtipper/cowlection/config/gui/MooConfigGui.java @@ -9,6 +9,7 @@ import net.minecraft.client.audio.SoundEventAccessorComposite; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; @@ -18,6 +19,7 @@ import org.lwjgl.input.Keyboard; import java.io.IOException; import java.util.Arrays; +import java.util.Collections; /** * Main config gui containing: @@ -184,10 +186,15 @@ public class MooConfigGui extends GuiScreen { if (currentConfigCategoryGui != null) { currentConfigCategoryGui.drawScreen(mouseX, mouseY, partialTicks); } + fieldSearchQuery.drawTextBox(); if (btnClose.isMouseOver()) { - GuiHelper.drawHoveringText(Arrays.asList(EnumChatFormatting.RED + "Save & close settings", "" + EnumChatFormatting.GRAY + EnumChatFormatting.ITALIC + "Hint:" + EnumChatFormatting.RESET + " alternatively press ESC"), mouseX, mouseY, width, height, 300); + GuiHelper.drawHoveringText(Arrays.asList(EnumChatFormatting.RED + "Save & close settings", "" + + EnumChatFormatting.GRAY + EnumChatFormatting.ITALIC + "Hint:" + EnumChatFormatting.RESET + " alternatively press ESC"), mouseX, mouseY, width, height, 300); + } else if (mouseX >= fieldSearchQuery.xPosition && mouseX <= fieldSearchQuery.xPosition + fieldSearchQuery.width + && mouseY >= fieldSearchQuery.yPosition && mouseY <= fieldSearchQuery.yPosition + fieldSearchQuery.height) { + GuiHelper.drawHoveringText(Collections.singletonList("" + EnumChatFormatting.GREEN + EnumChatFormatting.ITALIC + "Hint:" + EnumChatFormatting.RESET + + " Search for \"" + EnumChatFormatting.GOLD + "new" + EnumChatFormatting.RESET + "\" to show new or changed config entries"), mouseX, mouseY, width, height, 300); } - fieldSearchQuery.drawTextBox(); } @Override @@ -247,6 +254,7 @@ public class MooConfigGui extends GuiScreen { @Override public void renderToolTip(ItemStack stack, int x, int y) { super.renderToolTip(stack, x, y); + GlStateManager.disableLighting(); } @Override diff --git a/src/main/java/de/cowtipper/cowlection/listener/ChatListener.java b/src/main/java/de/cowtipper/cowlection/listener/ChatListener.java index 3b5a168..6221c17 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/ChatListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/ChatListener.java @@ -169,7 +169,9 @@ public class ChatListener { Matcher dungeonPartyFinderJoinedMatcher = DUNGEON_FINDER_JOINED_PATTERN.matcher(message); if (privateMessageMatcher.find()) { messageSender = privateMessageMatcher.group(1); - this.lastPMSender = messageSender; + if (!"stash".equals(messageSender)) { + this.lastPMSender = messageSender; + } } else if (chatMessageMatcher.find()) { messageSender = chatMessageMatcher.group(1); } else if (partyOrGameInviteMatcher.find()) { diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java index b70dc25..c875ef8 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java @@ -522,6 +522,7 @@ public class DungeonsListener { btnTooltip.add("Open Cowlection's Party Notes Rule Editor"); btnTooltip.add(EnumChatFormatting.GRAY + "Want to remove this button? " + EnumChatFormatting.YELLOW + "/moo config editor"); GuiHelper.drawHoveringText(btnTooltip, e.mouseX, e.mouseY, mc.displayWidth, mc.displayHeight, 300); + GlStateManager.disableLighting(); } } diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsPartyListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsPartyListener.java index dd8bec0..6ab8f7e 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsPartyListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsPartyListener.java @@ -276,7 +276,7 @@ public class DungeonsPartyListener { averageSecretsPerCompletion = Utils.formatDecimal(foundSecrets / (1d * totalDungeonCompletions)); } - playerTooltip.append("\n").append(EnumChatFormatting.GRAY).append("Found secrets: ").append(EnumChatFormatting.GOLD).append(foundSecrets); + playerTooltip.append("\n").append(EnumChatFormatting.GRAY).append("Found secrets: ").append(EnumChatFormatting.GOLD).append(Utils.formatNumber(foundSecrets)); if (averageSecretsPerCompletion != null) { playerTooltip.append(EnumChatFormatting.GRAY).append(" (").append(EnumChatFormatting.YELLOW).append(averageSecretsPerCompletion).append(EnumChatFormatting.GRAY).append("/completion)"); } diff --git a/src/main/java/de/cowtipper/cowlection/numerouscommands/NumerousCommandsGui.java b/src/main/java/de/cowtipper/cowlection/numerouscommands/NumerousCommandsGui.java index cc06055..c1ecc29 100644 --- a/src/main/java/de/cowtipper/cowlection/numerouscommands/NumerousCommandsGui.java +++ b/src/main/java/de/cowtipper/cowlection/numerouscommands/NumerousCommandsGui.java @@ -51,24 +51,28 @@ public class NumerousCommandsGui extends GuiScreen { } lines.add("" + EnumChatFormatting.UNDERLINE + EnumChatFormatting.ITALIC + "Commands" + EnumChatFormatting.RESET + EnumChatFormatting.GRAY + " (" + modInfo.getCommandsCount() + ")"); Collection<CommandInfo> commands = modInfo.getCommands(); - for (CommandInfo cmd : commands) { - String cmdNameAndAliases = EnumChatFormatting.YELLOW + " ‣ /" + cmd.getName(); - if (cmd.getAliases().size() > 0) { - cmdNameAndAliases += EnumChatFormatting.DARK_GRAY + " (" + (cmd.getAliases().size() == 1 ? "alias" : "aliases") + ": " + EnumChatFormatting.GRAY + Joiner.on(", ").join(cmd.getAliases()) + EnumChatFormatting.DARK_GRAY + ")"; - } - lines.add(cmdNameAndAliases); - String cmdUsage = cmd.getUsage(); - if (cmdUsage != null) { - if (cmdUsage.contains("\n")) { - addKeyValue("Usage", "", false); - for (String usageLine : cmdUsage.split("\n")) { - lines.add(" " + usageLine); + if (commands.size() == 0) { + lines.add(EnumChatFormatting.YELLOW + " ‣ This mod either has no client-side commands, or doesn't use Forge's command registry"); + } else { + for (CommandInfo cmd : commands) { + String cmdNameAndAliases = EnumChatFormatting.YELLOW + " ‣ /" + cmd.getName(); + if (cmd.getAliases().size() > 0) { + cmdNameAndAliases += EnumChatFormatting.DARK_GRAY + " (" + (cmd.getAliases().size() == 1 ? "alias" : "aliases") + ": " + EnumChatFormatting.GRAY + Joiner.on(", ").join(cmd.getAliases()) + EnumChatFormatting.DARK_GRAY + ")"; + } + lines.add(cmdNameAndAliases); + String cmdUsage = cmd.getUsage(); + if (cmdUsage != null) { + if (cmdUsage.contains("\n")) { + addKeyValue("Usage", "", false); + for (String usageLine : cmdUsage.split("\n")) { + lines.add(" " + usageLine); + } + } else { + addKeyValue("Usage", cmdUsage, false); } - } else { - addKeyValue("Usage", cmdUsage, false); + } else if (cmd.isListCommandsCommand()) { + addKeyValue("Usage", EnumChatFormatting.GREEN + "You have just used this command to open this GUI", false); } - } else if (cmd.isListCommandsCommand()) { - addKeyValue("Usage", EnumChatFormatting.GREEN + "You have just used this command to open this GUI", false); } } } diff --git a/src/main/java/de/cowtipper/cowlection/partyfinder/RuleEditorGui.java b/src/main/java/de/cowtipper/cowlection/partyfinder/RuleEditorGui.java index c1a9dc4..f9d27c5 100644 --- a/src/main/java/de/cowtipper/cowlection/partyfinder/RuleEditorGui.java +++ b/src/main/java/de/cowtipper/cowlection/partyfinder/RuleEditorGui.java @@ -4,6 +4,7 @@ import com.mojang.authlib.GameProfile; import com.mojang.authlib.properties.Property; import de.cowtipper.cowlection.Cowlection; import de.cowtipper.cowlection.config.MooConfig; +import de.cowtipper.cowlection.config.gui.MooConfigGui; import de.cowtipper.cowlection.data.DataHelper; import de.cowtipper.cowlection.util.Utils; import net.minecraft.client.Minecraft; @@ -38,10 +39,11 @@ import java.util.regex.Pattern; public class RuleEditorGui extends GuiScreen { private final Rules rules; private RulesListGui rulesList; + private GuiButton btnBackToConfig; private GuiUnicodeGlyphButton btnUndoAll; private GuiUnicodeGlyphButton btnDefaultAll; - private GuiButtonExt btnHelp; - private GuiButtonExt btnClose; + private GuiButton btnHelp; + private GuiButton btnClose; private static float lastScrollDistance; private final boolean expertMode; private final static List<String> colorCodesExplanation; @@ -66,6 +68,8 @@ public class RuleEditorGui extends GuiScreen { Keyboard.enableRepeatEvents(true); this.buttonList.clear(); + // back to config button + this.buttonList.add(this.btnBackToConfig = new GuiButtonExt(10, this.width - 149, 4, 50, 20, EnumChatFormatting.GREEN + "config ↗")); // undo all button this.buttonList.add(this.btnUndoAll = new GuiUnicodeGlyphButton(2002, this.width - 94, 4, 20, 20, "", GuiUtils.UNDO_CHAR, 2)); // reset all button @@ -73,7 +77,7 @@ public class RuleEditorGui extends GuiScreen { // help button this.buttonList.add(this.btnHelp = new GuiButtonExt(1, this.width - 47, 4, 20, 20, "?")); // close button - this.buttonList.add(this.btnClose = new GuiButtonExt(1, this.width - 25, 4, 20, 20, EnumChatFormatting.RED + "X")); + this.buttonList.add(this.btnClose = new GuiButtonExt(2, this.width - 25, 4, 20, 20, EnumChatFormatting.RED + "X")); updateLastScrollDistance(); // scrollable commands list @@ -90,7 +94,9 @@ public class RuleEditorGui extends GuiScreen { this.drawString(this.fontRendererObj, "Dungeon Party Finder: Rules editor", 30, 6, 0xFFCC00); GlStateManager.popMatrix(); this.rulesList.drawScreen(mouseX, mouseY, partialTicks); - if (btnUndoAll.isMouseOver()) { + if (btnBackToConfig.isMouseOver()) { + drawHoveringText(Arrays.asList("Go to Party Finder config options", EnumChatFormatting.YELLOW + " ‣ /moo config party finder"), mouseX, mouseY); + } else if (btnUndoAll.isMouseOver()) { drawHoveringText(Collections.singletonList("Undo all changes"), mouseX, mouseY); } else if (btnDefaultAll.isMouseOver()) { drawHoveringText(Collections.singletonList("Reset rules to default"), mouseX, mouseY); @@ -123,7 +129,10 @@ public class RuleEditorGui extends GuiScreen { @Override protected void actionPerformed(GuiButton button) { - if (button == btnUndoAll) { + if (button == btnBackToConfig) { + rules.saveToFile(); + mc.displayGuiScreen(new MooConfigGui("party finder")); + } else if (button == btnUndoAll) { GuiYesNo guiUndoAll = new GuiYesNo(this, EnumChatFormatting.BOLD + "Discard " + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "all " + EnumChatFormatting.RESET + EnumChatFormatting.BOLD + "changes?", EnumChatFormatting.RED + "This action cannot be reverted!", diff --git a/src/main/resources/assets/cowlection/lang/en_US.lang b/src/main/resources/assets/cowlection/lang/en_US.lang index 2c6480b..04ca274 100644 --- a/src/main/resources/assets/cowlection/lang/en_US.lang +++ b/src/main/resources/assets/cowlection/lang/en_US.lang @@ -144,7 +144,7 @@ cowlection.config.gotoPartyFinderRulesEditor=Open Party Finder Notes Rules Edito cowlection.config.gotoPartyFinderRulesEditor.tooltip=Add and edit additional rules to mark Dungeon parties based on their Party notes cowlection.config.dungPartyFinderRuleEditorSimplified=Use simplified Party Finder Notes Rules Editor cowlection.config.dungPartyFinderRuleEditorSimplified.tooltip=Use the simplified variant? Only deactivate this if you know what Regular Expressions are and how to use them! -cowlection.config.dungPartyFinderRuleEditorShowOpenButton=Show '§8Rule editor ↗§r' button in Party Finder? +cowlection.config.dungPartyFinderRuleEditorShowOpenButton=Show '§7Rule editor ↗§r' button in Party Finder? cowlection.config.dungPartyFinderRuleEditorShowOpenButton.tooltip=If enabled, displays a button to open the Rules editor from the Dungeon Party Finder cowlection.config.dungSendWrongFloorWarning=Warn if queued & entered floor are different cowlection.config.dungSendWrongFloorWarning.tooltip=Send a warning when entering a dungeons floor which is different from the originally queued floor? |