コード例 #1
0
ファイル: LocationControl.cs プロジェクト: kindam/TWTactics
 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);
     }
     }
 }
コード例 #2
0
ファイル: PlayerTableRow.cs プロジェクト: kindam/TWTactics
 public void ShowContext(Point p)
 {
     if (TableModel != null)
     {
         var context = new PlayerContextMenu(_map, _player, true);
         context.Show(TableModel.Table, p);
     }
 }
コード例 #3
0
ファイル: AttackPlanControl.cs プロジェクト: kindam/TWTactics
 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);
         }
     }
 }
コード例 #4
0
ファイル: JanusContextMenu.cs プロジェクト: kindam/TWTactics
 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());
 }