Пример #1
0
        private static bool DressCommand(string command, Variable[] vars, bool quiet, bool force)
        {
            if (vars.Length == 0)
            {
                throw new RunTimeError("Usage: dress ('name of dress list')");
            }

            if (_lastDressList == null)
            {
                _lastDressList = DressList.Find(vars[0].AsString());

                if (_lastDressList != null)
                {
                    _lastDressList.Dress();
                }
                else if (!quiet)
                {
                    CommandHelper.SendWarning(command, $"'{vars[0].AsString()}' not found", quiet);
                    return(true);
                }
            }
            else if (ActionQueue.Empty)
            {
                _lastDressList = null;
                return(true);
            }

            return(false);
        }
Пример #2
0
        public static bool UnDressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            //we're using a named dresslist or a temporary dresslist?
            if (args.Length == 0)
            {
                if (DressList._Temporary != null)
                {
                    DressList._Temporary.Undress();
                }
                else if (!quiet)
                {
                    throw new RunTimeError(null, "No dresslist specified and no temporary dressconfig present - usage: undress ['dresslist']");
                }
            }
            else
            {
                var d = DressList.Find(args[0].AsString());
                if (d != null)
                {
                    d.Undress();
                }
                else if (!quiet)
                {
                    throw new RunTimeError(null, $"dresslist {args[0].AsString()} not found");
                }
            }

            return(true);
        }
Пример #3
0
        public static bool UnDressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (!Client.Instance.ClientRunning)
            {
                return(true);
            }

            //we're using a named dresslist or a temporary dresslist?
            if (args.Length == 0)
            {
                if (DressList._Temporary != null)
                {
                    DressList._Temporary.Undress();
                }
                else if (!quiet)
                {
                    ScriptUtilities.ScriptErrorMsg("No dresslist specified and no temporary dressconfig present - usage: undress ['dresslist']");
                }
            }
            else
            {
                var d = DressList.Find(args[0].AsString());
                if (d != null)
                {
                    d.Undress();
                }
                else if (!quiet)
                {
                    ScriptUtilities.ScriptErrorMsg($"dresslist {args[0].AsString()} not found");
                }
            }

            return(true);
        }
Пример #4
0
        public static bool UnDressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0) // full naked!
            {
                HotKeys.UndressHotKeys.OnUndressAll();
            }
            else if (args.Length == 1) // either a dress list item or a layer
            {
                DressList d = DressList.Find(args[0].AsString());

                if (d != null)
                {
                    d.Undress();
                }
                else // lets find the layer
                {
                    if (Enum.TryParse(args[0].AsString(), true, out Layer layer))
                    {
                        Dress.Unequip(layer);
                    }
                }
            }

            return(true);
        }
Пример #5
0
        public static bool DressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0)
            {
                throw new RunTimeError(null, "Usage: dress ('name of dress list')");
            }

            if (_lastDressList == null)
            {
                _lastDressList = DressList.Find(args[0].AsString());

                if (_lastDressList != null)
                {
                    _lastDressList.Dress();
                }
                else if (!quiet)
                {
                    throw new RunTimeError(null, $"'{args[0].AsString()}' not found");
                }
            }
            else if (ActionQueue.Empty)
            {
                _lastDressList = null;
                return(true);
            }

            return(false);
        }
Пример #6
0
        public static bool DressCommand(string command, Argument[] args, bool quiet, bool force)
        {
            if (args.Length == 0)
            {
                throw new RunTimeError(null, "Usage: dress ('name of dress list')");
            }

            DressList d = DressList.Find(args[0].AsString());

            if (d != null)
            {
                d.Dress();
            }
            else if (!quiet)
            {
                throw new RunTimeError(null, $"'{args[0].AsString()}' not found");
            }

            return(true);
        }
Пример #7
0
        private static bool UnDressCommand(string command, Variable[] vars, bool quiet, bool force)
        {
            if (vars.Length == 0 && !_undressAll) // full naked!
            {
                _undressAll = true;
                UndressHotKeys.OnUndressAll();
            }
            else if (vars.Length == 1 && _lastUndressList == null && !_undressLayer) // either a dress list item or a layer
            {
                _lastUndressList = DressList.Find(vars[0].AsString());

                if (_lastUndressList != null)
                {
                    _lastUndressList.Undress();
                }
                else // lets find the layer
                {
                    if (Enum.TryParse(vars[0].AsString(), true, out Layer layer))
                    {
                        Dress.Unequip(layer);
                        _undressLayer = true;
                    }
                    else
                    {
                        throw new RunTimeError($"'{vars[0].AsString()}' not found");
                    }
                }
            }
            else if (ActionQueue.Empty)
            {
                _undressAll      = false;
                _undressLayer    = false;
                _lastUndressList = null;
                return(true);
            }

            return(false);
        }