Esempio n. 1
0
 private VillageType?GetSelectedVillageTypeFilter()
 {
     if (VillageTypeInput.Combobox.SelectedIndex > 0)
     {
         return(VillageTypeHelper.GetVillageType(VillageTypeInput.Combobox.SelectedIndex));
     }
     return(null);
 }
Esempio n. 2
0
        public VillagesGridExControl()
        {
            ShowPlayer = true;
            _columns   = new Dictionary <VillageFields, GridEXColumn>();
            InitializeComponent();

            _villageTypeBox           = new ImageCombobox();
            _villageTypeBox.ImageList = VillageTypeHelper.GetImageList();
        }
Esempio n. 3
0
 private void GridExVillage_EndCustomEdit(object sender, EndCustomEditEventArgs e)
 {
     if (e.Column == _columns[VillageFields.Type])
     {
         int selected = _villageTypeBox.SelectedIndex;
         if (selected > 0)
         {
             e.Value = (int)VillageTypeHelper.GetVillageType(selected);
         }
         else
         {
             e.Value = null;
         }
         e.DataChanged = true;
     }
 }
Esempio n. 4
0
        private void Default_SettingsLoaded(object sender, EventArgs e)
        {
            UnitInput.SetWorldUnits(true);
            UnitInput.Combobox.SelectedIndex = WorldUnits.Default[UnitTypes.Ram].Position + 1; // +1: First Image is null in the Combobox.ImageList
            World.Default.Map.Manipulators.AttackManipulator.DefaultSpeed = UnitTypes.Ram;

            VillageTypeInput.Combobox.ImageList = VillageTypeHelper.GetImageList();

            _plans.Clear();
            AttackDropDown.DropDownItems.Clear();
            ActivePlan = null;
            AllPlans.Controls.Clear();

            var plansFromXml = World.Default.Map.Manipulators.AttackManipulator.GetPlans();

            foreach (AttackPlan plan in plansFromXml)
            {
                AddPlan(plan);
            }
            if (_plans.Any())
            {
                World.Default.Map.EventPublisher.AttackSelect(this, _plans.Select(x => x.Key).First());
            }
            else
            {
                ShowHelp();
            }

            toolStrip2.Visible = _plans.Any();
            foreach (var toolbarItem in toolStrip1.Items.OfType <ToolStripItem>().Where(x => x.Tag == null || x.Tag.ToString() != "OWN_VISIBILITY"))
            {
                if (_plans.Any())
                {
                    toolbarItem.Visible = true;
                }
                else
                {
                    toolbarItem.Visible = _visibleWhenNoPlans.Contains(toolbarItem);
                }
            }
        }