}//end input private void equipItem() { if (itemType == Globals.ITEM_TYPE_EQUIP) { if (itemID == ItemHandler.equipList.Count) { unnequipItem(); parent = new SubStateListMenuEquip(parent.Parent, PCid, slot); return; } if (StateHandler.GetPC(PCid).equipped[slot] != null) { ItemHandler.equipList.Add(StateHandler.GetPC(PCid).equipped[slot]); } StateHandler.GetPC(PCid).equipped[slot] = ItemHandler.equipList[itemID]; ItemHandler.equipList.RemoveAt(itemID); parent.Parent = new SubStateSlotMenuEquip((SubStateAbstract)parent.Parent.Parent, PCid); } else if (itemType == Globals.ITEM_TYPE_RUNE) { if (itemID == ItemHandler.runeList.Count) { unnequipRune(); parent = new SubStateListMenuRune(parent.Parent, PCid, slot); return; } if (StateHandler.GetPC(PCid).runes[slot] != null) { ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]); } StateHandler.GetPC(PCid).runes[slot] = ItemHandler.runeList[itemID]; ItemHandler.runeList.RemoveAt(itemID); parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid); } }//end equipItem
private void unnequipRune() { if (StateHandler.GetPC(PCid).runes[slot] == null) { return; } ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]); StateHandler.GetPC(PCid).runes[slot] = null; parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid); parent = new SubStateListMenuRune(parent.Parent, PCid, slot); }
private void equipItem() { if (itemType == Globals.ITEM_TYPE_EQUIP) { if (itemID == ItemHandler.equipList.Count) { unnequipItem(); parent = new SubStateListMenuEquip(parent.Parent, PCid, slot); return; } if (StateHandler.GetPC(PCid).equipped[slot] != null) { ItemHandler.equipList.Add(StateHandler.GetPC(PCid).equipped[slot]); } StateHandler.GetPC(PCid).equipped[slot] = ItemHandler.equipList[itemID]; ItemHandler.equipList.RemoveAt(itemID); parent.Parent = new SubStateSlotMenuEquip((SubStateAbstract)parent.Parent.Parent, PCid); } else if (itemType == Globals.ITEM_TYPE_RUNE) { if (itemID == ItemHandler.runeList.Count) { unnequipRune(); parent = new SubStateListMenuRune(parent.Parent, PCid, slot); return; } if (StateHandler.GetPC(PCid).runes[slot] != null) { ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]); } StateHandler.GetPC(PCid).runes[slot] = ItemHandler.runeList[itemID]; ItemHandler.runeList.RemoveAt(itemID); parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid); } }
private void unnequipRune() { if (StateHandler.GetPC(PCid).runes[slot] == null) return; ItemHandler.runeList.Add(StateHandler.GetPC(PCid).runes[slot]); StateHandler.GetPC(PCid).runes[slot] = null; parent.Parent = new SubStateSlotMenuRune((SubStateAbstract)parent.Parent.Parent, PCid); parent = new SubStateListMenuRune(parent.Parent, PCid, slot); }