private void BrowseExample(object sender, RoutedEventArgs e) { var file = FFS.RequestDir(); if (file != "") { ExampleSwap.Text = file; } }
private void Butt_Extract_Click(object sender, RoutedEventArgs e) { if (DirBox.SelectedItem == null) { Debug.WriteLine("No item, so no extract"); return; } var item = (string)DirBox.SelectedItem; Debug.WriteLine($"Item: {item}"); if (item == "" || qstr.Suffixed(item, "/")) { Debug.WriteLine("Item is directory, so no extract"); return; } var xas = FFS.RequestFile(true); if (xas == "") { return; } var ix = qstr.ExtractExt(item).ToLower(); var ex = qstr.ExtractExt(xas).ToLower(); if (ix != ex) { switch (Confirm.YNC($"Original extention is \"{ix}\", and given extension is \"{ex}\". This does not match. Add this extension?")) { case -1: return; case 0: break; case 1: xas += $".{ix}"; break; default: throw new Exception("Invalid output from Confirm.YNC"); } } if (Core.IN_Resource) { try { var data = Core.JCR.JCR_B($"{Core.CDirectory}/{item}"); if (data == null) { throw new Exception($"Unable to get data!\nJCR6 reported: {JCR6.JERROR}"); } QuickStream.SaveBytes(xas, data); } catch (Exception E) { Confirm.Annoy(E.Message, "Error!", System.Windows.Forms.MessageBoxIcon.Error); } } else { try { File.Copy($"{Core.CDirectory}/{item}", xas, true); } catch (Exception E) { Confirm.Annoy(E.Message, "Error!", System.Windows.Forms.MessageBoxIcon.Error); } } }
static Core() { MKL.Lic("Stach - Core.cs", "GNU General Public License 3"); MKL.Version("Stach - Core.cs", "21.03.09"); FFS.Hello(); Debug.WriteLine($"Running on {Platform}"); Dirry.InitAltDrives(); Config = GINIE.FromFile($"{Dirry.C("$AppSupport$/Stach.ini")}"); Config.AutoSaveSource = $"{Dirry.C("$AppSupport$/Stach.ini")}"; JCR6_lzma.Init(); JCR6_jxsrcca.Init(); JCR6_zlib.Init(); new JCR_QuakePack(); new JCR_a(); new JCR_QuickLink(); JCR_JCR5.Init(); new JCR6_WAD(); new JCR_WestwoodPAK(); }