Пример #1
0
        private void OnItemInteract(MapClickEvent e)
        {
            var mods = ServerInput.ToServerModifiers(e.Modifiers);

            if (e.Gob != null)
            {
                SendMessage("itemact", e.ScreenCoord, e.MapCoord, mods, e.Gob.Id, e.Gob.Position);
            }
            else
            {
                SendMessage("itemact", e.ScreenCoord, e.MapCoord, mods);
            }
        }
Пример #2
0
        private void OnMapClick(MapClickEvent e)
        {
            var button = ServerInput.ToServerButton(e.Button);
            var mods   = ServerInput.ToServerModifiers(e.Modifiers);

            if (e.Gob != null)
            {
                SendMessage("click", e.ScreenCoord, e.MapCoord, button, mods, e.Gob.Id, e.Gob.Position);
            }
            else
            {
                SendMessage("click", e.ScreenCoord, e.MapCoord, button, mods);
            }
        }
Пример #3
0
        private void OnMapClick(object sender, EventArgs e)
        {
            var args = (MouseEventArgs)e;

            if (args.Button != MouseButtons.Left)
            {
                return;
            }

            var latLon = gMapControl1.FromLocalToLatLng(args.X, args.Y);

            MapClickEvent?.Invoke(
                this,
                new MapClickEventArgs {
                Lattitude = latLon.Lat, Longitude = latLon.Lng
            });
        }