public ModRow(SmashProjectManager a_smashProjectManager, bool a_isActiveList, ModsList.ModListType a_modListType) { InitializeComponent(); _SmashProjectManager = a_smashProjectManager; _IsActiveList = a_isActiveList; _ModListType = a_modListType; switch (_ModListType) { case (ModsList.ModListType.CharacterSlots): case (ModsList.ModListType.CharacterGeneral): EventManager.OnCharSlotModSelectionChanged += OnModSelectionChanged; EventManager.OnCharGeneralModSelectionChanged += OnModSelectionChanged; break; case (ModsList.ModListType.Stage): EventManager.OnStageModSelectionChanged += OnModSelectionChanged; break; case (ModsList.ModListType.General): EventManager.OnMiscModSelectionChanged += OnModSelectionChanged; break; } }
public ModProperties(string modPath, ModsList.ModListType modListType, string charName = "") { InitializeComponent(); ModPath = modPath; ModListType = modListType; CharName = charName; PathKami = ModPath + Path.DirectorySeparatorChar + "kamimod.xml"; switch (ModListType) { case ModsList.ModListType.CharacterGeneral: XMLDataCharGeneral = Utils.DeserializeXML <CharacterGeneralModXML>(PathKami); if (XMLDataCharGeneral == null) { return; } XMLDataCharGeneral.isDirty = false; textBoxDisplayName.Text = XMLDataCharGeneral.DisplayName; checkBoxWifiSafe.Checked = XMLDataCharGeneral.WifiSafe; if (XMLDataCharGeneral.Notes == null) { XMLDataCharGeneral.Notes = String.Empty; } textBoxNotes.Text = XMLDataCharGeneral.Notes.Replace("\n", "\r\n"); groupBoxPortaits.Visible = false; groupBoxStageData.Visible = false; this.Height -= groupBoxPortaits.Height + groupBoxStageData.Height; break; case ModsList.ModListType.Stage: XMLDataStage = Utils.DeserializeXML <StageModXML>(PathKami); if (XMLDataStage == null) { return; } XMLDataStage.isDirty = false; textBoxDisplayName.Text = XMLDataStage.DisplayName; checkBoxWifiSafe.Checked = XMLDataStage.WifiSafe; if (XMLDataStage.Notes == null) { XMLDataStage.Notes = String.Empty; } textBoxNotes.Text = XMLDataStage.Notes.Replace("\n", "\r\n"); for (int i = 0; i < DB.StagesDB.Stages.Count; ++i) { if (DB.StagesDB.Stages[i].ID == XMLDataStage.IntendedStage) { labelStageName.Text = DB.StagesDB.Stages[i].LabelHuman; } } PathStage10 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stage_10_XX.nut"; PathStage11 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stage_11_XX.nut"; PathStage12 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stage_12_XX.nut"; PathStage13 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stage_13_XX.nut"; PathStage30 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stage_30_XX.nut"; PathStagen10 = ModPath + Path.DirectorySeparatorChar + "ui" + Path.DirectorySeparatorChar + "stagen_10_XX.nut"; XMLDataStage.stage_10 = File.Exists(PathStage10); XMLDataStage.stage_11 = File.Exists(PathStage11); XMLDataStage.stage_12 = File.Exists(PathStage12); XMLDataStage.stage_13 = File.Exists(PathStage13); XMLDataStage.stage_30 = File.Exists(PathStage30); XMLDataStage.stagen_10 = File.Exists(PathStagen10); buttonExport_stage10.Enabled = XMLDataStage.stage_10; buttonExport_stage11.Enabled = XMLDataStage.stage_11; buttonExport_stage12.Enabled = XMLDataStage.stage_12; buttonExport_stage13.Enabled = XMLDataStage.stage_13; buttonExport_stage30.Enabled = XMLDataStage.stage_30; buttonExport_stagen10.Enabled = XMLDataStage.stagen_10; if (XMLDataStage.stage_10) { pictureBox_stage10.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStage10); UpdatePictureBoxClickable(pictureBox_stage10); } if (XMLDataStage.stage_11) { pictureBox_stage11.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStage11); UpdatePictureBoxClickable(pictureBox_stage11); } if (XMLDataStage.stage_12) { pictureBox_stage12.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStage12); UpdatePictureBoxClickable(pictureBox_stage12); } if (XMLDataStage.stage_13) { pictureBox_stage13.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStage13); UpdatePictureBoxClickable(pictureBox_stage13); } if (XMLDataStage.stage_30) { pictureBox_stage30.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStage30); UpdatePictureBoxClickable(pictureBox_stage30); } if (XMLDataStage.stagen_10) { pictureBox_stagen10.BackgroundImage = FileTypes.NUT.BitmapFromPortraitNut(PathStagen10, true); UpdatePictureBoxClickable(pictureBox_stagen10); } break; case ModsList.ModListType.General: XMLDataGeneral = Utils.DeserializeXML <GeneralModXML>(PathKami); if (XMLDataGeneral == null) { return; } XMLDataGeneral.isDirty = false; textBoxDisplayName.Text = XMLDataGeneral.DisplayName; checkBoxWifiSafe.Checked = XMLDataGeneral.WifiSafe; if (XMLDataGeneral.Notes == null) { XMLDataGeneral.Notes = String.Empty; } textBoxNotes.Text = XMLDataGeneral.Notes.Replace("\n", "\r\n"); groupBoxPortaits.Visible = false; groupBoxStageData.Visible = false; this.Height -= groupBoxPortaits.Height + groupBoxStageData.Height; break; } IsInitialized = true; }