aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt28
-rw-r--r--src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt1
-rw-r--r--src/main/resources/chatting_dark.svg5
-rw-r--r--src/main/resources/mcmod.info4
4 files changed, 24 insertions, 14 deletions
diff --git a/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
index 6add813..ef1881d 100644
--- a/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/chat/ChatShortcuts.kt
@@ -31,20 +31,24 @@ object ChatShortcuts {
} else {
initialized = true
}
- if (!shortcutsFile.exists()) {
- shortcutsFile.createNewFile()
- if (oldShortcutsFile.exists()) {
- shortcutsFile.writeText(
- oldShortcutsFile.readText()
- )
- } else {
- JsonObject().toString()
+ if (shortcutsFile.exists()) {
+ try {
+ val jsonObj = PARSER.parse(shortcutsFile.readText()).asJsonObject
+ for (shortcut in jsonObj.entrySet()) {
+ shortcuts.add(shortcut.key to shortcut.value.asString)
+ }
+ return
+ } catch (_: Throwable) {
+ shortcutsFile.renameTo(File(shortcutsFile.parentFile, "chatshortcuts.json.bak"))
}
+ }
+ shortcutsFile.createNewFile()
+ if (oldShortcutsFile.exists()) {
+ shortcutsFile.writeText(
+ oldShortcutsFile.readText()
+ )
} else {
- val jsonObj = PARSER.parse(shortcutsFile.readText()).asJsonObject
- for (shortcut in jsonObj.entrySet()) {
- shortcuts.add(shortcut.key to shortcut.value.asString)
- }
+ shortcutsFile.writeText(JsonObject().toString())
}
}
diff --git a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
index 6e6e0ff..f8e6b2a 100644
--- a/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
+++ b/src/main/kotlin/cc/woverflow/chatting/config/ChattingConfig.kt
@@ -21,6 +21,7 @@ object ChattingConfig : Config(
Mod(
Chatting.NAME,
ModType.UTIL_QOL,
+ "/chatting_dark.svg",
VigilanceMigrator(File(Chatting.oldModDir, Chatting.ID + ".toml").toPath().toString())
), "chatting.json"
) {
diff --git a/src/main/resources/chatting_dark.svg b/src/main/resources/chatting_dark.svg
new file mode 100644
index 0000000..42db03e
--- /dev/null
+++ b/src/main/resources/chatting_dark.svg
@@ -0,0 +1,5 @@
+<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M49.5783 107.299H19.7138C11.8913 107.299 4 101.36 4 88.0949V61.6869C4.10613 49.6492 8.61263 38.066 16.6705 29.1224C24.7243 20.174 35.7745 14.4824 47.7362 13.1202C48.8574 13.039 50.0067 13 51.1507 13H51.334C47.6014 16.0524 44.7659 20.0598 43.1298 24.5954C34.9461 26.7797 27.7083 31.5944 22.5306 38.2978C17.3529 45.0012 14.5228 53.2215 14.477 61.6916V88.0995C14.477 90.1472 14.8535 96.8255 19.7103 96.8255H49.5748C58.9829 96.7756 68.0494 93.2943 75.0733 87.0349C82.0973 80.7755 86.5961 72.1689 87.7251 62.8286C87.7873 61.9823 87.8185 61.1031 87.8197 60.2149H98.2979C98.2979 61.3302 98.2553 62.456 98.1788 63.5629C96.8163 75.5319 91.1178 86.5878 82.1603 94.6426C73.2095 102.699 61.6202 107.2 49.5783 107.299Z" fill="#DFE3EC"/>
+<path d="M104.693 52.908H68.1744C64.3561 52.9081 60.6235 51.7759 57.4486 49.6547C54.2738 47.5334 51.7993 44.5183 50.3381 40.9906C48.8769 37.463 48.4946 33.5812 49.2395 29.8363C49.9845 26.0914 51.8232 22.6515 54.5232 19.9516C56.3117 18.1533 58.4392 16.7276 60.7824 15.7571C63.1256 14.7866 65.6381 14.2905 68.1744 14.2975H104.693C108.511 14.2971 112.244 15.429 115.419 17.5501C118.594 19.6711 121.068 22.686 122.53 26.2135C123.991 29.741 124.374 33.6227 123.629 37.3676C122.885 41.1126 121.046 44.5526 118.347 47.2527C116.558 49.0515 114.43 50.4775 112.086 51.4483C109.743 52.419 107.23 52.9152 104.693 52.908ZM66.7435 24.7319C62.641 24.7319 59.3047 28.7113 59.3047 33.6015C59.3047 38.4918 62.6422 42.4712 66.7435 42.4712H106.127C110.23 42.4712 113.567 38.493 113.567 33.6015C113.567 28.7101 110.23 24.7319 106.127 24.7319H66.7435Z" fill="#E0E9FB"/>
+<path opacity="0.7" d="M76.0626 115.647H84.802C90.5946 115.64 96.1479 113.336 100.244 109.24C104.34 105.144 106.644 99.5907 106.651 93.7981V85.0587C106.651 83.8998 106.191 82.7884 105.371 81.9689C104.552 81.1494 103.44 80.6891 102.281 80.6891C101.122 80.6891 100.011 81.1494 99.1915 81.9689C98.372 82.7884 97.9116 83.8998 97.9116 85.0587V93.7981C97.9118 95.5197 97.5728 97.2245 96.9141 98.8151C96.2553 100.406 95.2896 101.851 94.0723 103.068C92.8549 104.286 91.4096 105.251 89.819 105.91C88.2284 106.569 86.5236 106.908 84.802 106.908H76.0626C74.9037 106.908 73.7923 107.368 72.9728 108.188C72.1533 109.007 71.6929 110.119 71.6929 111.277C71.6929 112.436 72.1533 113.548 72.9728 114.367C73.7923 115.187 74.9037 115.647 76.0626 115.647Z" fill="#E0E9FB"/>
+</svg>
diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info
index 46cce6c..ae069a9 100644
--- a/src/main/resources/mcmod.info
+++ b/src/main/resources/mcmod.info
@@ -2,13 +2,13 @@
{
"modid": "${id}",
"name": "${name}",
- "description": "A chat mod.",
+ "description": "A chat mod adding utilities such as extremely customizable chat tabs, chat shortcuts, chat screenshots, and message copying.",
"version": "${version}",
"mcversion": "1.8.9",
"url": "",
"updateUrl": "",
"authorList": [
- "W-OVERFLOW"
+ "Polyfrost"
],
"credits": "Mo2men#2806 for chat icons, Pablo",
"logoFile": "",