/// <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;
     }
 }
Exemple #3
0
 public void OpenWindow(WindowType type, Point3 pos)
 {
     window = new Windows(type, pos, level, this);
         SendWindowOpen(window);
         SendWindowItems(window.id, window.items);
         HasWindowOpen = true;
 }
Exemple #4
0
 public void SendWindowOpen(Windows window)
 {
     SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.InventorySize);
 }
Exemple #5
0
        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);
        }
Exemple #6
0
 public void SendWindowOpen(Windows window)
 {
     SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.items.Length);
 }