示例#1
0
        public static void Get(int value)
        {
            if (value == 0)
            {
                ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "RU");

                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/sKUKqp3W3XgcFP"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "GameLangRu.zip", "scripts\\ru", "LangRu",
                    "scripts\\ru\\globalru.res", "scripts\\ru\\global.res");
            }
            else if (value == 1)
            {
                ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "US");

                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/1sni8lWA3XgcFo"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "GameLangUs.zip", "scripts\\us", "LangUs",
                    "scripts\\us\\globalus.res", "scripts\\us\\global.res");
            }
            else if (value == 2)
            {
                ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "DE");

                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/ekWsMxz13XgcEr"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "GameLangDe.zip", "scripts\\de", "LangDe",
                    "scripts\\de\\globalde.res", "scripts\\de\\global.res");
            }
            else if (value == 3)
            {
                ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "SP");

                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/5n-Vslep3XgcFb"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "GameLangSp.zip", "scripts\\sp", "LangSp",
                    "scripts\\sp\\globalsp.res", "scripts\\sp\\global.res");
            }
            else if (value == 4)
            {
                ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "FR");

                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/2XGSFLVL3XgcF5"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "GameLangFr.zip", "scripts\\fr", "LangFr",
                    "scripts\\fr\\globalfr.res", "scripts\\fr\\global.res");
            }
        }
示例#2
0
        private void Sacred229PathBtn_Click(object sender, RoutedEventArgs e)
        {
            if (ModifySettings.ModificationSettings.SacredUnofficialPatchInstalled)
            {
                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/WbF1fYcOViNghQ"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "SacredPatched228.zip", Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName),
                    "2.28.01 Patch", "SacredPatched228.exe", Settings.SacredExecutableFileName);

                string[] text = File.ReadAllLines(Settings.SacredConfigurationFile, Encoding.ASCII);

                string prefix = "LANGUAGE : ";

                string line = text.FirstOrDefault(x => x.StartsWith(prefix));

                if (line == null)
                {
                    switch (MainWindow.ChatStgOne.UiLanguageCmbBox.SelectedIndex)
                    {
                    case 0: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "RU"); break;

                    case 1: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "US"); break;

                    case 2: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "DE"); break;

                    case 3: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "SP"); break;

                    case 4: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "FR"); break;
                    }
                }

                Sacred229PathBtn.SetResourceReference(ContentProperty, "String0090");

                ModifySettings.ModificationSettings.SacredUnofficialPatchInstalled = false;
            }
            else
            {
                GetSacredGameComponentFiles.GetComponent(
                    new Uri("https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/P-gzohuQ3XgkfQ"),
                    Environment.ExpandEnvironmentVariables("%tmp%"),
                    "SacredPatched22914.zip", Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName),
                    "2.29.14 Patch", "SacredPatched22914.exe", Settings.SacredExecutableFileName);

                string[] text = File.ReadAllLines(Settings.SacredConfigurationFile, Encoding.ASCII);

                string prefix = "LANGUAGE : ";

                string line = text.FirstOrDefault(x => x.StartsWith(prefix));

                if (line == null)
                {
                    switch (MainWindow.ChatStgOne.UiLanguageCmbBox.SelectedIndex)
                    {
                    case 0: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "RU"); break;

                    case 1: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "US"); break;

                    case 2: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "DE"); break;

                    case 3: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "SP"); break;

                    case 4: ChangeSacredGameSettingsValue.ChangeSettingValue("LANGUAGE", "FR"); break;
                    }
                }

                Sacred229PathBtn.SetResourceReference(ContentProperty, "String0091");

                ModifySettings.ModificationSettings.SacredUnofficialPatchInstalled = true;
            }
        }