Ejemplo n.º 1
0
        private void Save()
        {
            loaderini.Mods.Clear();

            foreach (ListViewItem item in modListView.CheckedItems)
            {
                loaderini.Mods.Add((string)item.Tag);
            }

            loaderini.UpdateCheck     = checkUpdateStartup.Checked;
            loaderini.ModUpdateCheck  = checkUpdateModsStartup.Checked;
            loaderini.UpdateUnit      = (UpdateUnit)comboUpdateFrequency.SelectedIndex;
            loaderini.UpdateFrequency = (int)numericUpdateFrequency.Value;

            IniSerializer.Serialize(loaderini, loaderinipath);

            List <Code> selectedCodes   = new List <Code>();
            List <Code> selectedPatches = new List <Code>();

            foreach (Code item in codesCheckedListBox.CheckedIndices.OfType <int>().Select(a => codes[a]))
            {
                if (item.Patch)
                {
                    selectedPatches.Add(item);
                }
                else
                {
                    selectedCodes.Add(item);
                }
            }

            CodeList.WriteDatFile(patchdatpath, selectedPatches);
            CodeList.WriteDatFile(codedatpath, selectedCodes);
        }
Ejemplo n.º 2
0
        private void Save()
        {
            loaderini.Mods.Clear();

            foreach (ListViewItem item in modListView.CheckedItems)
            {
                loaderini.Mods.Add((string)item.Tag);
            }

            loaderini.DebugConsole = consoleCheckBox.Checked;
            loaderini.DebugFile    = fileCheckBox.Checked;
            loaderini.Game         = gameS3.Checked ? Game.S3 : (gameSK.Checked ? Game.SK : Game.S3K);
            if (paletteAccurateButton.Checked)
            {
                loaderini.Palette = PaletteSetting.Accurate;
            }
            else if (paletteLinearButton.Checked)
            {
                loaderini.Palette = PaletteSetting.Linear;
            }
            else if (paletteSKCButton.Checked)
            {
                loaderini.Palette = PaletteSetting.SKC;
            }
            else
            {
                loaderini.Palette = PaletteSetting.Old;
            }
            loaderini.UpdateCheck     = checkUpdateStartup.Checked;
            loaderini.ModUpdateCheck  = checkUpdateModsStartup.Checked;
            loaderini.UpdateUnit      = (UpdateUnit)comboUpdateFrequency.SelectedIndex;
            loaderini.UpdateFrequency = (int)numericUpdateFrequency.Value;

            IniSerializer.Serialize(loaderini, loaderinipath);

            List <Code> selectedCodes   = new List <Code>();
            List <Code> selectedPatches = new List <Code>();

            foreach (Code item in codesCheckedListBox.CheckedIndices.OfType <int>().Select(a => codes[a]))
            {
                if (item.Patch)
                {
                    selectedPatches.Add(item);
                }
                else
                {
                    selectedCodes.Add(item);
                }
            }

            CodeList.WriteDatFile(patchdatpath, selectedPatches);
            CodeList.WriteDatFile(codedatpath, selectedCodes);
        }