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); }
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); }