diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-08-24 23:33:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 23:33:10 +0200 |
commit | d89a70ecccf8db498940b97a51cba06d4a75cec5 (patch) | |
tree | 97d81a1a0149c39bd9fed7f05b7345f7756cdc5c | |
parent | b5b7b01f883cd9c6ce84edd223bd3dcdce6a874a (diff) | |
parent | 4a7946b11910cf9ba0926d6b43340b84fc61ef93 (diff) | |
download | Chatting-d89a70ecccf8db498940b97a51cba06d4a75cec5.tar.gz Chatting-d89a70ecccf8db498940b97a51cba06d4a75cec5.tar.bz2 Chatting-d89a70ecccf8db498940b97a51cba06d4a75cec5.zip |
Merge pull request #9 from Polyfrost/notif-fix
Notif fix
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | gradle.properties | 4 | ||||
-rw-r--r-- | src/main/kotlin/cc/woverflow/chatting/Chatting.kt | 61 |
3 files changed, 41 insertions, 26 deletions
diff --git a/build.gradle b/build.gradle index 6c2aee8..d28539a 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ dependencies { mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") compileOnly ('org.spongepowered:mixin:0.7.11-SNAPSHOT') - compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha+') + compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.1.0-alpha92') include('cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-alpha+') modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") } diff --git a/gradle.properties b/gradle.properties index 2a7cbf8..8df6fa3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx2G mod_name = Chatting mod_id = chatting -mod_version = 1.4.2-alpha1 +mod_version = 1.4.2-alpha2 loom.platform = forge -minecraft.version = "1.8.9-forge"
\ No newline at end of file +minecraft.version = "1.8.9-forge" diff --git a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt index 4ddcbdd..61e61dd 100644 --- a/src/main/kotlin/cc/woverflow/chatting/Chatting.kt +++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt @@ -4,7 +4,7 @@ import cc.polyfrost.oneconfig.libs.universal.UDesktop import cc.polyfrost.oneconfig.libs.universal.UResolution import cc.polyfrost.oneconfig.utils.commands.CommandManager import cc.polyfrost.oneconfig.utils.dsl.browseLink -import cc.polyfrost.oneconfig.utils.notifications.Notifications +import cc.polyfrost.oneconfig.utils.Notifications import cc.woverflow.chatting.chat.ChatSearchingManager import cc.woverflow.chatting.chat.ChatShortcuts import cc.woverflow.chatting.chat.ChatSpamBlock @@ -95,9 +95,12 @@ object Chatting { fun onForgeLoad(event: FMLLoadCompleteEvent) { if (ChattingConfig.informForAlternatives) { if (isHychat) { - Notifications.INSTANCE.send(NAME, "Hychat can be removed as it is replaced by Chatting. Click here for more information.") { - UDesktop.browseLink("https://microcontrollersdev.github.io/Alternatives/1.8.9/hychat") - } + Notifications.INSTANCE.send( + NAME, + "Hychat can be removed as it is replaced by Chatting. Click here for more information.", + Runnable { + UDesktop.browseLink("https://microcontrollersdev.github.io/Alternatives/1.8.9/hychat") + }) } if (isSkytils) { try { @@ -119,23 +122,29 @@ object Chatting { val chatTabs = skytilsClass.getDeclaredField("chatTabs") chatTabs.isAccessible = true if (chatTabs.getBoolean(instance)) { - Notifications.INSTANCE.send(NAME, "Skytils' chat tabs can be disabled as it is replace by Chatting.\nClick here to automatically do this.", 6F) { - chatTabs.setBoolean(instance, false) - ChattingConfig.chatTabs = true - ChattingConfig.hypixelOnlyChatTabs = true - ChattingConfig.save() - skytilsClass.getMethod("markDirty").invoke(instance) - skytilsClass.getMethod("writeData").invoke(instance) - } + Notifications.INSTANCE.send( + NAME, + "Skytils' chat tabs can be disabled as it is replace by Chatting.\nClick here to automatically do this.", + Runnable { + chatTabs.setBoolean(instance, false) + ChattingConfig.chatTabs = true + ChattingConfig.hypixelOnlyChatTabs = true + ChattingConfig.save() + skytilsClass.getMethod("markDirty").invoke(instance) + skytilsClass.getMethod("writeData").invoke(instance) + }) } val copyChat = skytilsClass.getDeclaredField("chatTabs") copyChat.isAccessible = true if (copyChat.getBoolean(instance)) { - Notifications.INSTANCE.send(NAME, "Skytils' copy chat messages can be disabled as it is replace by Chatting.\nClick here to automatically do this.", 6F) { - copyChat.setBoolean(instance, false) - skytilsClass.getMethod("markDirty").invoke(instance) - skytilsClass.getMethod("writeData").invoke(instance) - } + Notifications.INSTANCE.send( + NAME, + "Skytils' copy chat messages can be disabled as it is replace by Chatting.\nClick here to automatically do this.", + Runnable { + copyChat.setBoolean(instance, false) + skytilsClass.getMethod("markDirty").invoke(instance) + skytilsClass.getMethod("writeData").invoke(instance) + }) } } @@ -204,7 +213,10 @@ object Chatting { return null } if (!OpenGlHelper.isFramebufferEnabled()) { - Notifications.INSTANCE.send("Chatting", "Screenshot failed, please disable “Fast Render” in OptiFine’s “Performance” tab.") + Notifications.INSTANCE.send( + "Chatting", + "Screenshot failed, please disable “Fast Render” in OptiFine’s “Performance” tab." + ) return null } @@ -223,11 +235,14 @@ object Chatting { val image = fb.screenshot(file) Minecraft.getMinecraft().entityRenderer.setupOverlayRendering() Minecraft.getMinecraft().framebuffer.bindFramebuffer(true) - Notifications.INSTANCE.send("Chatting", "Chat screenshotted successfully." + (if (ChattingConfig.copyMode != 1) "\nClick to open." else "")) { - if (!UDesktop.open(file)) { - Notifications.INSTANCE.send("Chatting", "Could not browse!") - } - } + Notifications.INSTANCE.send( + "Chatting", + "Chat screenshotted successfully." + (if (ChattingConfig.copyMode != 1) "\nClick to open." else ""), + Runnable { + if (!UDesktop.open(file)) { + Notifications.INSTANCE.send("Chatting", "Could not browse!") + } + }) return image } } |