From 1fe45f026afeff9d87107380bf8c4cf58051b29f Mon Sep 17 00:00:00 2001 From: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Date: Mon, 10 Jun 2024 03:11:42 +0200 Subject: Backend: Graph Editor (#1454) Co-authored-by: Cal Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../misc/massconfiguration/DefaultConfigFeatures.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') 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 5fa36943a..8a594259e 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 @@ -40,7 +40,7 @@ object DefaultConfigFeatures { "Click here to configure default options, or run /shdefaultoptions.", onClick = { onCommand("null", "null") - } + }, ) } else if (updated) { val lastVersion = knownToggles.keys.last { it != SkyHanniMod.version } @@ -50,11 +50,18 @@ object DefaultConfigFeatures { "Click here to configure the newly introduced options, or run $command.", onClick = { onCommand(lastVersion, SkyHanniMod.version) - } + }, ) } } + fun onCommand(args: Array) { + onCommand( + args.getOrNull(0) ?: "null", + args.getOrNull(1) ?: "null", + ) + } + fun onCommand(old: String, new: String) { val processor = FeatureToggleProcessor() ConfigProcessorDriver(processor).processConfig(SkyHanniMod.feature) @@ -108,7 +115,7 @@ object DefaultConfigFeatures { if (strings.size <= 2) return CommandBase.getListOfStringsMatchingLastWord( strings, - SkyHanniMod.knownFeaturesData.knownFeatures.keys + listOf("null") + SkyHanniMod.knownFeaturesData.knownFeatures.keys + listOf("null"), ) return listOf() } -- cgit