示例#1
0
文件: SID.cs 项目: forksnd/Blam_BSP
        /// <summary>
        /// The sid loader_ drop down.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void SIDLoader_DropDown(object sender, EventArgs e)
        {
            string tempSidString = ((ComboBox)sender).Text;
            SID    sid           = (SID)((Control)sender).Parent;

            Control ME = this.Parent;

            while (!(ME is MetaEditor) && !(ME == null))
            {
                ME = ME.Parent;
            }

            if (ME != null)
            {
                // Always use the same string swapper, then we only have to load it once!
                MEStringsSelector sSwap = ((MetaEditor)ME).stringSwap;

                if (sSwap == null)
                {
                    sSwap = new MEStringsSelector(map.Strings.Name);
                }

                sSwap.SelectedID = sid.sidIndexer;
                sSwap.ShowDialog();

                // this.Enabled = true;
                if (sid.sidIndexer != sSwap.SelectedID)
                {
                    sid.sidIndexer = sSwap.SelectedID;
                    ((ComboBox)sender).SelectedIndex = -1;
                    ((ComboBox)sender).Text          = map.Strings.Name[sSwap.SelectedID];
                }
            }
            else
            {
                ((ComboBox)sender).Items.Clear();
                this.sidIndexerList.Clear();
                ((ComboBox)sender).Items.Add(string.Empty);
                this.sidIndexerList.Add(0);
                for (int counter = 0; counter < map.Strings.Name.Length; counter++)
                {
                    if (map.Strings.Name[counter].Contains(tempSidString))
                    {
                        ((ComboBox)sender).Items.Add(map.Strings.Name[counter]);
                        string xe = map.Strings.Name[counter];
                        this.sidIndexerList.Add(counter);
                        if (counter == sidIndexer)
                        {
                            ((ComboBox)sender).SelectedIndex = this.sidIndexerList.Count - 1;
                        }
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// The sid loader_ drop down.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void SIDLoader_DropDown(object sender, EventArgs e)
        {
            string tempSidString = ((ComboBox)sender).Text;
            SID sid = (SID)((Control)sender).Parent;

            Control ME = this.Parent;
            while (!(ME is MetaEditor) && !(ME == null))
            {
                ME = ME.Parent;
            }

            if (ME != null)
            {
                // Always use the same string swapper, then we only have to load it once!
                MEStringsSelector sSwap = ((MetaEditor)ME).stringSwap;

                if (sSwap == null)
                {
                    sSwap = new MEStringsSelector(map.Strings.Name);
                }

                sSwap.SelectedID = sid.sidIndexer;
                sSwap.ShowDialog();

                // this.Enabled = true;
                if (sid.sidIndexer != sSwap.SelectedID)
                {
                    sid.sidIndexer = sSwap.SelectedID;
                    ((ComboBox)sender).SelectedIndex = -1;
                    ((ComboBox)sender).Text = map.Strings.Name[sSwap.SelectedID];
                }
            }
            else
            {
                ((ComboBox)sender).Items.Clear();
                this.sidIndexerList.Clear();
                ((ComboBox)sender).Items.Add(string.Empty);
                this.sidIndexerList.Add(0);
                for (int counter = 0; counter < map.Strings.Name.Length; counter++)
                {
                    if (map.Strings.Name[counter].Contains(tempSidString))
                    {
                        ((ComboBox)sender).Items.Add(map.Strings.Name[counter]);
                        string xe = map.Strings.Name[counter];
                        this.sidIndexerList.Add(counter);
                        if (counter == sidIndexer)
                        {
                            ((ComboBox)sender).SelectedIndex = this.sidIndexerList.Count - 1;
                        }
                    }
                }
            }
        }