private void btnImportDefaults_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("This will clear the current list and load the file from the LifePlay modules folder.\n\nContinue?", "Clear current list?", MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.No) { return; } if (m_EditWhat == EditorType.editNames) { nameLists.clearLists(); bool success = nameLists.readLPNameLists(); if (success) { txtFemale.Text = nameLists.getFemaleList(); txtMale.Text = nameLists.getMaleList(); } } else { clothLists.clearLists(); bool success = clothLists.readLPClothList(); if (success) { txtFemale.Text = clothLists.getFemaleList(); txtMale.Text = clothLists.getMaleList(); } } }
public frmEditList(EditorType t, string gamePath) { InitializeComponent(); m_EditWhat = t; m_sPath = gamePath; switch (m_EditWhat) { case EditorType.editNames: nameLists = new CNameLists(m_sPath); bool success = nameLists.loadNameLists(); if (!success) { success = nameLists.readLPNameLists(); } if (success) { txtFemale.Text = nameLists.getFemaleList(); txtMale.Text = nameLists.getMaleList(); } break; case EditorType.editClothesWork: case EditorType.editClothesSport: case EditorType.editClothesCasual: lblLeft.Text = "Male clothing"; lblRight.Text = "Female clothing"; CClothLists.ClothType ct = CClothLists.ClothType.ctCasual; switch (t) { case EditorType.editClothesSport: ct = CClothLists.ClothType.ctSport; break; case EditorType.editClothesWork: ct = CClothLists.ClothType.ctWork; break; } clothLists = new CClothLists(m_sPath, ct); bool successCl = clothLists.loadClothList(); if (!successCl) { successCl = clothLists.readLPClothList(); } if (successCl) { txtFemale.Text = clothLists.getFemaleList(); txtMale.Text = clothLists.getMaleList(); } break; } }