Exemplo n.º 1
0
        public NoPolygonContextMenu(PolygonDrawerManipulator polygonDrawer)
        {
            _polygonDrawer = polygonDrawer;
            _menu          = JanusContextMenu.Create();

            if (_polygonDrawer.Polygons.Count > 0)
            {
                _menu.AddCommand(ControlsRes.NoPolygonContextMenu_ManipulateAll, OnGenerate);
                _menu.AddSeparator();
                _menu.AddCommand(string.Format(ControlsRes.NoPolygonContextMenu_DeleteAll, _polygonDrawer.Polygons.Count), OnClearAll);

                int visiblePolygons = _polygonDrawer.Polygons.Count(x => x.Visible);
                if (visiblePolygons > 0)
                {
                    _menu.AddCommand(string.Format(ControlsRes.NoPolygonContextMenu_HideAll, visiblePolygons), OnHideAll);
                }
                int hiddenPolygons = _polygonDrawer.Polygons.Count(x => !x.Visible);
                if (hiddenPolygons > 0)
                {
                    _menu.AddCommand(string.Format(ControlsRes.NoPolygonContextMenu_ShowAll, hiddenPolygons), OnShowAll);
                }

                _menu.AddSeparator();
            }

            _menu.AddCommand(ControlsRes.NoPolygonContextMenu_HelpCaption, OnHelp);
        }
Exemplo n.º 2
0
        public NoPolygonContextMenu(PolygonDrawerManipulator polygonDrawer)
        {
            _polygonDrawer = polygonDrawer;
            _menu = JanusContextMenu.Create();

            if (_polygonDrawer.Polygons.Count > 0)
            {
                _menu.AddCommand("Manipulate villages from all clusters", OnGenerate);
                _menu.AddSeparator();
                _menu.AddCommand(string.Format("Delete all clusters ({0})", _polygonDrawer.Polygons.Count), OnClearAll);

                int visiblePolygons = _polygonDrawer.Polygons.Count(x => x.Visible);
                if (visiblePolygons > 0)
                {
                    _menu.AddCommand(string.Format("Hide all visible clusters ({0})", visiblePolygons), OnHideAll);
                }
                int hiddenPolygons = _polygonDrawer.Polygons.Count(x => !x.Visible);
                if (hiddenPolygons > 0)
                {
                    _menu.AddCommand(string.Format("Show all hidden clusters ({0})", hiddenPolygons), OnShowAll);
                }

                _menu.AddSeparator();
            }

            _menu.AddCommand("Help", OnHelp);
        }
Exemplo n.º 3
0
        public VillageContextMenu(Map map, Village village, Action onVillageTypeChangeDelegate = null)
        {
            _village = village;
            _map = map;
            _onVillageTypeChangeDelegate = onVillageTypeChangeDelegate;
            _attackPlan = World.Default.Map.Manipulators.AttackManipulator.GetPlan(_village, out _isActiveAttackPlan, out _attacker, false);

            _menu = JanusContextMenu.Create();

            AddAttackPlanItems();

            _menu.AddSeparator();

            if (map.Display.IsVisible(village))
            {
                _menu.AddCommand("Quick Details", OnPinPoint, Properties.Resources.LeftNavigation_QuickFind);
            }
            _menu.AddCommand("Pinpoint && Center", OnPinpointAndCenter, Properties.Resources.TeleportIcon);

            _menu.AddSeparator();
            _menu.AddSetVillageTypeCommand(OnVillageTypeChange, village);

            if (World.Default.Settings.Church)
            {
                var church = _map.Manipulators.ChurchManipulator.GetChurch(_village);
                AddChurchCommands(_menu, church, ChurchChange_Click);
            }

            if (village.HasPlayer)
            {
                _menu.AddSeparator();

                _menu.AddPlayerContextCommands(map, village.Player, false);

                if (village.HasTribe)
                {
                    _menu.AddTribeContextCommands(map, village.Player.Tribe);
                }

                if (village.PreviousVillageDetails != null && village.PreviousVillageDetails.Player != village.Player && village.PreviousVillageDetails.Player != null)
                {
                    var oldPlayer = World.Default.GetPlayer(village.PreviousVillageDetails.Player.Name);
                    _menu.AddPlayerNobledContextCommands(map, oldPlayer ?? village.PreviousVillageDetails.Player, true);
                }
            }

            _menu.AddSeparator();
            _menu.AddCommand("TWStats", OnTwStats);
            _menu.AddCommand("To clipboard", OnToClipboard, Properties.Resources.clipboard);
            _menu.AddCommand("BBCode", OnBbCode, Properties.Resources.clipboard);
        }
