private void loadFiles(string gameDir, bool silent = false) { if (File.Exists($@"{gameDir}\DARKSOULS.exe")) { remastered = false; } else if (File.Exists($@"{gameDir}\DarkSoulsRemastered.exe")) { remastered = true; } else { ShowError($"Dark Souls executable not found in directory:\n{gameDir}", silent); return; } TPF menuTPF; string tpfPath = $"{gameDir}{TPF_PATH}{(remastered ? ".dcx" : "")}"; try { menuTPF = TPF.Read(tpfPath); } catch (Exception ex) { ShowError($"Failed to read TPF:\n{tpfPath}\n\n{ex}", silent); return; } DRB menuDRB; string drbPath = $"{gameDir}{DRB_PATH}{(remastered ? ".dcx" : "")}"; try { menuDRB = DRB.Read(drbPath, remastered); } catch (Exception ex) { ShowError($"Failed to read DRB:\n{drbPath}{ex}", silent); return; } fillDataGridView(menuTPF, menuDRB); enableControls(true); }
private void OpenDRB(string path, bool dsr, bool silent = false) { try { Drb = DRB.Read(path, dsr); DrbPath = path; Dsr = dsr; statusStripLblPath.Text = $"[{(dsr ? "DSR" : "PTDE")}] {path}"; lbxDlgs.Enabled = Drb.Dlgs.Count > 0; lbxDlgs.ClearSelected(); lbxDlgs.DisplayMember = "Name"; lbxDlgos.ClearSelected(); lbxDlgos.DisplayMember = "Name"; lbxDlgs.DataSource = Drb.Dlgs; saveToolStripMenuItem.Enabled = true; texturesToolStripMenuItem.Enabled = true; TextureForm?.SetTextures(Drb.Textures); } catch (Exception ex) { ShowError($"Failed to open DRB:\n{path}\n\n{ex}", silent); } }