Esempio n. 1
0
 /// <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;
     }
 }
Esempio n. 2
0
 /// <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;
     }
 }
Esempio n. 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;
 }
Esempio n. 4
0
 public void SendWindowOpen(Windows window)
 {
     SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.InventorySize);
 }
Esempio n. 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);
        }
Esempio n. 6
0
 public void SendWindowOpen(Windows window)
 {
     SendWindowOpen(window.id, (byte)window.Type, window.name, (byte)window.items.Length);
 }