/// <summary> /// Cancel a window event /// </summary> /// <param name="e">The event to cancel</param> /// <param name="w">The window</param> /// <returns></returns> public static void CancelEvent(WindowEvent e, Windows w) { switch (e) { case WindowEvent.LeftClick: w.cancelclick = true; break; case WindowEvent.RightClick: w.cancelright = true; break; } }
/// <summary> /// Check to see if a event is canceled /// </summary> /// <param name="e">The event to check</param> /// <param name="w">The window</param> /// <returns></returns> public static bool IsEventCancled(WindowEvent e, Windows w) { switch (e) { case WindowEvent.LeftClick: return w.cancelclick; case WindowEvent.RightClick: return w.cancelright; default: return false; } }
public void OpenWindow(WindowType type, Point3 pos) { window = new Windows(type, pos, level, this); SendWindowOpen(window); SendWindowItems(window.id, window.items); HasWindowOpen = true; }
public void SendWindowOpen(Windows window) { SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.InventorySize); }
public void WindowOpen(WindowType type, Point3 pos) { if (!level.windows.ContainsKey(pos)) window = new Windows(type, pos, level); else if (level.windows[pos].Type != type) { level.windows.Remove(pos); window = new Windows(type, pos, level); } else window = level.windows[pos]; SendWindowOpen(window); }
public void SendWindowOpen(Windows window) { SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.items.Length); }