public static Point ToSlotPoint(this InterfacePanel panel, int slot, bool isExpandedInventory = false, int iconWidth = 35, int iconHeight = 35) { Point pt; if (isExpandedInventory) { pt = new Point(110, 285); } else { pt = new Point(110, 350); } slot = slot % (Inventory.InventoryCount + 1); var rowSize = panel.IsWorldPanel() ? 6 : 12; var rowOffset = 0; var columnOffset = (panel == InterfacePanel.WorldSpells) ? 6 : 0; var row = ((slot - 1) / rowSize) + rowOffset; var column = ((slot - 1) % rowSize) + columnOffset; pt.Offset(column * iconWidth, row * iconHeight); return(pt); }
static int GetRelativeSlot(this InterfacePanel panel, int slot) { int maxSlotCount = 36; if (panel == InterfacePanel.Inventory) { maxSlotCount = 60; } if (panel.IsWorldPanel()) { maxSlotCount = 18; } return(slot % maxSlotCount); }
public static bool IsSameAs(this InterfacePanel panel, InterfacePanel target) { return panel == target || (panel.IsWorldPanel() && target.IsWorldPanel()); }
public static bool IsSameAs(this InterfacePanel panel, InterfacePanel target) { return(panel == target || (panel.IsWorldPanel() && target.IsWorldPanel())); }