summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/misc
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-04-24 09:31:44 +0200
committerGitHub <noreply@github.com>2024-04-24 09:31:44 +0200
commitc6b6f1fd9377896df0d17f1951cb84c2a1ffd24a (patch)
tree08469230a6bcd1eca867d839d6d2b789087450bb /src/main/java/at/hannibal2/skyhanni/features/misc
parentf9b776fc3c3d09e0992816932118569ac5399431 (diff)
downloadskyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.tar.gz
skyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.tar.bz2
skyhanni-c6b6f1fd9377896df0d17f1951cb84c2a1ffd24a.zip
Backend: Replace Internal Commands (#1522)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt6
3 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
index 60769b579..606dd7480 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt
@@ -78,7 +78,10 @@ object DiscordRPCManager : IPCListener {
ChatUtils.clickableChat(
"Discord Rich Presence was unable to start! " +
"This usually happens when you join SkyBlock when Discord is not started. " +
- "Please run /shrpcstart to retry once you have launched Discord.", "shrpcstart"
+ "Please run /shrpcstart to retry once you have launched Discord.",
+ onClick = {
+ startCommand()
+ }
)
}
} catch (ex: Throwable) {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
index ae7d22c41..8197c8ba9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/massconfiguration/DefaultConfigFeatures.kt
@@ -36,7 +36,9 @@ object DefaultConfigFeatures {
ChatUtils.clickableChat(
"Looks like this is the first time you are using SkyHanni. " +
"Click here to configure default options, or run /shdefaultoptions.",
- "shdefaultoptions"
+ onClick = {
+ onCommand("null", "null")
+ }
)
} else if (updated) {
val lastVersion = knownToggles.keys.last { it != SkyHanniMod.version }
@@ -44,7 +46,9 @@ object DefaultConfigFeatures {
ChatUtils.clickableChat(
"Looks like you updated SkyHanni. " +
"Click here to configure the newly introduced options, or run $command.",
- command
+ onClick = {
+ onCommand(lastVersion, SkyHanniMod.version)
+ }
)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
index 0377e1467..4c6919eea 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt
@@ -8,9 +8,9 @@ import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ConditionalUtils.onToggle
import at.hannibal2.skyhanni.utils.LorenzLogger
import com.google.gson.JsonElement
-import io.github.notenoughupdates.moulconfig.processor.MoulConfigProcessor
import io.github.moulberry.notenoughupdates.util.ApiUtil
import io.github.moulberry.notenoughupdates.util.MinecraftExecutor
+import io.github.notenoughupdates.moulconfig.processor.MoulConfigProcessor
import moe.nea.libautoupdate.CurrentVersion
import moe.nea.libautoupdate.PotentialUpdate
import moe.nea.libautoupdate.UpdateContext
@@ -99,10 +99,10 @@ object UpdateManager {
ChatUtils.chat("§aSkyHanni found a new update: ${it.update.versionName}, starting to download now. ")
queueUpdate()
} else if (config.autoUpdates) {
- ChatUtils.clickableChat(
+ ChatUtils.chatAndOpenConfig(
"§aSkyHanni found a new update: ${it.update.versionName}. " +
"Check §b/sh download update §afor more info.",
- "sh"
+ SkyHanniMod.feature.about::autoUpdates
)
}
}