using UnityEngine; using System.Diagnostics; using System; namespace NeonTea.Quakeball.Interface { public class OptionsCommand : MonoBehaviour { private void Awake() { Terminal Terminal = Terminal.Singleton; Terminal.RegisterCommand("options", args => { if (args.Length == 0) { return false; } switch (args[0]) { case "explore": Process.Start("explorer.exe", Options.GetDirectory()); return true; case "save": try { Options.Save(Options.Get()); return true; } catch (Exception ex) { Terminal.Println($"{ex.ToString()}"); return false; } case "load": try { OptionsData Opts = Options.Load(true); if (Opts != null) { Options.Set(Opts); return true; } else { Terminal.Println($"No saved configuration on disk."); return false; } } catch (Exception ex) { Terminal.Println($"{ex.ToString()}"); return false; } default: return false; } }, "\n options explore - Opens the configuration directory in explorer.exe.\n options save - Saves the current configuration on disk.\n options load - Loads the configuration from disk."); } } }