aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 14:38:06 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-23 14:38:06 +0100
commitf1fc5b97c776884a5a10a6bcc4d033fa3d726e23 (patch)
tree73b460dfea787f5ba460121eb5b5723f9d24a3fa /src/main/java/at
parent9b8b9c442e51c471f85361f79341ce998f8da2eb (diff)
downloadskyhanni-f1fc5b97c776884a5a10a6bcc4d033fa3d726e23.tar.gz
skyhanni-f1fc5b97c776884a5a10a6bcc4d033fa3d726e23.tar.bz2
skyhanni-f1fc5b97c776884a5a10a6bcc4d033fa3d726e23.zip
Added /shsetapikey
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index f7c89dc4d..a279f1fc1 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigEditor
import at.hannibal2.skyhanni.config.commands.SimpleCommand.ProcessCommandRunnable
import at.hannibal2.skyhanni.config.core.GuiScreenElementWrapper
+import at.hannibal2.skyhanni.data.ApiDataLoader
import at.hannibal2.skyhanni.features.bingo.BingoCardDisplay
import at.hannibal2.skyhanni.features.bingo.BingoNextStepHelper
import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper
@@ -46,6 +47,7 @@ object Commands {
registerCommand("shtrackcollection") { CollectionCounter.command(it) }
registerCommand("shreloadbingodata") { BingoCardDisplay.command() }
registerCommand("shprintbingohelper") { BingoNextStepHelper.command() }
+ registerCommand("shsetapikey") { ApiDataLoader.command(it) }
}
private fun registerCommand(name: String, function: (Array<String>) -> Unit) {
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
index 71a5a66b8..e7f15854a 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt
@@ -19,8 +19,6 @@ import java.util.*
class ApiDataLoader {
private var currentProfileName = ""
-
- private var nextApiCallTime = -1L
private var currentProfileId = ""
@SubscribeEvent
@@ -147,4 +145,14 @@ class ApiDataLoader {
}
}
}
+
+ companion object {
+ private var nextApiCallTime = -1L
+
+ fun command(args: Array<String>) {
+ SkyHanniMod.feature.hidden.apiKey = args[0]
+ LorenzUtils.chat("§e[SkyHanni] Api key set via command!")
+ nextApiCallTime = -1
+ }
+ }
}