Exemplo n.º 4
0
        public VillageContextMenu(Map map, Village village, Action onVillageTypeChangeDelegate = null)
        {
            _village = village;
            _map     = map;
            _onVillageTypeChangeDelegate = onVillageTypeChangeDelegate;
            _attackPlan = World.Default.Map.Manipulators.AttackManipulator.GetPlan(_village, out _isActiveAttackPlan, out _attacker, false);

            _menu = JanusContextMenu.Create();

            AddAttackPlanItems();

            _menu.AddSeparator();

            if (map.Display.IsVisible(village))
            {
                _menu.AddCommand(ControlsRes.ContextMenu_QuickDetails, OnPinPoint, Properties.Resources.LeftNavigation_QuickFind);
            }
            _menu.AddCommand(ControlsRes.ContextMenu_PinpointAndCenter, OnPinpointAndCenter, Properties.Resources.TeleportIcon);

            _menu.AddSeparator();
            _menu.AddSetVillageTypeCommand(OnVillageTypeChange, village);

            if (World.Default.Settings.Church)
            {
                var church = _map.Manipulators.ChurchManipulator.GetChurch(_village);
                AddChurchCommands(_menu, church, ChurchChange_Click);
            }

            if (village.HasPlayer)
            {
                _menu.AddSeparator();

                _menu.AddPlayerContextCommands(map, village.Player, false);

                if (village.HasTribe)
                {
                    _menu.AddTribeContextCommands(map, village.Player.Tribe);
                }

                if (village.PreviousVillageDetails != null && village.PreviousVillageDetails.Player != village.Player && village.PreviousVillageDetails.Player != null)
                {
                    var oldPlayer = World.Default.GetPlayer(village.PreviousVillageDetails.Player.Name);
                    _menu.AddPlayerNobledContextCommands(map, oldPlayer ?? village.PreviousVillageDetails.Player, true);
                }
            }

            _menu.AddSeparator();
            _menu.AddCommand(ControlsRes.ContextMenu_TwStats, OnTwStats);
            _menu.AddCommand(ControlsRes.ContextMenu_ToClipboard, OnToClipboard, Properties.Resources.clipboard);
            _menu.AddCommand(ControlsRes.ContextMenu_ToBbCode, OnBbCode, Properties.Resources.clipboard);
        }
Exemplo n.º 5
0
        public PolygonContextMenu(PolygonDrawerManipulator polygonDrawer)
        {
            _polygonDrawer = polygonDrawer;
            _menu          = JanusContextMenu.Create();

            Debug.Assert(_polygonDrawer.ActivePolygon != null);

            _menu.AddCommand(string.Format(ControlsRes.PolygonContextMenu_Manipulate, _polygonDrawer.ActivePolygon.Name), OnGenerate);
            AttackersPoolContextMenuCommandCreator.Add(_menu, _polygonDrawer.ActivePolygon.GetVillages().Where(x => x.Player == World.Default.You));
            _menu.AddSeparator();

            _menu.AddCommand(ControlsRes.PolygonContextMenu_Delete, OnDelete, Shortcut.Del);
            _menu.AddTextBoxCommand(ControlsRes.PolygonContextMenu_Name, _polygonDrawer.ActivePolygon.Name, NameChanged);
            _menu.AddTextBoxCommand(ControlsRes.PolygonContextMenu_Group, _polygonDrawer.ActivePolygon.Group, GroupChanged);
            _menu.AddChangeColorCommand(ControlsRes.PolygonContextMenu_Color, _polygonDrawer.ActivePolygon.LineColor, SelectedColorChanged);

            _menu.AddCommand(_polygonDrawer.ActivePolygon.Visible ? ControlsRes.PolygonContextMenu_Hide : ControlsRes.PolygonContextMenu_Show, ToggleVisibility);
        }
        private AttackersPoolContextMenuCommandCreator(UIContextMenu menu, IEnumerable <Village> villages)
        {
            _villages = villages.ToArray();

            if (_villages.Any())
            {
                var cmd = menu.AddCommand(string.Format(ControlsRes.AttackersPoolContextMenu_AddXToPool, _villages.Count), OnAddAttackers, Resources.FlagGreen);
                cmd.ToolTipText = ControlsRes.AttackersPoolContextMenu_AddXVillagesTooltip;
            }
        }
