示例#1
0
文件: Main.cs 项目: Serosis/UQMEdit
        public Main()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
            ShipModules = Modules.CreateModules();

            foreach (object ships in ShipsBox.Controls)
            {
                if (ships is ComboBox)
                {
                    (ships as ComboBox).Items.AddRange(Vars.ShipNames);
                }
            }
            foreach (object current in ModulesBox.Controls)
            {
                if (current is ComboBox)
                {
                    (current as ComboBox).Items.AddRange(ShipModules);
                }
            }
            CurrentStatus.Items.AddRange(Vars.StatusName);
            difficultyBox.Items.AddRange(Vars.Difficulties);
            Spoilers.Checked = false;

            string PathVanilla, PathHD, PathMegaMod, PathRemix, PathDesired;
            string PathAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            PathVanilla = PathAppData + "\\uqm\\save";
            PathHD      = PathAppData + "\\uqmhd\\save";
            PathRemix   = PathAppData + "\\uqmhdremix\\save";
            PathMegaMod = PathAppData + "\\UQM-MegaMod\\save";

            if (Directory.Exists(PathMegaMod))
            {
                PathDesired = PathMegaMod;
            }
            else if (Directory.Exists(PathRemix))
            {
                PathDesired = PathRemix;
            }
            else if (Directory.Exists(PathHD))
            {
                PathDesired = PathHD;
            }
            else if (Directory.Exists(PathVanilla))
            {
                PathDesired = PathVanilla;
            }
            else
            {
                PathDesired = Directory.GetCurrentDirectory();
            }

            CurrentDir = PathDesired;
            StarList.Items.AddRange(ParseStars.LoadStars(false));
        }
示例#2
0
文件: Main.cs 项目: Serosis/UQMEdit
        private void Spoilers_CheckedChanged(object sender, EventArgs e)
        {
            int selectedIndex = StarList.SelectedIndex;

            StarList.Items.Clear();
            StarList.Items.AddRange(ParseStars.LoadStars(Spoilers.Checked));
            if (StarList.Items.Count >= selectedIndex)
            {
                if (StarList.Items.Count >= selectedIndex + 23)
                {
                    StarList.SelectedIndex = selectedIndex + 23;
                }
                StarList.SelectedIndex = selectedIndex;
            }
        }