From b4a17f6710b5bc075abfdaa4e902f775b5b03e36 Mon Sep 17 00:00:00 2001 From: Violet Vibes Date: Tue, 24 Jan 2023 22:16:50 +0000 Subject: [PATCH] Implemented ::xface command allowing the client to close any opened interfaces/dialogue --- .../rs09/game/system/command/sets/MiscCommandSet.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt b/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt index 27723868f..7d53d469c 100644 --- a/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt +++ b/Server/src/main/kotlin/rs09/game/system/command/sets/MiscCommandSet.kt @@ -1,7 +1,6 @@ package rs09.game.system.command.sets import api.* -import api.InputType import core.cache.def.impl.NPCDefinition import core.cache.def.impl.SceneryDefinition import core.cache.def.impl.VarbitDefinition @@ -21,7 +20,6 @@ import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import org.rs09.consts.Components import rs09.ServerConstants -import rs09.game.ai.AIPlayer import rs09.game.ai.AIRepository import rs09.game.camerautils.PlayerCamera import rs09.game.content.activity.fishingtrawler.TrawlerLoot @@ -39,7 +37,6 @@ import rs09.tools.stringtools.colorize import java.awt.HeadlessException import java.awt.Toolkit import java.awt.datatransfer.StringSelection -import java.util.* @Initializable class MiscCommandSet : CommandSet(Privilege.ADMIN){ @@ -322,6 +319,14 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){ } } + /** + * Enables client to safety close the currently opened interface or dialogue (esc-to-close plugin) + */ + define("xface", Privilege.STANDARD, "", "Closes the currently opened interface/dialogue."){player, _ -> + player.interfaceManager.close() + player.dialogueInterpreter.close() + } + /** * Max account stats