Example #1
0
        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());
        }
Example #2
0
        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;
 }
Example #4
0
 public GameEntry(PresenceApp app) : this()
 {
     _app         = app;
     Configurator = app.Configurator;
 }
Example #5
0
 public Dota2PresenceProvider(PresenceApp app) : base(app)
 {
 }
Example #6
0
        // 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)
        {
        }
Example #7
0
 public GlobalOffensivePresenceProvider(PresenceApp app) : base(app)
 {
 }