Пример #1
0
        void UpdateModLoadConfig()
        {
            ModLoadConfig newModLoadConfig = new ModLoadConfig();
            XmlSerializer serializer       = new XmlSerializer(typeof(ModLoadConfig));
            FileStream    stream           = new FileStream(modFolderPath + "ModLoadConfig.xml", FileMode.Create);

            for (int i = 0; i < ModList.Items.Count; i++)
            {
                newModLoadConfig.ModLoadOrder.Add(new ModLoadConfig.ModEntry(ModList.GetItemText(ModList.Items[i]), ModList.GetItemChecked(i)));
            }

            serializer.Serialize(stream, newModLoadConfig);
            stream.Close();
        }
Пример #2
0
        private void ChangeSelectedMod(object sender, EventArgs e)
        {
            if (ModList.SelectedItem == null || ModList.SelectedIndex < 0)
            {
                return; // No selected item - nothing to do
            }
            string key = ModList.GetItemText(ModList.Items[ModList.SelectedIndex]);

            foreach (ModInfo modInfo in modInfos)
            {
                if (key == modInfo.Name)
                {
                    modVersionBox.Text     = modInfo.Version;
                    ModDescriptionBox.Text = modInfo.Description;
                }
            }
        }