diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | FEATURES.md | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Chat.java | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java | 20 | ||||
-rw-r--r-- | src/main/resources/mixins.skyhanni.json | 3 |
5 files changed, 31 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 97a7bcd97..153080c87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ + Made the config button in the forge mod list work. + Blaze slayer pillar warning text is now much bigger. + Hides the new 'you earn x event exp' message. ++ Added Peek Chat feature. ### Fixes + Fixed a bug that caused the right blaze slayer dagger highlight to show wrong values. diff --git a/FEATURES.md b/FEATURES.md index d4d83c95c..f03cb949e 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -16,6 +16,7 @@ - Dungeon Boss Message hider (includes The Watcher as well) - Option to hide the death messages of other players, except for players who are close to the player, inside the dungeon or during a Kuudra fight. - Scan messages sent by players in all-chat for blacklisted words and greys out the message. +- Chat peeking (holding key to display chat without opening the chat gui) ## Dungeon - Clicked Blocks (Showing the block behind walls AFTER clicked on a chest, wither essence or a lever) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java index d00813c2b..e12d96f57 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java @@ -2,10 +2,16 @@ package at.hannibal2.skyhanni.config.features; import at.hannibal2.skyhanni.config.core.config.annotations.*; import com.google.gson.annotations.Expose; +import org.lwjgl.input.Keyboard; public class Chat { @Expose + @ConfigOption(name = "Peek Chat", desc = "Hold this key to keep the chat open") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_Z) + public int peekChat = Keyboard.KEY_Z; + + @Expose @ConfigOption(name = "Chat Filter Types", desc = "") @ConfigEditorAccordion(id = 0) public boolean filterTypes = false; diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java new file mode 100644 index 000000000..f21b4c948 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/gui/MixinGuiNewChat.java @@ -0,0 +1,20 @@ +package at.hannibal2.skyhanni.mixins.transformers.gui; + +import at.hannibal2.skyhanni.SkyHanniMod; +import net.minecraft.client.gui.GuiNewChat; +import org.lwjgl.input.Keyboard; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(GuiNewChat.class) +public class MixinGuiNewChat { + + @Inject(method = "getChatOpen", at = @At("HEAD"), cancellable = true) + public void onIsOpen(CallbackInfoReturnable<Boolean> cir) { + if (SkyHanniMod.feature.chat.peekChat != Keyboard.KEY_NONE && Keyboard.isKeyDown(SkyHanniMod.feature.chat.peekChat)) + cir.setReturnValue(true); + } + +} diff --git a/src/main/resources/mixins.skyhanni.json b/src/main/resources/mixins.skyhanni.json index 0058e4053..dc5d80243 100644 --- a/src/main/resources/mixins.skyhanni.json +++ b/src/main/resources/mixins.skyhanni.json @@ -15,5 +15,8 @@ "renderer.MixinBlockRendererDispatcher", "renderer.MixinRendererLivingEntity", "tileentity.TileEntitySignMixin" + ], + "client": [ + "gui.MixinGuiNewChat" ] } |