Exemplo n.º 1
0
        public static CommandItem FromToolkitCore([NotNull] ToolkitChatCommand command)
        {
            var result = new CommandItem {
                Name = command.LabelCap.RawText ?? command.commandText, Usage = $"!{command.commandText}", DefName = command.defName
            };

            result.PullFromExtension(command);

            if (command.requiresBroadcaster || command.requiresMod)
            {
                result.UserLevel = UserLevels.Moderator;
            }

            result.Data = new CommandData {
                IsShortcut = false, Mod = command.TryGetModName()
            };

            return(result);
        }
Exemplo n.º 2
0
        public static CommandItem FromToolkit([NotNull] Command command)
        {
            var result = new CommandItem {
                Name = command.LabelCap.RawText, Usage = $"!{command.command}", DefName = command.defName
            };

            result.PullFromExtension(command);

            if (command.requiresAdmin || command.requiresMod)
            {
                result.UserLevel = UserLevels.Moderator;
            }

            result.Data = new CommandData
            {
                IsShortcut = command.commandDriver.Name.Equals("Buy") && !command.defName.Equals("Buy"),
                Mod        = command.TryGetModName(),
                IsBalance  = command == CommandDefOf.CheckBalance,
                IsBuy      = command == CommandDefOf.Buy
            };

            return(result);
        }