Beispiel #1
0
        public SingleSelectorEditorForm(SelectorTypes selectorType, int[] ids)
        {
            InitializeComponent();
            if (ids == null || ids.Length == 0)
            {
                return;
            }
            _repWkr = RepositoryWorker.Instance();
            ItemSelector item;

            flp_items.Controls.Clear();
            switch (selectorType)
            {
            case SelectorTypes.ActionsCustom:
                for (int i = 0; i < ids.Length; i++)
                {
                    var act = _repWkr.GetAction(ids[i]);
                    item        = new ItemSelector(act.Id, act.Icon, act.Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }
            item = null;
        }
Beispiel #2
0
 public CurrentUnit()
 {
     InitializeComponent();
     _repWkr = RepositoryWorker.Instance();
     actionSelectorMain.ActionChanged += ActionSelector_ActionChanged;
     actionSelectorSec.ActionChanged  += ActionSelector_ActionChanged;
 }
Beispiel #3
0
        public SingleSelectorEditorForm(SelectorTypes selectorType)
        {
            InitializeComponent();
            _repWkr = RepositoryWorker.Instance();
            ItemSelector item;

            flp_items.Controls.Clear();
            switch (selectorType)
            {
            case SelectorTypes.Actions:
                for (int i = 0; i < _repWkr.Actions.Count; i++)
                {
                    item        = new ItemSelector(_repWkr.Actions[i].Id, _repWkr.Actions[i].Icon, _repWkr.Actions[i].Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            case SelectorTypes.Effects:
                for (int i = 0; i < _repWkr.Effects.Count; i++)
                {
                    item        = new ItemSelector(_repWkr.Effects[i].Id, _repWkr.Effects[i].Icon, _repWkr.Effects[i].Name);
                    item.Click += Item_Click;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }
            item = null;
        }
Beispiel #4
0
        public MultiSelectorEditorForm(SelectorTypes selectorType, object value)
        {
            InitializeComponent();
            _repWkr = RepositoryWorker.Instance();

            if (value != null)
            {
                var obj = (int[])value;
                for (int i = 0; i < obj.Length; i++)
                {
                    Ids.Add(obj[i]);
                }
            }

            flp_items.Controls.Clear();
            ItemMultiSelector item;

            switch (selectorType)
            {
            case SelectorTypes.Actions:
                for (int i = 0; i < _repWkr.Actions.Count; i++)
                {
                    item = new ItemMultiSelector(
                        _repWkr.Actions[i].Id,
                        _repWkr.Actions[i].Icon,
                        _repWkr.Actions[i].Name,
                        Ids.Any(x => x == _repWkr.Actions[i].Id)
                        );
                    item.ItemMultiSelectorCBChanged += Item_ItemMultiSelectorCBChanged;
                    flp_items.Controls.Add(item);
                }
                break;

            case SelectorTypes.Effects:
                for (int i = 0; i < _repWkr.Effects.Count; i++)
                {
                    item = new ItemMultiSelector(
                        _repWkr.Effects[i].Id,
                        _repWkr.Effects[i].Icon,
                        _repWkr.Effects[i].Name + " | " + _repWkr.Effects[i].Chance + " | " + _repWkr.Effects[i].Turns + " | " + _repWkr.Effects[i].Mod,
                        Ids.Any(x => x == _repWkr.Effects[i].Id)
                        );
                    item.ItemMultiSelectorCBChanged += Item_ItemMultiSelectorCBChanged;
                    flp_items.Controls.Add(item);
                }
                break;

            default:
                break;
            }


            item = null;
        }
Beispiel #5
0
 public UnitEditoMn()
 {
     InitializeComponent();
     _repWkr = RepositoryWorker.Instance();
     _repWkr.LoadAll();
     propertyGrid.PropertyValueChanged += PropertyGrid_PropertyValueChanged;
     unitEditor.SelectedUnitChanged    += UnitEditor_SelectedUnitChanged;
     unitEditor.SetRepWorker(_repWkr);
     actionEditor.SelectedActionChanged += ActionEditor_SelectedActionChanged;
     actionEditor.SetRepWorker(_repWkr);
     effectEditor.SelectedEffectChanged += EffectEditor_SelectedEffectChanged;
     effectEditor.SetRepWorker(_repWkr);
 }
Beispiel #6
0
        public ArmyBrowser()
        {
            InitializeComponent();
            p_0_3.Tag = "03"; pans.Add(p_0_3);
            p_0_4.Tag = "04"; pans.Add(p_0_4);
            p_0_5.Tag = "05"; pans.Add(p_0_5);
            p_0_6.Tag = "06"; pans.Add(p_0_6);
            p_1_2.Tag = "12"; pans.Add(p_1_2);
            p_1_3.Tag = "13"; pans.Add(p_1_3);
            p_1_4.Tag = "14"; pans.Add(p_1_4);
            p_1_5.Tag = "15"; pans.Add(p_1_5);
            p_1_6.Tag = "16"; pans.Add(p_1_6);

            _repWkr = RepositoryWorker.Instance();
            for (int i = 0; i < _repWkr.Teams.Count; i++)
            {
                cb_team.Items.Add(_repWkr.Teams[i].Id);
            }
        }
Beispiel #7
0
        public ArmyEditor(List <Pl> pls)
        {
            InitializeComponent();
            _icons.ImageSize        = new Size(50, 50);
            lv_units.LargeImageList = _icons;
            _repWorker = RepositoryWorker.Instance();
            var units = _repWorker.BaseUnits;

            for (int unitCounter = 0; unitCounter < units.Count; unitCounter++)
            {
                var unit = units[unitCounter];
                _icons.Images.Add(unit.Icon == null? new Bitmap(1, 1): unit.Icon);
                var item = new ListViewItem(unit.Name, unitCounter);
                lv_units.Items.Add(item);
            }
            units = null;
            _pls  = pls;
            armyBrowser1.Set(_pls[0]);
            armyBrowser2.Set(_pls[1]);
        }