public TribeContextMenu(Map map, Tribe tribe) { _tribe = tribe; _menu = JanusContextMenu.Create(); if (map.Display.IsVisible(tribe)) { _menu.AddCommand(ControlsRes.ContextMenu_Pinpoint, OnPinPoint); } _menu.AddCommand(ControlsRes.ContextMenu_PinpointAndCenter, OnPinpointAndCenter, Properties.Resources.TeleportIcon); _menu.AddSeparator(); var markerContext = new MarkerContextMenu(map, tribe); _menu.AddMarkerContextCommands(markerContext); _menu.AddSeparator(); _menu.AddCommand(ControlsRes.ContextMenu_TwStats, OnTwStats); _menu.AddCommand(ControlsRes.ContextMenu_TwGuest, OnTwGuest); _menu.AddSeparator(); _menu.AddCommand(ControlsRes.ContextMenu_ToClipboard, OnToClipboard, Properties.Resources.clipboard); _menu.AddCommand(ControlsRes.ContextMenu_ToBbCode, OnBbCode, Properties.Resources.clipboard); }
public PlayerContextMenu(Map map, Player player, bool addTribeCommands) { _player = player; _menu = JanusContextMenu.Create(); _menu.ShowToolTips = InheritableBoolean.True; if (map.Display.IsVisible(player)) { _menu.AddCommand(ControlsRes.ContextMenu_Pinpoint, OnPinPoint); } _menu.AddCommand(ControlsRes.ContextMenu_PinpointAndCenter, OnPinpointAndCenter, Properties.Resources.TeleportIcon); _menu.AddSeparator(); if (World.Default.You.Empty) { _menu.AddCommand(ControlsRes.PlayerContextMenu_ThisIsMe, OnPlayerYouSet, Properties.Resources.Player); _menu.AddSeparator(); } var markerContext = new MarkerContextMenu(map, player); _menu.AddMarkerContextCommands(markerContext); if (addTribeCommands && player.HasTribe) { _menu.AddTribeContextCommands(map, player.Tribe); } _menu.AddSeparator(); _menu.AddCommand(ControlsRes.ContextMenu_TwStats, OnTwStats); _menu.AddCommand(ControlsRes.ContextMenu_TwGuest, OnTwGuest); _menu.AddSeparator(); _menu.AddCommand(ControlsRes.ContextMenu_ToClipboard, OnToClipboard, Properties.Resources.clipboard); _menu.AddCommand(ControlsRes.ContextMenu_ToBbCode, OnBbCode, Properties.Resources.clipboard); _menu.AddCommand(ControlsRes.ContextMenu_ToBbCodeOperation, OnBbCodeOperation, Properties.Resources.clipboard); }
private void MarkerView_MouseClick(object sender, MouseEventArgs e) { MarkerContextMenu.Close(); }
public static void AddMarkerContextCommands(this UIContextMenu menu, MarkerContextMenu markerContext) { var markerHolder = markerContext.GetMainCommand(menu); markerHolder.Commands.AddRange(markerContext.GetCommands().ToArray()); }