public static void SavePreferences(PresenceApp app, Preferences newPrefs) { var prefPath = $"{Path.GetDirectoryName(Application.ExecutablePath)}\\preferences"; Directory.CreateDirectory(prefPath); var path = $"{prefPath}\\{MakeValidFileName(app.AppName)}"; File.WriteAllText(path, newPrefs.Serialize()); }
public static Preferences LoadPreferences(PresenceApp app) { var path = $"{Path.GetDirectoryName(Application.ExecutablePath)}\\preferences\\{MakeValidFileName(app.AppName)}"; if (File.Exists(path)) { var data = File.ReadAllText(path); return(Preferences.Deserialize(data, app.Customizer)); } else { return(app.Customizer.Default.DeepClone()); } }
public PreferencesEditor(PresenceApp app, Preferences preferences) : this() { Preferences = preferences; App = app; }
public GameEntry(PresenceApp app) : this() { _app = app; Configurator = app.Configurator; }
public Dota2PresenceProvider(PresenceApp app) : base(app) { }
// TODO: Quitting during a game doesn't leave a 'complete' tag, so when you relaunch the provider thinks you're in that game still // Could be fixed by only reading logs *after* the point at which you started (use timestamps cos line no's could change), or just deleting logs (bad) public HearthstonePresenceProvider(PresenceApp app) : base(app) { }
public GlobalOffensivePresenceProvider(PresenceApp app) : base(app) { }