コード例 #1
0
        private void comboChange(object sender, SelectionChangedEventArgs e)
        {
            string selected = (sender as ComboBox).SelectedItem.ToString();

            if (!selected.Equals(currentWindowsResolution[0].ToString() + " X " + currentWindowsResolution[1].ToString()))
            {
                sysRes.IsChecked = false;
                new IniManager(_iniFilepath).setParameter(keyWidth, (selected.Split('X')[0]).Trim(), _iniSection);
                new IniManager(_iniFilepath).setParameter(keyHeight, (selected.Split('X')[1]).Trim(), _iniSection);
            }
            else
            {
                sysRes.IsChecked = true;
                new IniManager(_iniFilepath).setParameter(keyWidth, (selected.Split('X')[0]).Trim(), _iniSection);
                new IniManager(_iniFilepath).setParameter(keyHeight, (selected.Split('X')[1]).Trim(), _iniSection);
            }

            if (GAME_TYPE.resolutionItemChangeWithCopyUIFixes)
            {
                string resolFixfile = INIT.RES_DIR + @"SkyUIFixesINI\" + (selected.Split('X')[0]).Trim() + "x" + (selected.Split('X')[1]).Trim() + @"\SkyrimCustom.ini";
                string skyrimcustom = INIT.getpath("skyrimcustom_ini_userdocs");
                if (File.Exists(resolFixfile))
                {
                    FileManager.remove(skyrimcustom);
                    FileManager.copyFiles(resolFixfile, skyrimcustom);
                }
                else
                {
                    MessageBox.Show("Внимание: для выбранного разрешения нет исправлений для анимации в меню!");
                }
            }
        }
コード例 #2
0
        public static void changeLO(CONTROLS_ACTIONS action)
        {
            if (action.Equals(CONTROLS_ACTIONS.RESET))
            {
                try
                {
                    FileManager.remove(INIT.PLUGINS_TXT_PATH);
                    FileManager.copyFiles(INIT.getpath("plugins_txt_backup"), INIT.PLUGINS_TXT_PATH);
                }
                catch
                {
                    MessageBox.Show("Не удалось провести сброс");
                }
            }
            else
            {
                if (currentShifted != null)
                {
                    PluginInList current = LO.Find(o => o.getTitle().Equals(currentShifted.getTitle()));
                    int          pos     = LO.IndexOf(current);

                    if (action.Equals(CONTROLS_ACTIONS.UP) && (pos == INIT.MASTER_FILES_ESM.Length))
                    {
                        return;
                    }
                    if (action.Equals(CONTROLS_ACTIONS.DOWN) && (pos >= LO.Count - 1))
                    {
                        return;
                    }


                    PluginInList tmp;

                    switch (action)
                    {
                    case CONTROLS_ACTIONS.UP:

                        tmp = LO[pos];

                        LO[pos] = LO[pos - 1];

                        LO[pos - 1] = tmp;

                        break;

                    case CONTROLS_ACTIONS.DOWN:
                        tmp         = LO[pos];
                        LO[pos]     = LO[pos + 1];
                        LO[pos + 1] = tmp;
                        break;

                    default:
                        break;
                    }
                    writeLOInFile();
                }
            }
        }
コード例 #3
0
        public static void writeLOInFile()
        {
            ArrayList LOForWriteinFile = new ArrayList();

            if (!GAME_TYPE.activepluginsMarkAsterisk)
            {
                LOForWriteinFile.Add("# This file is used to tell Oblivion which data files to load.");
                LOForWriteinFile.Add(Environment.NewLine);

                foreach (PluginInList plugin in LO)
                {
                    if (plugin.getActivity())
                    {
                        LOForWriteinFile.Add(plugin.getTitle());
                    }
                }
            }
            else
            {
                LOForWriteinFile.Add("# This file is used by Skyrim to keep track of your downloaded content.");
                LOForWriteinFile.Add("# Please do not modify this file.");

                foreach (PluginInList plugin in LO)
                {
                    if (!plugin.ismaster())
                    {
                        if (plugin.getActivity())
                        {
                            LOForWriteinFile.Add("*" + plugin.getTitle());
                        }
                        else
                        {
                            LOForWriteinFile.Add(plugin.getTitle());
                        }
                    }
                }
            }


            FileManager.WriteAllLines(INIT.getpath("plugins_txt"), LOForWriteinFile);
        }