aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/cc
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-03 11:12:54 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-01-03 11:12:54 +0700
commit487709996c22fb0dbcac792076be799a09865600 (patch)
tree5ab6f27a54d673fb057fd3eafd9a5e27816f898c /src/main/kotlin/cc
parentdf895d122a8a2ea249e686578e026c1d0a8b8c47 (diff)
downloadChatting-487709996c22fb0dbcac792076be799a09865600.tar.gz
Chatting-487709996c22fb0dbcac792076be799a09865600.tar.bz2
Chatting-487709996c22fb0dbcac792076be799a09865600.zip
Chattils -> Chatting (1.1.0)
Update images (ty Mo2men) update screenshot line tooltip (ty Mo2men)
Diffstat (limited to 'src/main/kotlin/cc')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/Chatting.kt (renamed from src/main/kotlin/cc/woverflow/chattils/Chattils.kt)48
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatRegexes.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt)8
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatTabsJson.kt (renamed from src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/command/ChattingCommand.kt (renamed from src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt (renamed from src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt)22
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutEditGui.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt)4
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutViewGui.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt)8
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt)6
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/gui/components/TextBlock.kt (renamed from src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/updater/DownloadGui.kt (renamed from src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt)14
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/updater/Updater.kt (renamed from src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt)37
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/utils/ImageTransferable.kt (renamed from src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/utils/ListenableArrayList.kt (renamed from src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt)2
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt (renamed from src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt)10
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/utils/RenderHelper.kt (renamed from src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt)8
22 files changed, 110 insertions, 115 deletions
diff --git a/src/main/kotlin/cc/woverflow/chattils/Chattils.kt b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
index 5ae5c6b..5fb7c67 100644
--- a/src/main/kotlin/cc/woverflow/chattils/Chattils.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/Chatting.kt
@@ -1,15 +1,15 @@
-package cc.woverflow.chattils
-
-import cc.woverflow.chattils.chat.ChatSearchingManager
-import cc.woverflow.chattils.chat.ChatShortcuts
-import cc.woverflow.chattils.chat.ChatTabs
-import cc.woverflow.chattils.command.ChattilsCommand
-import cc.woverflow.chattils.config.ChattilsConfig
-import cc.woverflow.chattils.hook.GuiNewChatHook
-import cc.woverflow.chattils.mixin.GuiNewChatAccessor
-import cc.woverflow.chattils.updater.Updater
-import cc.woverflow.chattils.utils.ModCompatHooks
-import cc.woverflow.chattils.utils.RenderHelper
+package cc.woverflow.chatting
+
+import cc.woverflow.chatting.chat.ChatSearchingManager
+import cc.woverflow.chatting.chat.ChatShortcuts
+import cc.woverflow.chatting.chat.ChatTabs
+import cc.woverflow.chatting.command.ChattingCommand
+import cc.woverflow.chatting.config.ChattingConfig
+import cc.woverflow.chatting.hook.GuiNewChatHook
+import cc.woverflow.chatting.mixin.GuiNewChatAccessor
+import cc.woverflow.chatting.updater.Updater
+import cc.woverflow.chatting.utils.ModCompatHooks
+import cc.woverflow.chatting.utils.RenderHelper
import gg.essential.api.EssentialAPI
import gg.essential.universal.UDesktop
import gg.essential.universal.UResolution
@@ -36,14 +36,14 @@ import java.util.*
@Mod(
- modid = Chattils.ID,
- name = Chattils.NAME,
- version = Chattils.VER,
+ modid = Chatting.ID,
+ name = Chatting.NAME,
+ version = Chatting.VER,
modLanguageAdapter = "gg.essential.api.utils.KotlinAdapter"
)
-object Chattils {
+object Chatting {
- val keybind = KeyBinding("Screenshot Chat", Keyboard.KEY_NONE, "Chattils")
+ val keybind = KeyBinding("Screenshot Chat", Keyboard.KEY_NONE, "Chatting")
const val NAME = "@NAME@"
const val VER = "@VER@"
const val ID = "@ID@"
@@ -67,8 +67,8 @@ object Chattils {
@Mod.EventHandler
fun onInitialization(event: FMLInitializationEvent) {
- ChattilsConfig.preload()
- ChattilsCommand.register()
+ ChattingConfig.preload()
+ ChattingCommand.register()
ClientRegistry.registerKeyBinding(keybind)
EVENT_BUS.register(this)
ChatTabs.initialize()
@@ -93,7 +93,7 @@ object Chattils {
}
fun getChatHeight(opened: Boolean): Int {
- var height = if (opened) ChattilsConfig.focusedHeight else ChattilsConfig.unfocusedHeight
+ var height = if (opened) ChattingConfig.focusedHeight else ChattingConfig.unfocusedHeight
height = (height * Minecraft.getMinecraft().gameSettings.chatScale).toInt()
val chatY = ModCompatHooks.yOffset + ModCompatHooks.chatPosition
if (height + chatY + 27 > (UResolution.scaledHeight / Minecraft.getMinecraft().gameSettings.chatScale).toInt() - 27 - chatY) {
@@ -118,7 +118,7 @@ object Chattils {
val chat = hud.chatGUI
val chatLines = ArrayList<String>()
ChatSearchingManager.filterMessages((chat as GuiNewChatHook).prevText, (chat as GuiNewChatAccessor).drawnChatLines)?.let { drawnLines ->
- val chatHeight = if (ChattilsConfig.customChatHeight) getChatHeight(true) / 9 else GuiNewChat.calculateChatboxHeight(Minecraft.getMinecraft().gameSettings.chatHeightFocused / 9)
+ val chatHeight = if (ChattingConfig.customChatHeight) getChatHeight(true) / 9 else GuiNewChat.calculateChatboxHeight(Minecraft.getMinecraft().gameSettings.chatHeightFocused / 9)
for (i in scrollPos until drawnLines.size.coerceAtMost(scrollPos + chatHeight)) {
chatLines.add(drawnLines[i].chatComponent.formattedText)
}
@@ -131,7 +131,7 @@ object Chattils {
private fun screenshot(messages: List<String>, width: Int): BufferedImage? {
if (messages.isEmpty()) {
- EssentialAPI.getNotifications().push("Chattils", "Chat window is empty.")
+ EssentialAPI.getNotifications().push("Chatting", "Chat window is empty.")
return null
}
@@ -150,9 +150,9 @@ object Chattils {
Minecraft.getMinecraft().entityRenderer.setupOverlayRendering()
Minecraft.getMinecraft().framebuffer.bindFramebuffer(true)
EssentialAPI.getNotifications()
- .push("Chattils", "Chat screenshotted successfully." + (if (ChattilsConfig.copyMode != 1) "\nClick to open." else "")) {
+ .push("Chatting", "Chat screenshotted successfully." + (if (ChattingConfig.copyMode != 1) "\nClick to open." else "")) {
if (!UDesktop.open(file)) {
- EssentialAPI.getNotifications().push("Chattils", "Could not browse!")
+ EssentialAPI.getNotifications().push("Chatting", "Could not browse!")
}
}
return image
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatRegexes.kt
index 0776fa0..a0a8e86 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatRegexes.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatRegexes.kt
@@ -1,4 +1,4 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
data class ChatRegexes(val regexList: List<String>?) {
val compiledRegexList: MutableList<Regex> = arrayListOf()
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt
index 646c218..1e08719 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatSearchingManager.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatSearchingManager.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
-import cc.woverflow.chattils.hook.GuiNewChatHook
+import cc.woverflow.chatting.hook.GuiNewChatHook
import gg.essential.lib.caffeine.cache.Cache
import gg.essential.lib.caffeine.cache.Caffeine
import gg.essential.universal.wrappers.message.UTextComponent
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
index 50cb73c..f72967f 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatShortcuts.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
@@ -1,13 +1,13 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.utils.ListenableArrayList
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.utils.ListenableArrayList
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import java.io.File
object ChatShortcuts {
- private val shortcutsFile = File(Chattils.modDir, "chatshortcuts.json")
+ private val shortcutsFile = File(Chatting.modDir, "chatshortcuts.json")
private val PARSER = JsonParser()
private var initialized = false
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt
index 87f28a1..1389233 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTab.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTab.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
-import cc.woverflow.chattils.gui.components.TabButton
+import cc.woverflow.chatting.gui.components.TabButton
import com.google.gson.annotations.SerializedName
import kotlinx.coroutines.runBlocking
import net.minecraft.client.Minecraft
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt
index ada0baa..5525a51 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabs.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabs.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
-import cc.woverflow.chattils.Chattils
+import cc.woverflow.chatting.Chatting
import com.google.gson.GsonBuilder
import com.google.gson.JsonArray
import com.google.gson.JsonObject
@@ -24,7 +24,7 @@ object ChatTabs {
}
private var initialized = false
- private val tabFile = File(Chattils.modDir, "chattabs.json")
+ private val tabFile = File(Chatting.modDir, "chattabs.json")
fun initialize() {
if (initialized) {
diff --git a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabsJson.kt
index a63913b..e37ef7f 100644
--- a/src/main/kotlin/cc/woverflow/chattils/chat/ChatTabsJson.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatTabsJson.kt
@@ -1,4 +1,4 @@
-package cc.woverflow.chattils.chat
+package cc.woverflow.chatting.chat
import com.google.gson.JsonArray
import com.google.gson.annotations.SerializedName
diff --git a/src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt b/src/main/kotlin/cc/woverflow/chatting/command/ChattingCommand.kt
index 67dd30e..ba697e1 100644
--- a/src/main/kotlin/cc/woverflow/chattils/command/ChattilsCommand.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/command/ChattingCommand.kt
@@ -1,17 +1,17 @@
-package cc.woverflow.chattils.command
+package cc.woverflow.chatting.command
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.config.ChattilsConfig
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.config.ChattingConfig
import gg.essential.api.EssentialAPI
import gg.essential.api.commands.Command
import gg.essential.api.commands.DefaultHandler
-object ChattilsCommand : Command(Chattils.ID, true) {
+object ChattingCommand : Command(Chatting.ID, true) {
override val commandAliases: Set<Alias> = setOf(Alias("stratus"))
@DefaultHandler
fun handle() {
- EssentialAPI.getGuiUtil().openScreen(ChattilsConfig.gui())
+ EssentialAPI.getGuiUtil().openScreen(ChattingConfig.gui())
}
} \ No newline at end of file
diff --git a/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
index d662755..846297b 100644
--- a/src/main/kotlin/cc/woverflow/chattils/config/ChattilsConfig.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
@@ -1,12 +1,12 @@
-package cc.woverflow.chattils.config
-
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.chat.ChatShortcuts
-import cc.woverflow.chattils.chat.ChatTab
-import cc.woverflow.chattils.chat.ChatTabs
-import cc.woverflow.chattils.gui.ChatShortcutViewGui
-import cc.woverflow.chattils.updater.DownloadGui
-import cc.woverflow.chattils.updater.Updater
+package cc.woverflow.chatting.config
+
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.chat.ChatShortcuts
+import cc.woverflow.chatting.chat.ChatTab
+import cc.woverflow.chatting.chat.ChatTabs
+import cc.woverflow.chatting.gui.ChatShortcutViewGui
+import cc.woverflow.chatting.updater.DownloadGui
+import cc.woverflow.chatting.updater.Updater
import gg.essential.api.EssentialAPI
import gg.essential.vigilance.Vigilant
import gg.essential.vigilance.data.Category
@@ -15,7 +15,7 @@ import gg.essential.vigilance.data.PropertyType
import gg.essential.vigilance.data.SortingBehavior
import java.io.File
-object ChattilsConfig : Vigilant(File(Chattils.modDir, "${Chattils.ID}.toml"), Chattils.NAME, sortingBehavior = ConfigSorting) {
+object ChattingConfig : Vigilant(File(Chatting.modDir, "${Chatting.ID}.toml"), Chatting.NAME, sortingBehavior = ConfigSorting) {
@Property(
type = PropertyType.SELECTOR,
@@ -159,7 +159,7 @@ object ChattilsConfig : Vigilant(File(Chattils.modDir, "${Chattils.ID}.toml"), C
if (Updater.shouldUpdate) EssentialAPI.getGuiUtil()
.openScreen(DownloadGui()) else EssentialAPI.getNotifications()
.push(
- Chattils.NAME,
+ Chatting.NAME,
"No update had been detected at startup, and thus the update GUI has not been shown."
)
}
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt b/src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutEditGui.kt
index aa4b933..d75339b 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutEditGui.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutEditGui.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.gui
+package cc.woverflow.chatting.gui
-import cc.woverflow.chattils.chat.ChatShortcuts
+import cc.woverflow.chatting.chat.ChatShortcuts
import gg.essential.api.EssentialAPI
import gg.essential.api.gui.buildConfirmationModal
import gg.essential.elementa.ElementaVersion
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt b/src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutViewGui.kt
index f4ad049..a4a9f70 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/ChatShortcutViewGui.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/ChatShortcutViewGui.kt
@@ -1,7 +1,7 @@
-package cc.woverflow.chattils.gui
+package cc.woverflow.chatting.gui
-import cc.woverflow.chattils.chat.ChatShortcuts
-import cc.woverflow.chattils.gui.components.TextBlock
+import cc.woverflow.chatting.chat.ChatShortcuts
+import cc.woverflow.chatting.gui.components.TextBlock
import gg.essential.api.EssentialAPI
import gg.essential.elementa.ElementaVersion
import gg.essential.elementa.WindowScreen
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt
index 7011518..b67510a 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/components/CleanButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/CleanButton.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.gui.components
+package cc.woverflow.chatting.gui.components
-import cc.woverflow.chattils.Chattils
+import cc.woverflow.chatting.Chatting
import club.sk1er.patcher.config.PatcherConfig
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiButton
@@ -41,7 +41,7 @@ open class CleanButton(buttonId: Int, private val x: () -> Int, private val y: (
GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f)
hovered =
mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height
- if (!Chattils.isPatcher || !PatcherConfig.transparentChatInputField) {
+ if (!Chatting.isPatcher || !PatcherConfig.transparentChatInputField) {
drawRect(
xPosition,
yPosition,
@@ -64,7 +64,7 @@ open class CleanButton(buttonId: Int, private val x: () -> Int, private val y: (
}
companion object {
- private val hoveredColor = Color(255, 255, 255, 128).rgb
- private val color = Color(0, 0, 0, 128).rgb
+ val hoveredColor = Color(255, 255, 255, 128).rgb
+ val color = Color(0, 0, 0, 128).rgb
}
} \ No newline at end of file
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt
index 0e6f088..379444c 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/components/ScreenshotButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/ScreenshotButton.kt
@@ -1,7 +1,7 @@
-package cc.woverflow.chattils.gui.components
+package cc.woverflow.chatting.gui.components
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.mixin.GuiNewChatAccessor
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.mixin.GuiNewChatAccessor
import gg.essential.api.utils.GuiUtil
import gg.essential.universal.UResolution
import net.minecraft.client.Minecraft
@@ -16,7 +16,7 @@ class ScreenshotButton :
override fun onMousePress() {
val chat = Minecraft.getMinecraft().ingameGUI.chatGUI
if (GuiUtil.getOpenedScreen() is GuiChat) {
- Chattils.screenshotChat((chat as GuiNewChatAccessor).scrollPos)
+ Chatting.screenshotChat((chat as GuiNewChatAccessor).scrollPos)
}
}
@@ -28,7 +28,7 @@ class ScreenshotButton :
} else {
GlStateManager.color(1f, 1f, 1f)
}
- mc.textureManager.bindTexture(ResourceLocation(Chattils.ID, "screenshot.png"))
+ mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "screenshot.png"))
Gui.drawModalRectWithCustomSizedTexture(xPosition + 1, yPosition + 1, 0f, 0f, 10, 10, 10f, 10f)
}
}
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt
index 04a2743..a0f875e 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/components/SearchButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/SearchButton.kt
@@ -1,7 +1,7 @@
-package cc.woverflow.chattils.gui.components
+package cc.woverflow.chatting.gui.components
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.hook.GuiNewChatHook
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.hook.GuiNewChatHook
import gg.essential.universal.UResolution
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.Gui
@@ -30,7 +30,7 @@ class SearchButton :
inputField.drawTextBox()
super.drawButton(mc, mouseX, mouseY)
if (visible) {
- mc.textureManager.bindTexture(ResourceLocation(Chattils.ID, "search.png"))
+ mc.textureManager.bindTexture(ResourceLocation(Chatting.ID, "search.png"))
if (isEnabled()) {
GlStateManager.color(224f / 255f, 224f / 255f, 224f / 255f)
} else if (mouseX >= xPosition && mouseX <= xPosition + 10 && mouseY >= yPosition && mouseY <= yPosition + 10) {
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
index 4770900..5342629 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/components/TabButton.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/TabButton.kt
@@ -1,7 +1,7 @@
-package cc.woverflow.chattils.gui.components
+package cc.woverflow.chatting.gui.components
-import cc.woverflow.chattils.chat.ChatTab
-import cc.woverflow.chattils.chat.ChatTabs
+import cc.woverflow.chatting.chat.ChatTab
+import cc.woverflow.chatting.chat.ChatTabs
import gg.essential.universal.UResolution
class TabButton(buttonId: Int, x: Int, widthIn: Int, heightIn: Int, private val chatTab: ChatTab) :
diff --git a/src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt b/src/main/kotlin/cc/woverflow/chatting/gui/components/TextBlock.kt
index c83d22d..8a4f32a 100644
--- a/src/main/kotlin/cc/woverflow/chattils/gui/components/TextBlock.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/gui/components/TextBlock.kt
@@ -1,4 +1,4 @@
-package cc.woverflow.chattils.gui.components
+package cc.woverflow.chatting.gui.components
import gg.essential.elementa.components.UIBlock
import gg.essential.elementa.components.UIText
diff --git a/src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt b/src/main/kotlin/cc/woverflow/chatting/updater/DownloadGui.kt
index c7f59ec..10f2f6f 100644
--- a/src/main/kotlin/cc/woverflow/chattils/updater/DownloadGui.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/updater/DownloadGui.kt
@@ -1,6 +1,6 @@
-package cc.woverflow.chattils.updater
+package cc.woverflow.chatting.updater
-import cc.woverflow.chattils.Chattils
+import cc.woverflow.chatting.Chatting
import gg.essential.api.EssentialAPI
import gg.essential.api.gui.buildConfirmationModal
import gg.essential.api.utils.Multithreading
@@ -15,32 +15,32 @@ class DownloadGui : WindowScreen(ElementaVersion.V1, true, true, true, -1) {
EssentialAPI.getEssentialComponentFactory().buildConfirmationModal {
this.text = "Are you sure you want to update?"
this.secondaryText =
- "(This will update from v${Chattils.VER} to ${Updater.latestTag})"
+ "(This will update from v${Chatting.VER} to ${Updater.latestTag})"
this.onConfirm = {
restorePreviousScreen()
Multithreading.runAsync {
if (Updater.download(
Updater.updateUrl,
File(
- "mods/${Chattils.NAME}-${
+ "mods/${Chatting.NAME}-${
Updater.latestTag!!.substringAfter("v")
}.jar"
)
) && Updater.download(
"https://github.com/Wyvest/Deleter/releases/download/v1.2/Deleter-1.2.jar",
- File(Chattils.modDir.parentFile, "Deleter-1.2.jar")
+ File(Chatting.modDir.parentFile, "Deleter-1.2.jar")
)
) {
EssentialAPI.getNotifications()
.push(
- Chattils.NAME,
+ Chatting.NAME,
"The ingame updater has successfully installed the newest version."
)
Updater.addShutdownHook()
Updater.shouldUpdate = false
} else {
EssentialAPI.getNotifications().push(
- Chattils.NAME,
+ Chatting.NAME,
"The ingame updater has NOT installed the newest version as something went wrong."
)
}
diff --git a/src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt b/src/main/kotlin/cc/woverflow/chatting/updater/Updater.kt
index 35b6e79..ef1e376 100644
--- a/src/main/kotlin/cc/woverflow/chattils/updater/Updater.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/updater/Updater.kt
@@ -1,12 +1,12 @@
-package cc.woverflow.chattils.updater
+package cc.woverflow.chatting.updater
-import cc.woverflow.chattils.Chattils
-import cc.woverflow.chattils.config.ChattilsConfig
+import cc.woverflow.chatting.Chatting
+import cc.woverflow.chatting.config.ChattingConfig
import gg.essential.api.EssentialAPI
import gg.essential.api.utils.Multithreading
import gg.essential.api.utils.WebUtil.downloadToFile
import gg.essential.api.utils.WebUtil.fetchJSON
-import gg.essential.universal.UDesktop.open
+import gg.essential.universal.UDesktop
import net.minecraft.client.Minecraft
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion
import java.io.File
@@ -21,13 +21,13 @@ object Updater {
Multithreading.runAsync {
try {
val latestRelease =
- fetchJSON("https://api.github.com/repos/W-OVERFLOW/${Chattils.ID}/releases/latest").getObject()
+ fetchJSON("https://api.github.com/repos/W-OVERFLOW/${Chatting.ID}/releases/latest").getObject()
latestTag = latestRelease["tag_name"].asString
val currentVersion =
- DefaultArtifactVersion(Chattils.VER.substringBefore("-"))
+ DefaultArtifactVersion(Chatting.VER.substringBefore("-"))
val latestVersion = DefaultArtifactVersion(latestTag!!.substringAfter("v").substringBefore("-"))
if (currentVersion >= latestVersion) {
- if (currentVersion != latestVersion || !Chattils.VER.contains("-")) {
+ if (currentVersion != latestVersion || !Chatting.VER.contains("-")) {
return@runAsync
}
}
@@ -35,10 +35,10 @@ object Updater {
latestRelease["assets"].asJsonArray[0].asJsonObject["browser_download_url"]
.asString
if (updateUrl.isNotEmpty()) {
- if (ChattilsConfig.showUpdate) {
+ if (ChattingConfig.showUpdate) {
EssentialAPI.getNotifications().push(
- Chattils.NAME,
- "${Chattils.NAME} has a new update ($latestTag)! Click here to download it automatically!"
+ Chatting.NAME,
+ "${Chatting.NAME} has a new update ($latestTag)! Click here to download it automatically!"
) { EssentialAPI.getGuiUtil().openScreen(DownloadGui()) }
}
shouldUpdate = true
@@ -54,7 +54,7 @@ object Updater {
if (file.exists()) return true
url = url.replace(" ", "%20")
try {
- downloadToFile(url, file, "${Chattils.NAME}/${Chattils.VER}")
+ downloadToFile(url, file, "${Chatting.NAME}/${Chatting.VER}")
} catch (e: Exception) {
e.printStackTrace()
return false
@@ -62,26 +62,21 @@ object Updater {
return file.exists()
}
- /**
- * Adapted from RequisiteLaunchwrapper under LGPLv3
- * https://github.com/Qalcyo/RequisiteLaunchwrapper/blob/main/LICENSE
- */
fun addShutdownHook() {
- Runtime.getRuntime().addShutdownHook(Thread {
+ EssentialAPI.getShutdownHookUtil().register {
println("Opening Deleter task...")
try {
val runtime = javaRuntime
if (Minecraft.isRunningOnMac) {
- open(Chattils.jarFile.parentFile)
+ UDesktop.open(Chatting.jarFile.parentFile)
}
- val file = File(Chattils.modDir.parentFile, "Deleter-1.2.jar")
+ val file = File(Chatting.modDir.parentFile, "Deleter-1.2.jar")
Runtime.getRuntime()
- .exec("\"" + runtime + "\" -jar \"" + file.absolutePath + "\" \"" + Chattils.jarFile.absolutePath + "\"")
+ .exec("\"" + runtime + "\" -jar \"" + file.absolutePath + "\" \"" + Chatting.jarFile.absolutePath + "\"")
} catch (e: Exception) {
e.printStackTrace()
}
- Thread.currentThread().interrupt()
- })
+ }
}
/**
diff --git a/src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt b/src/main/kotlin/cc/woverflow/chatting/utils/ImageTransferable.kt
index b23e56e..563f17a 100644
--- a/src/main/kotlin/cc/woverflow/chattils/utils/ImageTransferable.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/utils/ImageTransferable.kt
@@ -1,4 +1,4 @@
-package cc.woverflow.chattils.utils
+package cc.woverflow.chatting.utils
import java.awt.Image
import java.awt.datatransfer.DataFlavor
diff --git a/src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt b/src/main/kotlin/cc/woverflow/chatting/utils/ListenableArrayList.kt
index 3b270fd..0cd598c 100644
--- a/src/main/kotlin/cc/woverflow/chattils/utils/ListenableArrayList.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/utils/ListenableArrayList.kt
@@ -1,4 +1,4 @@
-package cc.woverflow.chattils.utils
+package cc.woverflow.chatting.utils
class ListenableArrayList<T>(private val runnable: (ListenableArrayList<T>) -> Unit, vararg elements: T): ArrayList<T>() {
override fun add(element: T): Boolean {
diff --git a/src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt
index 65c80f0..e69a36b 100644
--- a/src/main/kotlin/cc/woverflow/chattils/utils/ModCompatHooks.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/utils/ModCompatHooks.kt
@@ -1,11 +1,11 @@
-package cc.woverflow.chattils.utils
+package cc.woverflow.chatting.utils
import club.sk1er.patcher.config.PatcherConfig
import com.llamalad7.betterchat.BetterChat
-import cc.woverflow.chattils.Chattils.isBetterChat
-import cc.woverflow.chattils.Chattils.isPatcher
-import cc.woverflow.chattils.config.ChattilsConfig.textRenderType
-import cc.woverflow.chattils.utils.RenderHelper.drawBorderedString
+import cc.woverflow.chatting.Chatting.isBetterChat
+import cc.woverflow.chatting.Chatting.isPatcher
+import cc.woverflow.chatting.config.ChattingConfig.textRenderType
+import cc.woverflow.chatting.utils.RenderHelper.drawBorderedString
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.FontRenderer
diff --git a/src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt b/src/main/kotlin/cc/woverflow/chatting/utils/RenderHelper.kt
index 41325ca..53870c1 100644
--- a/src/main/kotlin/cc/woverflow/chattils/utils/RenderHelper.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/utils/RenderHelper.kt
@@ -1,7 +1,7 @@
-package cc.woverflow.chattils.utils
+package cc.woverflow.chatting.utils
-import cc.woverflow.chattils.config.ChattilsConfig
-import cc.woverflow.chattils.hook.GuiNewChatHook
+import cc.woverflow.chatting.config.ChattingConfig
+import cc.woverflow.chatting.hook.GuiNewChatHook
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.FontRenderer
import net.minecraft.client.renderer.GlStateManager
@@ -186,7 +186,7 @@ object RenderHelper {
bufferedimage.setRGB(l, k - j, pixelValues[k * framebuffer.framebufferTextureWidth + l])
}
}
- if (ChattilsConfig.copyMode != 1) {
+ if (ChattingConfig.copyMode != 1) {
try {
file.parentFile.mkdirs()
ImageIO.write(bufferedimage, "png", file)