Пример #1
0
        //[JB] This function performs the necessary data saving and swapping when selecting a new Briefing.
        private void ChangeBriefingIndex(int briefIndex)
        {
            if(_loading) return;

            if (briefIndex == _currentCollectionIndex) return;
            if (briefIndex > cboBriefIndex1.Items.Count)
                briefIndex = cboBriefIndex1.Items.Count - briefIndex;

            Save();  //Save current changes before switching

            _currentCollectionIndex = briefIndex;
            if (_platform == Settings.Platform.XvT)
            {
                _xvtBriefing = _xvtBriefingCollection[briefIndex];
                //These select lines copied from the constructor to re-load and re-init particular data sets and controls.
                _events = new short[_maxEvents, 6];
                _tags = _xvtBriefing.BriefingTag;
                _strings = _xvtBriefing.BriefingString;
                importStrings();
                txtLength.Text = Convert.ToString(Math.Round(((decimal)_xvtBriefing.Length / _timerInterval), 2));
                lstEvents.Items.Clear();
                importEvents(_xvtBriefing.Events);
                numUnk1.Value = _xvtBriefing.Unknown1;
                numUnk3.Value = _xvtBriefing.Unknown3;
                cboText.SelectedIndex = 0;
                cboFGTag.SelectedIndex = 0;
                cboTextTag.SelectedIndex = 0;
                cboColorTag.SelectedIndex = 0;
            }
            else if (_platform == Settings.Platform.XWA)
            {
                _xwaBriefing = _xwaBriefingCollection[briefIndex];
                //These select lines copied from the constructor to re-load and re-init particular data sets and controls.
                _events = new short[_maxEvents, 6];
                _tags = _xwaBriefing.BriefingTag;
                _strings = _xwaBriefing.BriefingString;
                importStrings();
                txtLength.Text = Convert.ToString(Math.Round(((decimal)_xwaBriefing.Length / _timerInterval), 2));
                lstEvents.Items.Clear();
                importEvents(_xwaBriefing.Events);
                numUnk1.Value = _xwaBriefing.Unknown1;
                numUnk3.Enabled = false;
                txtNotes.Enabled = true;
                txtNotes.Text = _xwaBriefing.BriefingStringsNotes[0];
                cboText.SelectedIndex = 0;
                cboFGTag.SelectedIndex = 0;
                cboTextTag.SelectedIndex = 0;
                cboColorTag.SelectedIndex = 0;
                cboInfoCraft.SelectedIndex = 0;
                cboRCraft.SelectedIndex = 0;
                cboRotateAmount.SelectedIndex = 0;
                cboMoveIcon.SelectedIndex = 0;
                cboNewIcon.SelectedIndex = 0;
                cboNCraft.SelectedIndex = 0;
                cboIconIff.SelectedIndex = 0;
            }

            //Refresh controls
            if(lstEvents.Items.Count > 0)
                lstEvents.SelectedIndex = 0;
            if (tabBrief.SelectedIndex == 0) //Only update the map if the tab is visible.
            {
                hsbTimer.Value = 1;
                hsbTimer.Value = 0;  //Need both changes to force the map to update
            }
            UpdateTitle();
            RefreshTeamList();
        }
Пример #2
0
        public BriefingForm(Platform.Xvt.FlightGroupCollection fg, Platform.Xvt.BriefingCollection briefing)
        {
            _loading = true;
            _platform = Settings.Platform.XvT;
            _titleColor = Color.FromArgb(0xFC, 0xFC, 0x00);
            _normalColor = Color.FromArgb(0xF8, 0xFC, 0xF8);
            _highlightColor = Color.FromArgb(0x40, 0xC4, 0x40);
            _zoomY = _zoomX;
            _xvtBriefingCollection = briefing; //[JB] Added
            _currentCollectionIndex = 0;
            _xvtBriefing = briefing[0];
            _maxEvents = Platform.Xvt.Briefing.EventQuantityLimit;
            _events = new short[_maxEvents, 6];
            InitializeComponent();
            this.Text = "YOGEME Briefing Editor - XvT/BoP";
            Import(fg);
            #region XvT layout change
            Height = 422;
            Width = 756;
            tabBrief.Width = 752;
            Point loc = new Point(608, 188);
            pnlShipTag.Location = loc;
            pnlTextTag.Location = loc;
            pctBrief.Size = new Size(360, 214);
            pctBrief.Left = 150;
            lblCaption.BackColor = Color.FromArgb(0, 0, 0x78);
            lblCaption.Font = new Font("Times New Roman", 8F, FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            lblCaption.Size = new Size(360, 28);
            lblCaption.Location = new Point(150, 254);
            lblTitle.BackColor = Color.FromArgb(0x10, 0x10, 0x20);
            lblTitle.Font = new Font("Times New Roman", 8F, FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            lblTitle.Size = new Size(360, 16);
            lblTitle.TextAlign = ContentAlignment.TopCenter;
            lblTitle.ForeColor = _titleColor;
            lblTitle.Text = "*Defined in .LST file*";
            lblTitle.Location = new Point(150, 24);
            cmdTitle.Enabled = false;
            cboColorTag.Items.Clear();
            cboColorTag.Items.Add("Green");
            cboColorTag.Items.Add("Red");
            cboColorTag.Items.Add("Yellow");
            cboColorTag.Items.Add("Blue");
            cboColorTag.Items.Add("Purple");
            cboColorTag.Items.Add("Black");
            cboColor.Items.Clear();
            cboColor.Items.Add("Green");
            cboColor.Items.Add("Red");
            cboColor.Items.Add("Yellow");
            cboColor.Items.Add("Blue");
            cboColor.Items.Add("Purple");
            cboColor.Items.Add("Black");
            #endregion
            importDat(Application.StartupPath + "\\images\\XvT_BRF.dat", 22);
            _tags = _xvtBriefing.BriefingTag;
            _strings = _xvtBriefing.BriefingString;
            importStrings();
            _timerInterval = Platform.Xvt.Briefing.TicksPerSecond;
            txtLength.Text = Convert.ToString(Math.Round(((decimal)_xvtBriefing.Length / _timerInterval), 2));
            hsbTimer.Maximum = _xvtBriefing.Length + 11;
            w = pctBrief.Width;
            h = pctBrief.Height;
            _mapX = 0;
            _mapY = 0;
            lstEvents.Items.Clear();
            importEvents(_xvtBriefing.Events);
            hsbTimer.Value = 0;
            numUnk1.Value = _xvtBriefing.Unknown1;
            numUnk3.Value = _xvtBriefing.Unknown3;
            cboText.SelectedIndex = 0;
            cboFGTag.SelectedIndex = 0;
            cboTextTag.SelectedIndex = 0;
            cboColorTag.SelectedIndex = 0;

            //[JB] Set values for team selection dropdown
            for (int i = 0; i < _xvtBriefingCollection.Count; i++)  //XvT has 8 briefings
            {
                string s = "Briefing " + (i + 1);
                cboBriefIndex1.Items.Add(s);
                cboBriefIndex2.Items.Add(s);
            }
            for(int i = 0; i < 10; i++)  //XvT has 10 teams
                lstTeams.Items.Add((i + 1) + ": " + sharedTeamNames[i]);
            cboBriefIndex1.SelectedIndex = 0;
            cboBriefIndex2.SelectedIndex = 0;
            RefreshTeamList();
            UpdateTitle();

            _loading = false;
            PostLoadInit();
        }