예제 #1
0
        /// <summary>
        /// Unregisters the specified command
        /// </summary>
        /// <param name="command"></param>
        /// <param name="plugin"></param>
        public void UnregisterCommand(string command, Plugin plugin)
        {
            IConsoleCommand cmd = SdtdConsole.Instance.GetCommand(command);

            if (SdtdConsole.Instance.m_Commands.Contains(cmd))
            {
                SdtdConsole.Instance.m_Commands.Remove(cmd);
                foreach (string nCommand in cmd.GetCommands())
                {
                    SdtdConsole.Instance.m_CommandsAllVariants.Remove(nCommand);
                }
            }

            // Remove the command
            registeredCommands.Remove(command);
        }