public ModCrateManagerForm(ModLoader Program) { ModProgram = Program; InitializeComponent(); checkedListBox_mods.Items.Clear(); ModCrates.PopulateModList(ModProgram.SupportedMods, ModProgram.Modder != null, ModProgram.Game.ShortName); if (ModProgram.SupportedMods.Count > 0) { for (int i = 0; i < ModProgram.SupportedMods.Count; i++) { string ListName = ModProgram.SupportedMods[i].Name; ListName += " "; ListName += ModProgram.SupportedMods[i].Version; /* * uint ModLoaderVer; * if (uint.TryParse(SupportedMods[i].CML_Version, out ModLoaderVer)) * { * if (ModLoaderVer != ModLoaderGlobals.ProgramVersionSimple) * { * ListName += " "; * ListName += "(*)"; * } * } * else * { * ListName += " "; * ListName += "(*)"; * } */ checkedListBox_mods.Items.Add(ListName); if (ModProgram.SupportedMods[i].IsActivated) { checkedListBox_mods.SetItemCheckState(i, CheckState.Checked); } else { checkedListBox_mods.SetItemCheckState(i, CheckState.Unchecked); } } } label_author.Text = ""; label_desc.Text = ""; button_confirm.Text = ModLoaderText.ModCrateManagerConfirmButton; Text = ModLoaderText.ModCrateManagerTitle; pictureBox_ModIcon.Image = null; }
private void checkedListBox_mods_ItemCheck(object sender, ItemCheckEventArgs e) { int index = e.Index; if (e.NewValue == CheckState.Checked) { ModCrates.UpdateModSelection(ModProgram.SupportedMods, index, true); } else { ModCrates.UpdateModSelection(ModProgram.SupportedMods, index, false); } }
private void button3_Click(object sender, EventArgs e) { openFileDialog1.InitialDirectory = ModLoaderGlobals.ModDirectory; openFileDialog1.Filter = string.Format("{0} (*.zip; *.txt)|*.zip;*.txt", ModLoaderText.ModMenuLoad_FileTypes); openFileDialog1.FileName = ""; if (openFileDialog1.ShowDialog() == DialogResult.OK) { ModCrates.LoadSettingsFromFile(mod, openFileDialog1.FileName); foreach (ModPropertyGUI_Base prop in PropGUIs) { prop.UpdateUI(); } } }
private void button2_Click(object sender, EventArgs e) { saveFileDialog1.InitialDirectory = ModLoaderGlobals.ModDirectory; saveFileDialog1.Filter = string.Format("{0} (*.zip)|*.zip|{1} (*.txt)|*.txt|{2} (*.txt)|*.txt", ModLoaderText.ModMenuSaveAs_ModCrate, ModLoaderText.ModMenuSaveAs_SettingFile, ModLoaderText.ModMenuSaveAs_SettingFileFull); saveFileDialog1.FileName = ""; bool HasChanged = false; foreach (ModPropertyBase prop in mod.Props) { if (prop.HasChanged) { HasChanged = true; break; } } if (!HasChanged) { MessageBox.Show(ModLoaderText.ModMenuSaveAs_NoSettingsChanged); return; } if (saveFileDialog1.ShowDialog() == DialogResult.OK) { if (saveFileDialog1.FilterIndex == 1) { ModCrateMakerForm modMenu = new ModCrateMakerForm(mod, Game, saveFileDialog1.FileName); modMenu.Owner = this; modMenu.Show(); } else if (saveFileDialog1.FilterIndex == 2) { ModCrates.SaveSettingsToFile(mod, saveFileDialog1.FileName, false); } else if (saveFileDialog1.FilterIndex == 3) { ModCrates.SaveSettingsToFile(mod, saveFileDialog1.FileName, true); } } }
public void EditGame() { //To make sure the seed matches ModLoaderGlobals.RandomizerSeed = RandomizerSeedBase; if (Modder != null && Modder.ModCrateRegionCheck) { ModCrates.VerifyModCrates(SupportedMods, Game.ShortName, Modder.GameRegion); } ModCrates.InstallLayerMods(SupportedMods, Pipeline.ExtractedPath, 0); if (Modder != null) { Modder.EnabledModCrates = new List <ModCrate>(); foreach (ModCrate Mod in SupportedMods) { if (Mod.IsActivated) { Modder.EnabledModCrates.Add(Mod); } } ModCrates.InstallCrateSettings(SupportedMods, Modder); Modder.StartModProcess(); } }
private void button_save_Click(object sender, EventArgs e) { ModCrates.SaveSimpleCrateToFile(mod, path, crate); Close(); }