Exemple #1
0
        public static void LoadModList(ModsViewModel ModsVM)
        {
            var modListXml = (new WebClient()).DownloadString("https://raw.githubusercontent.com/StarOfDoom/MelvorIdleModAssistant/main/MelvorIdleModAssistant/ModList.xml");

            ModList = XmlModel.XmlDeserializeFromString <List <Mod> >(modListXml);

            ModsVM.OnPropertyChanged("ModList");
        }
Exemple #2
0
        public static void SaveSettings(Settings settings)
        {
            EnsureDataDirectoryExists();

            string settingsXML = XmlModel.XmlSerializeToString(settings);

            File.WriteAllText(SettingsFile, settingsXML);
        }
Exemple #3
0
        public static Settings LoadSettings()
        {
            if (File.Exists(SettingsFile))
            {
                string settingsXML = File.ReadAllText(SettingsFile);
                return(XmlModel.XmlDeserializeFromString <Settings>(settingsXML));
            }

            return(new Settings());
        }
Exemple #4
0
        public static void CreateModListFile()
        {
            List <Mod> NewModList = new List <Mod> {
                new Mod("Melvor-ETA", "Displays estimated times for skills", "GMiclotte", "https://github.com/gmiclotte/Melvor-ETA", Mod.ModCategories.Utility, "0.18.2", "time-remaining.js"),
                new Mod("XP/h", "Displays XP/h for farming and combat", "Visua#9999", "https://greasyfork.org/scripts/409902-melvor-idle-xp-h/code/Melvor%20Idle%20-%20XPh.user.js", Mod.ModCategories.Utility, "0.18.2", "Melvor%20Idle%20-%20XPh.user.js"),
                new Mod("Combat Simulator Reloaded", "Simulates combat", "GMiclotte", "https://github.com/visua0/Melvor-Idle-Combat-Simulator-Reloaded", Mod.ModCategories.Utility, "0.18.2", "Extension\\Sources\\contentScript.js", new List <string> {
                    @"$(document.head).append(`<link rel=""stylesheet"" href=""${chrome.runtime.getURL('styles/mainStyle.css')}\"">`)"
                }),
            };

            string modListXML = XmlModel.XmlSerializeToString(NewModList);

            File.WriteAllText(@".\ModList.xml", modListXML);
        }