private void ACMDMain_Load(object sender, EventArgs e) { Runtime.LogMessage("Checking for external event dictionary.."); if (File.Exists(Path.Combine(Application.StartupPath, "Events.cfg"))) { Runtime.LogMessage("Event dictionary found, applying overrides.."); Runtime.LogMessage("============================================"); Action <object, DoWorkEventArgs> work = (object snd, DoWorkEventArgs arg) => { ACMD_INFO.OverrideInfo(Path.Combine(Application.StartupPath, "Events.cfg")); }; Action <object, RunWorkerCompletedEventArgs> workDone = (object snd, RunWorkerCompletedEventArgs arg) => { Runtime.LogMessage("============================================\n"); Runtime.LogMessage("Done."); }; using (BackgroundWorker wrk = new BackgroundWorker()) { wrk.DoWork += new DoWorkEventHandler(work); wrk.RunWorkerCompleted += new RunWorkerCompletedEventHandler(workDone); wrk.RunWorkerAsync(); } } }
static void Main(string[] args) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Console.WriteLine($"\n> FITD v0.77 - Smash 4 Fighter Decompiler\n" + "> Licensed under the MIT License\n" + "> Copyright(c) 2016 Sammi Husky\n"); string target = ""; string motion = ""; string output = "output"; string events = ""; if (args.Length == 0) { print_help(); return; } for (int i = 0; i < args.Length; i++) { var str = args[i]; if (str.StartsWith("-")) { switch (str) { case "-m": if (i + 1 < args.Length) { motion = args[++i]; } break; case "-o": if (i + 1 < args.Length) { output = args[++i]; } break; case "-h": case "--help": print_help(); return; case "-e": if (i + 1 < args.Length) { events = args[++i]; } break; } } else if (str.EndsWith(".mtable")) { target = str; } else if (str.EndsWith(".mscsb")) { target = str; } } if (!string.IsNullOrWhiteSpace(events)) { ACMD_INFO.OverrideInfo(events); } if (!string.IsNullOrEmpty(target) && target.EndsWith(".mtable")) { decompile_acmd(target, motion, output); } else if (!string.IsNullOrEmpty(target) && target.EndsWith(".mscsb")) { decompile_msc(target, output); } Console.WriteLine("> All tasks finished"); }