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); }
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); }
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); }
private static void Dress(DressList list) { if (list.Name.StartsWith("_")) { foreach (DressList dressList in DressList.m_List) { if (dressList.Name == "base") { foreach (Serial item in dressList.Items) { DressInternal(item); } } } } foreach (object item in list.Items) { if (item is Serial) { Dress((Serial)item); } else if (item is ItemID) { Dress((ItemID)item); } else { throw new NotImplementedException(); } } }
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); }
internal static void RefreshLists() { List <DressList> lists = Settings.Dress.ListsRead(); if (lists.Count == 0) { Assistant.Engine.MainWindow.DressListView.Items.Clear(); } DressList selectedList = lists.FirstOrDefault(l => l.Selected); if (selectedList != null && selectedList.Description == Assistant.Engine.MainWindow.DressListSelect.Text) { return; } Assistant.Engine.MainWindow.DressListSelect.Items.Clear(); foreach (DressList l in lists) { Assistant.Engine.MainWindow.DressListSelect.Items.Add(l.Description); if (l.Selected) { Assistant.Engine.MainWindow.DressListSelect.SelectedIndex = Assistant.Engine.MainWindow.DressListSelect.Items.IndexOf(l.Description); DressDelay = l.Delay; DressBag = l.Bag; DressConflict = l.Conflict; } } }
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); }
private static void button_Click(object sender, EventArgs e) { DressList selectedItem = Engine.MainWindow.dressList.SelectedItem as DressList; if (selectedItem != null && World.Player != null) { Dress(selectedItem); } }
private static void DressList_OnAdd() { TreeNode dressNode = HotKey.FindParent(HKCategory.Dress, HKSubCat.None); foreach (TreeNode listNode in dressNode.Nodes) { if (listNode.Text.StartsWith("Dress:")) { DressList list = ((KeyData)listNode.Tag).m_Callback.Target as DressList; if (list != null) { ((KeyData)listNode.Tag).m_Callback = () => Dress(list); } } } }
public static void ToggleRight() { if (World.Player == null) { return; } Item item = World.Player.GetItemOnLayer(Layer.RightHand); if (item == null) { if (m_Right != null) { m_Right = World.FindItem(m_Right.Serial); } if (m_Right != null && m_Right.IsChildOf(World.Player.Backpack)) { // try to also undress conflicting hand(s) Item conflict = World.Player.GetItemOnLayer(Layer.LeftHand); if (conflict != null && (conflict.IsTwoHanded || m_Right.IsTwoHanded)) { Item ub = DressList.FindUndressBag(conflict); if (ub != null) { DragDropManager.DragDrop(conflict, ub); } } DragDropManager.DragDrop(m_Right, World.Player, DressList.GetLayerFor(m_Right)); } else { World.Player.SendMessage(MsgLevel.Force, LocString.MustDisarm); } } else { Item ub = DressList.FindUndressBag(item); if (ub != null) { DragDropManager.DragDrop(item, ub); } m_Right = item; } }
public static void OnUndressAll() { for (int i = 0; i < World.Player.Contains.Count; i++) { Item item = (Item)World.Player.Contains[i]; if (item.Layer <= Layer.LastUserValid && item.Layer != Layer.Backpack && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair) { Item pack = DressList.FindUndressBag(item); if (pack != null) { DragDropManager.DragDrop(item, pack); } } } //if ( Macros.MacroManager.AcceptActions ) // MacroManager.Action( new Macros.UnDressAction( (byte)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); }
public static bool Unequip(Layer layer) { if (layer == Layer.Invalid || layer > Layer.LastUserValid) { return(false); } Item item = World.Player.GetItemOnLayer(layer); if (item != null) { Item pack = DressList.FindUndressBag(item); if (pack != null) { DragDropManager.DragDrop(item, pack); return(true); } } return(false); }
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); }
public static void ToggleRight() { if (World.Player == null) { return; } Item item = World.Player.GetItemOnLayer(Layer.RightHand); if (item == null) { if (m_Right != null) { m_Right = World.FindItem(m_Right.Serial); } if (m_Right != null && m_Right.IsChildOf(World.Player.Backpack)) { // try to also undress conflicting hand(s) Item conflict = World.Player.GetItemOnLayer(Layer.LeftHand); if (conflict != null && (conflict.IsTwoHanded || m_Right.IsTwoHanded)) { Unequip(DressList.GetLayerFor(conflict)); } Equip(m_Right, DressList.GetLayerFor(m_Right)); } else { World.Player.SendMessage(MsgLevel.Force, LocString.MustDisarm); } } else { Unequip(DressList.GetLayerFor(item)); m_Right = item; } }
public static bool Unequip(Layer layer) { if (layer == Layer.Invalid || layer > Layer.LastUserValid) { return(false); } //if ( Macros.MacroManager.AcceptActions ) // MacroManager.Action( new Macros.UnDressAction( (byte)Layer ) ); Item item = World.Player.GetItemOnLayer(layer); if (item != null) { Item pack = DressList.FindUndressBag(item); if (pack != null) { DragDropManager.DragDrop(item, pack); return(true); } } return(false); }