Beispiel #1
0
 public override void LeftClick(Point p, Point o)
 {
     if (p.Y - o.Y - Area.Y < zoom16)
     {
         int pos = (p.X - o.X - Area.X - zoom4) / zoom16;
         if (pos < 0 || pos >= Tabs.Count || Current == pos)
         {
             return;
         }
         Current    = pos;
         CurrentTab = Tabs[pos].Component;
         Game1.playSound("smallSelect");
     }
     else
     {
         CurrentTab?.LeftClick(p, new Point(o.X + Area.X + zoom5, o.Y + Area.Y + zoom22));
     }
 }
Beispiel #2
0
        public override void receiveLeftClick(int x, int y, bool playSound = true)
        {
            base.receiveLeftClick(x, y, playSound);
            Point p = new Point(x, y);
            Point o = new Point(Area.X + zoom10, Area.Y + zoom10);

            if (FloatingComponent != null && FloatingComponent.InBounds(p, o))
            {
                FloatingComponent.LeftClick(p, o);
                return;
            }
            foreach (IInteractiveMenuComponent el in EventOrder)
            {
                if (el.InBounds(p, o))
                {
                    GiveFocus(el);
                    el.LeftClick(p, o);
                    return;
                }
            }
            ResetFocus();
        }