Exemple #1
0
        public static void Load()
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, Global.SETTINGS_FILEPATH);

            iniFile = new INIFile(path);
            if (!File.Exists(path))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(path));
                Init();
                Save();
            }
            else
            {
                Crack = iniFile.ReadValue("crack", "crack") == "1";
                StartupShowMainForm = iniFile.ReadValue("startup", "show") != "0";
                ShowOverlay         = iniFile.ReadValue("overlay", "show") != "0";
                AutoOverlayHide     = iniFile.ReadValue("overlay", "autohide") != "0";
                OverlayX            = int.Parse(iniFile.ReadValue("overlay", "x") ?? "0");
                OverlayY            = int.Parse(iniFile.ReadValue("overlay", "y") ?? "0");
                FlashWindow         = iniFile.ReadValue("notification", "flashwindow") != "0";
                CheatRoulette       = iniFile.ReadValue("misc", "cheatroulette") == "1";
                RouletteTips        = iniFile.ReadValue("misc", "roulettetips") != "0";
                Language            = iniFile.ReadValue("misc", "language") ?? "zh-cn";
                dfaUpdate           = iniFile.ReadValue("update", "dfaupdate") ?? "1";
                dataUpdate          = iniFile.ReadValue("update", "dataupdate") ?? "1";
                CheckBeta           = iniFile.ReadValue("update", "checkbeta") == "1";
                Updated             = iniFile.ReadValue("internal", "updated") != "0";
                PlaySound           = iniFile.ReadValue("notification", "playsound") == "1";
                TTS            = iniFile.ReadValue("notification", "tts") == "1";
                TTSCache       = iniFile.ReadValue("notification", "ttscache") ?? "1";
                TTSSpeed       = iniFile.ReadValue("notification", "ttsspeed") ?? "4";
                DebugLog       = iniFile.ReadValue("dev", "debuglog") == "1";
                NetFilter      = iniFile.ReadValue("dev", "netfilter") == "1";
                SoundLocation  = iniFile.ReadValue("notification", "soundlocation") ?? "";
                TrackerEnabled = iniFile.ReadValue("tracker", "trackerenabled") != "0";
                TrackerMirror  = iniFile.ReadValue("tracker", "trackermirror") ?? "cn";
                AutoTracker    = iniFile.ReadValue("tracker", "autotracker") != "0";
                NodeVersion    = int.Parse(iniFile.ReadValue("dll", "node") ?? "0");

                var fates = iniFile.ReadValue("fate", "fates");
                if (!string.IsNullOrEmpty(fates))
                {
                    FATEs = new HashSet <int>(from x in fates.Split(',') select int.Parse(x));
                }
            }
        }
Exemple #2
0
        public static void Load()
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, Global.SETTINGS_FILEPATH);

            iniFile = new INIFile(path);
            if (!File.Exists(path))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(path));
                Init();
                Save();
            }
            else
            {
                StartupShowMainForm        = iniFile.ReadValue("startup", "show") == "1";
                ShowOverlay                = iniFile.ReadValue("overlay", "show") != "0";
                OverlayX                   = int.Parse(iniFile.ReadValue("overlay", "x") ?? "0");
                OverlayY                   = int.Parse(iniFile.ReadValue("overlay", "y") ?? "0");
                autoHideOverlay            = iniFile.ReadValue("overlay", "autohideoverlay") == "1";
                FlashWindow                = iniFile.ReadValue("notification", "flashwindow") == "1";
                FateSound                  = iniFile.ReadValue("notification", "fatesound") == "1";
                CustomSound                = iniFile.ReadValue("notification", "customsound") == "1";
                CustomSoundPath            = iniFile.ReadValue("notification", "customsoundpath") ?? "";
                TelegramEnabled            = iniFile.ReadValue("notification", "telegram") == "1";
                TelegramQueueStatusEnabled = iniFile.ReadValue("notification", "telegramqueuestatus") == "1";
                TelegramChatId             = iniFile.ReadValue("notification", "telegramchatid") ?? "";
                DiscordEnabled             = iniFile.ReadValue("notification", "discord") == "1";
                DiscordAccount             = iniFile.ReadValue("notification", "discordaccount") ?? "";
                useVPN               = iniFile.ReadValue("misc", "useVPN") == "1";
                CheatRoulette        = iniFile.ReadValue("misc", "cheatroulette") == "1";
                copyMacro            = iniFile.ReadValue("misc", "copymacro") == "1";
                Language             = iniFile.ReadValue("misc", "language") ?? "ko-kr";
                Updated              = iniFile.ReadValue("internal", "updated") == "1";
                customHttpRequest    = iniFile.ReadValue("http", "customHttpRequest") == "1";
                customHttpUrl        = iniFile.ReadValue("http", "customHttpUrl") ?? "";
                requestOnDutyMatched = iniFile.ReadValue("http", "requestOnDutyMatched") == "1";
                requestOnFateOccured = iniFile.ReadValue("http", "requestOnFateOccured") == "1";
                debugLog             = iniFile.ReadValue("dev", "debuglog") == "1";

                var fates = iniFile.ReadValue("fate", "fates");
                if (!string.IsNullOrEmpty(fates))
                {
                    FATEs = new HashSet <int>(from x in fates.Split(',') select int.Parse(x));
                }
            }
        }
Exemple #3
0
        public static void Load()
        {
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Global.APPNAME, Global.SETTINGS_FILEPATH);

            iniFile = new INIFile(path);
            if (!File.Exists(path))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(path));
                Init();
                Save();
            }
            else
            {
                StartupShowMainForm = iniFile.ReadValue("startup", "show") != "0";
                ShowOverlay         = iniFile.ReadValue("overlay", "show") != "0";
                AutoOverlayHide     = iniFile.ReadValue("overlay", "autohide") != "0";
                OverlayX            = int.Parse(iniFile.ReadValue("overlay", "x") ?? "0");
                OverlayY            = int.Parse(iniFile.ReadValue("overlay", "y") ?? "0");
                TwitterEnabled      = iniFile.ReadValue("notification", "twitter") == "1";
                TwitterAccount      = iniFile.ReadValue("notification", "twitteraccount") ?? "";
                FlashWindow         = iniFile.ReadValue("notification", "flashwindow") != "0";
                CheatRoulette       = iniFile.ReadValue("misc", "cheatroulette") == "1";
                Language            = iniFile.ReadValue("misc", "language") ?? "zh-cn";
                Updated             = iniFile.ReadValue("internal", "updated") != "0";
                PlaySound           = iniFile.ReadValue("notification", "playsound") == "1";
                TTS           = iniFile.ReadValue("notification", "tts") == "1";
                DebugLog      = iniFile.ReadValue("dev", "debuglog") == "1";
                SoundLocation = iniFile.ReadValue("notification", "soundlocation") ?? "";

                var fates = iniFile.ReadValue("fate", "fates");
                if (!string.IsNullOrEmpty(fates))
                {
                    FATEs = new HashSet <int>(from x in fates.Split(',') select int.Parse(x));
                }
            }
        }