Ejemplo n.º 1
0
 private void PlayerTribeSelectorButton_MouseClick(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (PlayerTribeSelector.Player != null)
         {
             var cm = new PlayerContextMenu(World.Default.Map, PlayerTribeSelector.Player, true);
             cm.Show(PlayerTribeSelectorButton, e.Location);
         }
         else if (PlayerTribeSelector.Tribe != null)
         {
             var cm = new TribeContextMenu(World.Default.Map, PlayerTribeSelector.Tribe);
             cm.Show(PlayerTribeSelectorButton, e.Location);
         }
     }
     else if (e.Button == MouseButtons.Left)
     {
         if (PlayerTribeSelector.Player != null)
     {
         World.Default.Map.SetCenter(PlayerTribeSelector.Player);
         World.Default.Map.EventPublisher.SelectPlayer(null, PlayerTribeSelector.Player, VillageTools.PinPoint);
     }
     else if (PlayerTribeSelector.Tribe != null)
     {
         World.Default.Map.SetCenter(PlayerTribeSelector.Tribe);
         World.Default.Map.EventPublisher.SelectTribe(null, PlayerTribeSelector.Tribe, VillageTools.PinPoint);
     }
     }
 }
Ejemplo n.º 2
0
 public void ShowContext(Point p)
 {
     if (TableModel != null)
     {
         var context = new PlayerContextMenu(_map, _player, true);
         context.Show(TableModel.Table, p);
     }
 }
Ejemplo n.º 3
0
 private void _Player_MouseClick(object sender, MouseEventArgs e)
 {
     if (Plan.Target.HasPlayer)
     {
         if (e.Button == MouseButtons.Right)
         {
             var cm = new PlayerContextMenu(World.Default.Map, Plan.Target.Player, false);
             cm.Show(_Player, e.Location);
         }
         else if (e.Button == MouseButtons.Left)
         {
             World.Default.Map.Manipulators.SetManipulator(ManipulatorManagerTypes.Default);
             World.Default.Map.EventPublisher.SelectVillages(null, Plan.Target.Player, VillageTools.PinPoint);
         }
     }
 }
Ejemplo n.º 4
0
 private static void AddPlayerContextCommands(Map map, Player player, bool addTribeCommands, UICommand playerCommand)
 {
     playerCommand.ToolTipText = player.Tooltip;
     var playerContext = new PlayerContextMenu(map, player, addTribeCommands);
     playerCommand.Commands.AddRange(playerContext.GetCommands().ToArray());
 }