コード例 #1
0
ファイル: NPCToolPanel.cs プロジェクト: coolzoom/mir2-master
        private void ConquestHidden_combo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ActiveControl != sender)
            {
                return;
            }
            ConquestInfo temp = (ConquestInfo)ConquestHidden_combo.SelectedItem;

            for (int i = 0; i < _SelectedItems.Count; i++)
            {
                _SelectedItems[i].Conquest = temp.Index;
            }
        }
コード例 #2
0
        private void UpdateInterface()
        {
            _SelectedItem = (ConquestInfo)ConquestInfoListBox.SelectedItem;


            Maps_listbox.Items.Clear();
            Guards_listbox.Items.Clear();
            Gates_listbox.Items.Clear();
            Walls_listbox.Items.Clear();
            Siege_listbox.Items.Clear();
            Flags_listbox.Items.Clear();
            Index_textbox.Text       = string.Empty;
            Name_textbox.Text        = string.Empty;
            FullMap_checkbox.Checked = false;
            LocX_textbox.Text        = string.Empty;
            LocY_textbox.Text        = string.Empty;
            Size_textbox.Text        = string.Empty;
            ObLocX_textbox.Text      = string.Empty;
            ObLocY_textbox.Text      = string.Empty;
            ObSize_textbox.Text      = string.Empty;
            Controls_listbox.Items.Clear();
            ConquestMap_combo.SelectedIndex = -1;
            PalaceMap_combo.SelectedIndex   = -1;
            ExtraMaps_combo.SelectedIndex   = -1;
            WarType_combo.SelectedIndex     = -1;
            WarMode_combo.SelectedIndex     = -1;
            ArcherIndex_combo.SelectedIndex = -1;
            ArchXLoc_textbox.Text           = string.Empty;
            ArchYLoc_textbox.Text           = string.Empty;
            Archer_gb.Enabled = false;
            SiegeIndex_combo.SelectedIndex = -1;
            SiegeXLoc_textbox.Text         = string.Empty;
            SiegeYLoc_textbox.Text         = string.Empty;
            Siege_gb.Enabled       = false;
            SiegeName_textbox.Text = string.Empty;
            Main_tabs.Enabled      = false;
            WarLength_num.Value    = 60;
            StartHour_num.Value    = 1;
            Mon_checkbox.Checked   = false;
            Tue_checkbox.Checked   = false;
            Wed_checkbox.Checked   = false;
            Thu_checkbox.Checked   = false;
            Fri_checkbox.Checked   = false;
            Sat_checkbox.Checked   = false;
            Sun_checkbox.Checked   = false;

            if (_SelectedItem != null)
            {
                Main_tabs.Enabled = true;

                Index_textbox.Text             = _SelectedItem.Index.ToString();
                Name_textbox.Text              = _SelectedItem.Name.ToString();
                FullMap_checkbox.Checked       = _SelectedItem.FullMap;
                LocX_textbox.Text              = _SelectedItem.Location.X.ToString();
                LocY_textbox.Text              = _SelectedItem.Location.Y.ToString();
                Size_textbox.Text              = _SelectedItem.Size.ToString();
                ObLocX_textbox.Text            = _SelectedItem.KingLocation.X.ToString();
                ObLocY_textbox.Text            = _SelectedItem.KingLocation.Y.ToString();
                ObSize_textbox.Text            = _SelectedItem.KingSize.ToString();
                ConquestMap_combo.SelectedItem = MotherParent.MapPanel.MapInfoList.FirstOrDefault(x => x.Index == _SelectedItem.MapIndex);
                PalaceMap_combo.SelectedItem   = MotherParent.MapPanel.MapInfoList.FirstOrDefault(x => x.Index == _SelectedItem.PalaceIndex);
                WarMode_combo.SelectedItem     = _SelectedItem.Game;
                WarType_combo.SelectedItem     = _SelectedItem.Type;
                WarLength_num.Value            = _SelectedItem.WarLength;
                StartHour_num.Value            = _SelectedItem.StartHour;
                Mon_checkbox.Checked           = _SelectedItem.Monday;
                Tue_checkbox.Checked           = _SelectedItem.Tuesday;
                Wed_checkbox.Checked           = _SelectedItem.Wednesday;
                Thu_checkbox.Checked           = _SelectedItem.Thursday;
                Fri_checkbox.Checked           = _SelectedItem.Friday;
                Sat_checkbox.Checked           = _SelectedItem.Saturday;
                Sun_checkbox.Checked           = _SelectedItem.Sunday;
                for (int i = 0; i < _SelectedItem.ConquestGuards.Count; i++)
                {
                    Guards_listbox.Items.Add(_SelectedItem.ConquestGuards[i]);
                }

                for (int i = 0; i < _SelectedItem.ExtraMaps.Count; i++)
                {
                    Maps_listbox.Items.Add(MotherParent.MapPanel.MapInfoList.FirstOrDefault(x => x.Index == _SelectedItem.ExtraMaps[i]));
                }

                for (int i = 0; i < _SelectedItem.ConquestGates.Count; i++)
                {
                    Gates_listbox.Items.Add(_SelectedItem.ConquestGates[i]);
                }
                for (int i = 0; i < _SelectedItem.ConquestWalls.Count; i++)
                {
                    Walls_listbox.Items.Add(_SelectedItem.ConquestWalls[i]);
                }
                for (int i = 0; i < _SelectedItem.ConquestSieges.Count; i++)
                {
                    Siege_listbox.Items.Add(_SelectedItem.ConquestSieges[i]);
                }

                for (int i = 0; i < _SelectedItem.ConquestFlags.Count; i++)
                {
                    Flags_listbox.Items.Add(_SelectedItem.ConquestFlags[i]);
                }

                for (int i = 0; i < _SelectedItem.ControlPoints.Count; i++)
                {
                    Controls_listbox.Items.Add(_SelectedItem.ControlPoints[i]);
                }
            }
        }