private void OnBeltClick(BeltClickEvent e) { var button = ServerInput.ToServerButton(e.Button); var mods = ServerInput.ToServerModifiers(e.Modifiers); SendMessage("belt", e.Slot, button, mods); }
private void OnClick(MouseButtonEvent e) { var button = ServerInput.ToServerButton(e.Button); var mods = ServerInput.ToServerModifiers(e.Modifiers); SendMessage("click", e.Position, button, mods); }
private void OnPlaced(MapPlaceEvent e) { var button = ServerInput.ToServerButton(e.Button); var mods = ServerInput.ToServerModifiers(e.Modifiers); SendMessage("place", e.MapCoord, button, mods); }
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); } }
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); } }
protected override void OnInit(Point2D position, object[] args) { int i = 3; var resId = (int)args[0]; var q = (int)args[1]; var dragOffset = (int)args[2] != 0 ? (Point2D?)args[i++] : null; var tooltip = args.Length > i ? (string)args[i++] : null; var num = args.Length > i ? (int)args[i] : -1; var itemMold = Session.Resources.Get <ItemProto>(resId); var item = new Item(itemMold); item.Quality = q; item.Amount = num; if (!string.IsNullOrEmpty(tooltip)) { item.Tooltip = tooltip; } widget = new ItemWidget(Parent.Widget, dragOffset); widget.Take += (p) => SendMessage("take", p); widget.Transfer += (p) => SendMessage("transfer", p); widget.Drop += (p) => SendMessage("drop", p); widget.Act += (p) => SendMessage("iact", p); widget.Interact += (mods) => SendMessage("itemact", ServerInput.ToServerModifiers(mods)); widget.Item = item; if (dragOffset.HasValue) { widget.Move(Session.Screen.MousePosition.Sub(dragOffset.Value)); } else { widget.Move(position); } }
private void OnTransfer2(TransferEvent e) { int mods = ServerInput.ToServerModifiers(e.KeyModifiers); SendMessage("xfer2", e.Delta, mods); }
private void OnPartyMemberClick(PartyMemberClickEvent e) { var button = ServerInput.ToServerButton(e.Button); SendMessage("click", e.MemberId, button); }
private void OnGive(CombatRelationClickEvent e) { SendMessage("give", e.Relation.Id, ServerInput.ToServerButton(e.Button)); }
private void OnItemDrop(KeyModifiers mods) { SendMessage("drop", ServerInput.ToServerModifiers(mods)); }