Exemplo n.º 7
0
        public static void AddPlayerContextCommands(this UIContextMenu menu, Map map, Player player, bool addTribeCommands)
        {
            string playerDesc = string.Format("{0} ({1})", player.Name, Common.GetPrettyNumber(player.Points));

            if (player.Rank <= 100)
            {
                playerDesc = string.Format("#{0} {1}", player.Rank, playerDesc);
            }
            var playerCommand = menu.AddCommand(playerDesc, null, Properties.Resources.Player);

            AddPlayerContextCommands(map, player, addTribeCommands, playerCommand);
        }
Exemplo n.º 8
0
        public NoVillageContextMenu(Point gameLocation)
        {
            _gameLocation = gameLocation;

            _menu = JanusContextMenu.Create();
            _menu.AddCommand("Center here", OnMapCenter, Properties.Resources.TeleportIcon);
            _menu.AddCommand("Set Home", OnSetHome, Properties.Resources.HomeIcon);
            _menu.AddSeparator();

            _menu.AddChangeColorCommand("Background color", World.Default.Map.Display.Settings.BackgroundColor, Color.Green, OnBackgroundColor);
            _menu.AddToggleCommand("Show continent lines", World.Default.Map.Display.Settings.ContinentLines, OnContinentLines);
            _menu.AddToggleCommand("Show province lines", World.Default.Map.Display.Settings.ProvinceLines, OnProvinceLines);
            _menu.AddSeparator();

            _menu.AddToggleCommand("Hide all abandoned", World.Default.Map.Display.Settings.HideAbandoned, OnHideAbandoned);
            _menu.AddToggleCommand("Show marked only", World.Default.Map.Display.Settings.MarkedOnly, OnMarkedOnly);
            _menu.AddSeparator();

            var showTooltip = _menu.AddCommand("Show village &tooltip", OnShowTooltip);
            showTooltip.IsChecked = World.Default.Map.Manipulators.CurrentManipulator.TooltipActive;
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        public TribeContextMenu(Map map, Tribe tribe)
        {
            _tribe = tribe;

            _menu = JanusContextMenu.Create();

            if (map.Display.IsVisible(tribe))
            {
                _menu.AddCommand("Pinpoint", OnPinPoint);
            }
            _menu.AddCommand("Pinpoint && Center", OnPinpointAndCenter, Properties.Resources.TeleportIcon);
            _menu.AddSeparator();

            var markerContext = new MarkerContextMenu(map, tribe);
            _menu.AddMarkerContextCommands(markerContext);
            _menu.AddSeparator();

            _menu.AddCommand("TWStats", OnTwStats);
            _menu.AddCommand("TW Guest", OnTwGuest);

            _menu.AddSeparator();

            _menu.AddCommand("To clipboard", OnToClipboard, Properties.Resources.clipboard);
            _menu.AddCommand("BBCode", OnBbCode, Properties.Resources.clipboard);
        }
Exemplo n.º 11
0
        public static void AddSetVillageTypeCommand(this UIContextMenu menu, CommandEventHandler onVillageTypeChange, Village village)
        {
            VillageType currentVillageType = village == null ? VillageType.None : village.Type;
            UICommand   villageTypes       = menu.AddCommand(ControlsRes.VillageContextMenu_SetPurpose, null, currentVillageType.GetImage(true));

            AddVillageTypeCommand(villageTypes, VillageType.Attack, currentVillageType, onVillageTypeChange);
            AddVillageTypeCommand(villageTypes, VillageType.Catapult, currentVillageType, onVillageTypeChange);
            AddVillageTypeCommand(villageTypes, VillageType.Defense, currentVillageType, onVillageTypeChange);
            villageTypes.Commands.AddSeparator();
            AddVillageTypeCommand(villageTypes, VillageType.Noble, currentVillageType, onVillageTypeChange);
            AddVillageTypeCommand(villageTypes, VillageType.Scout, currentVillageType, onVillageTypeChange);
            AddVillageTypeCommand(villageTypes, VillageType.Farm, currentVillageType, onVillageTypeChange);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Gets the command that owns GetCommands()
        /// </summary>
        public UICommand GetMainCommand(UIContextMenu menu)
        {
            Debug.Assert(_mainCommand == null);
            var marker = GetMarker();
            var cmd = menu.AddCommand(GetMainCommandText(marker));
            if (marker.Settings.Enabled)
            {
                cmd.Image = GetMainCommandImage(marker);
            }

            _mainCommand = cmd;
            return cmd;
        }
Exemplo n.º 13
0
        public NoVillageContextMenu(Point gameLocation)
        {
            _gameLocation = gameLocation;

            _menu = JanusContextMenu.Create();
            _menu.AddCommand(ControlsRes.NoVillageContextMenu_CenterHere, OnMapCenter, Properties.Resources.TeleportIcon);
            _menu.AddCommand(ControlsRes.NoVillageContextMenu_SetHome, OnSetHome, Properties.Resources.HomeIcon);
            _menu.AddSeparator();

            _menu.AddChangeColorCommand(ControlsRes.NoVillageContextMenu_BackgroundColor, World.Default.Map.Display.Settings.BackgroundColor, Color.Green, OnBackgroundColor);
            _menu.AddToggleCommand(ControlsRes.NoVillageContextMenu_ContinentLines, World.Default.Map.Display.Settings.ContinentLines, OnContinentLines);
            _menu.AddToggleCommand(ControlsRes.NoVillageContextMenu_ProvinceLines, World.Default.Map.Display.Settings.ProvinceLines, OnProvinceLines);
            _menu.AddSeparator();

            _menu.AddToggleCommand(ControlsRes.NoVillageContextMenu_HideAbandoned, World.Default.Map.Display.Settings.HideAbandoned, OnHideAbandoned);
            _menu.AddToggleCommand(ControlsRes.NoVillageContextMenu_ShowMarkedOnly, World.Default.Map.Display.Settings.MarkedOnly, OnMarkedOnly);
            _menu.AddSeparator();

            var showTooltip = _menu.AddCommand(ControlsRes.NoVillageContextMenu_ShowVillageTooltip, OnShowTooltip);

            showTooltip.IsChecked = World.Default.Map.Manipulators.CurrentManipulator.TooltipActive;
        }
Exemplo n.º 14
0
        public VillagesContextMenu(Map map, ICollection<Village> villages, Action<VillageType> onVillageTypeChangeDelegate = null)
        {
            _villages = villages;
            _map = map;
            _onVillageTypeChangeDelegate = onVillageTypeChangeDelegate;

            _menu = JanusContextMenu.Create();
            // TODO: hehe, the ActiveVillageManipulator takes the first player and selects all his villages...
            //if (map.Display.IsVisible(_villages))
            //{
            //    _menu.AddCommand("Pinpoint", OnPinPoint);
            //}
            //_menu.AddCommand("Pinpoint && Center", OnPinpointAndCenter, Properties.Resources.TeleportIcon);
            //_menu.AddSeparator();

            _menu.AddSetVillageTypeCommand(OnVillageTypeChange, null);
            _menu.AddCommand("Remove purpose", OnRemovePurpose);

            if (World.Default.Settings.Church)
            {
                VillageContextMenu.AddChurchCommands(_menu, null, ChurchChange_Click);
            }

            _menu.AddSeparator();
            if (!World.Default.You.Empty && villages.All(x => x.Player == World.Default.You))
            {
                _menu.AddCommand("Defend these villages", OnAddTargets, Properties.Resources.swordsman);

                AttackersPoolContextMenuCommandCreator.Add(_menu, _villages);
            }
            else
            {
                _menu.AddCommand("Attack these villages", OnAddTargets, Properties.Resources.barracks);
            }
            _menu.AddSeparator();

            _menu.AddCommand("BBCode", OnBbCode, Properties.Resources.clipboard);
        }
Exemplo n.º 15
0
        public VillagesContextMenu(Map map, ICollection <Village> villages, Action <VillageType> onVillageTypeChangeDelegate = null)
        {
            _villages = villages;
            _map      = map;
            _onVillageTypeChangeDelegate = onVillageTypeChangeDelegate;

            _menu = JanusContextMenu.Create();
            // TODO: hehe, the ActiveVillageManipulator takes the first player and selects all his villages...
            //if (map.Display.IsVisible(_villages))
            //{
            //    _menu.AddCommand(ControlsRes.ContextMenu_Pinpoint, OnPinPoint);
            //}
            //_menu.AddCommand(ControlsRes.ContextMenu_PinpointAndCenter, OnPinpointAndCenter, Properties.Resources.TeleportIcon);
            //_menu.AddSeparator();

            _menu.AddSetVillageTypeCommand(OnVillageTypeChange, null);
            _menu.AddCommand(ControlsRes.VillageContextMenu_RemovePurpose, OnRemovePurpose);

            if (World.Default.Settings.Church)
            {
                VillageContextMenu.AddChurchCommands(_menu, null, ChurchChange_Click);
            }

            _menu.AddSeparator();
            if (!World.Default.You.Empty && villages.All(x => x.Player == World.Default.You))
            {
                _menu.AddCommand(ControlsRes.VillagesContextMenu_DefendThem, OnAddTargets, Properties.Resources.swordsman);

                AttackersPoolContextMenuCommandCreator.Add(_menu, _villages);
            }
            else
            {
                _menu.AddCommand(ControlsRes.VillagesContextMenu_AttackThem, OnAddTargets, Properties.Resources.barracks);
            }
            _menu.AddSeparator();

            _menu.AddCommand(ControlsRes.ContextMenu_ToBbCode, OnBbCode, Properties.Resources.clipboard);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Gets the command that owns GetCommands()
        /// </summary>
        public UICommand GetMainCommand(UIContextMenu menu)
        {
            Debug.Assert(_mainCommand == null);
            var marker = GetMarker();
            var cmd    = menu.AddCommand(GetMainCommandText(marker));

            if (marker.Settings.Enabled)
            {
                cmd.Image = GetMainCommandImage(marker);
            }

            _mainCommand = cmd;
            return(cmd);
        }
Exemplo n.º 17
0
        public static void AddTribeContextCommands(this UIContextMenu menu, Map map, Tribe tribe)
        {
            string tribeDesc = string.Format("{0} ({1})", tribe.Tag, Common.GetPrettyNumber(tribe.AllPoints));

            if (tribe.Rank <= 20)
            {
                tribeDesc = string.Format("#{0} {1}", tribe.Rank, tribeDesc);
            }
            var tribeCommand = menu.AddCommand(tribeDesc, null, Properties.Resources.Tribe);

            tribeCommand.ToolTipText = tribe.Tooltip;
            var tribeContext = new TribeContextMenu(map, tribe);

            tribeCommand.Commands.AddRange(tribeContext.GetCommands().ToArray());
        }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        public PlayerContextMenu(Map map, Player player, bool addTribeCommands)
        {
            _player = player;

            _menu = JanusContextMenu.Create();
            _menu.ShowToolTips = InheritableBoolean.True;

            if (map.Display.IsVisible(player))
            {
                _menu.AddCommand("Pinpoint", OnPinPoint);
            }
            _menu.AddCommand("Pinpoint && Center", OnPinpointAndCenter, Properties.Resources.TeleportIcon);
            _menu.AddSeparator();

            if (World.Default.You.Empty)
            {
                _menu.AddCommand("This is me!", 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("TWStats", OnTwStats);
            _menu.AddCommand("TW Guest", OnTwGuest);

            _menu.AddSeparator();

            _menu.AddCommand("To clipboard", OnToClipboard, Properties.Resources.clipboard);
            _menu.AddCommand("BBCode", OnBbCode, Properties.Resources.clipboard);
            _menu.AddCommand("Operation", OnBbCodeOperation, Properties.Resources.clipboard);
        }
Exemplo n.º 20
0
        private void AddAttackPlanItems()
        {
            bool isAttackPlannerActive = World.Default.Map.Manipulators.AttackManipulator == World.Default.Map.Manipulators.CurrentManipulator;

            if (isAttackPlannerActive && _attacker != null)
            {
                _menu.AddCommand(ControlsRes.VillageContextMenu_AddToAttackPlan, OnAddAttacker, UnitImages.Ram);

                if (_isActiveAttackPlan && _attacker != null)
                {
                    _menu.AddCommand(ControlsRes.VillageContextMenu_DeleteFromAttackPlan, OnDeleteAttacker, Properties.Resources.Delete);
                }

                _menu.AddSeparator();
            }

            if (_attackPlan != null)
            {
                int planCount = World.Default.Map.Manipulators.AttackManipulator.GetPlans().Count(x => x.Target == _village || x.Attacks.Any(attack => attack.Attacker == _village));
                if (!_isActiveAttackPlan || planCount > 1)
                {
                    string selectPlan = ControlsRes.VillageContextMenu_SelectAttackPlan;
                    if (planCount > 1)
                    {
                        selectPlan += string.Format(" ({0})", planCount);
                    }

                    _menu.AddCommand(selectPlan, OnSelectAttackPlan, Properties.Resources.FlagGreen);
                }

                AddAttackPlanNewItem();

                if (isAttackPlannerActive && (_isActiveAttackPlan || planCount > 0) && _attacker == null)
                {
                    _menu.AddCommand(ControlsRes.VillageContextMenu_DeleteAttackPlan, OnDeleteAttackPlan, Properties.Resources.Delete);
                }
            }
            else
            {
                AddAttackPlanNewItem();
            }
        }
Exemplo n.º 21
0
        public static void AddPlayerNobledContextCommands(this UIContextMenu menu, Map map, Player player, bool addTribeCommands)
        {
            var playerCommand = menu.AddCommand(string.Format(ControlsRes.VillageContextMenu_NobledFrom, player.Name), null, Properties.Resources.nobleman);

            AddPlayerContextCommands(map, player, addTribeCommands, playerCommand);
        }