From bdc1486913234961771a7c76d947b93b34753082 Mon Sep 17 00:00:00 2001 From: ev chang Date: Tue, 25 Jun 2024 02:34:16 +0700 Subject: [PATCH] fix migration completely killing chat opacity --- gradle.properties | 2 +- .../polyfrost/chatting/config/ChattingConfig.kt | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index e60a80b..8390770 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_name = Chatting mod_id = chatting -mod_version = 2.0.1 +mod_version = 2.0.2 mod_archives_name = Chatting # Gradle Configuration -- DO NOT TOUCH THESE VALUES. diff --git a/src/main/kotlin/org/polyfrost/chatting/config/ChattingConfig.kt b/src/main/kotlin/org/polyfrost/chatting/config/ChattingConfig.kt index 29bbd96..c270ed7 100644 --- a/src/main/kotlin/org/polyfrost/chatting/config/ChattingConfig.kt +++ b/src/main/kotlin/org/polyfrost/chatting/config/ChattingConfig.kt @@ -345,6 +345,7 @@ object ChattingConfig : Config( var tooltipTextRenderType = 1 var isPatcherMigrated = false + var isPatcherMigratedPt2CauseImStupid = false init { initialize() @@ -356,7 +357,7 @@ object ChattingConfig : Config( if (OldPatcherConfig.transparentChatOnlyWhenClosed) { chatWindow.setBackgroundColor(chatWindow.getBackgroundColor().also { it.alpha = 0 }) chatWindow.differentOpacity = true - chatWindow.openOpacity = 255 + chatWindow.openOpacity = 0 } else { chatWindow.setBackground(false) } @@ -366,6 +367,17 @@ object ChattingConfig : Config( } isPatcherMigrated = true + save() + } + if (!isPatcherMigratedPt2CauseImStupid) { + if (OldPatcherConfig.transparentChat) { + if (OldPatcherConfig.transparentChatOnlyWhenClosed && chatWindow.openOpacity == 255) { + chatWindow.openOpacity = 0 + } + } + + isPatcherMigratedPt2CauseImStupid = true + save() } } catch (_: ClassNotFoundException) {}