From f1fc5b97c776884a5a10a6bcc4d033fa3d726e23 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:38:06 +0100 Subject: Added /shsetapikey --- .../java/at/hannibal2/skyhanni/config/commands/Commands.kt | 2 ++ src/main/java/at/hannibal2/skyhanni/data/ApiDataLoader.kt | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') 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) -> 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) { + SkyHanniMod.feature.hidden.apiKey = args[0] + LorenzUtils.chat("§e[SkyHanni] Api key set via command!") + nextApiCallTime = -1 + } + } } -- cgit