Skip to content

Commit

Permalink
Реализовал загрузку и установку стандартного конфига
Browse files Browse the repository at this point in the history
  • Loading branch information
PROPHESSOR committed Oct 12, 2021
1 parent bd87522 commit c295593
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ private void Btn_run_Click(object sender, EventArgs e) {

run_InstallDrrp();

run_InstallConfig();

// status("Настройка..."); // TODO: Download GZDoom config

run_launch();
Expand Down Expand Up @@ -237,6 +239,33 @@ private void run_InstallDoom2() {
//status("doom2.wad успешно установлен!");
}

private void run_InstallConfig()
{
FileInfo gameconfig = new FileInfo(Path.Combine(config.config.folder, "Global", "config.ini"));

if (gameconfig.Exists) {
status("config.ini already exists.");
//status("doom2.wad уже установлен.");
return;
}

progressBar.Value = 0;

status("Downloading config.ini...");
//status("Скачивание doom2.wad...");

string url = "https://raw.githubusercontent.com/DRRP-Team/DRRP-Launcher/feat/simplify/config.ini";
//string url = "https://github.com/Akbar30Bill/DOOM_wads/raw/master/doom2.wad";

using (var client = new WebClient()) {
client.DownloadFile(url, gameconfig.FullName);
}

progressBar.Value = 100;
status("config.ini installed successfully!");
//status("doom2.wad успешно установлен!");
}

private void run_launch() {
progressBar.Value = 100;
Pack pack = packs[cmb_pack.SelectedItem.ToString()];
Expand Down Expand Up @@ -272,6 +301,7 @@ private void run_launch() {
string[] args = {
"-iwad", doom2wad.FullName,
"-file", drrpfilepk3.FullName,
"-config", Path.Combine(config.config.folder, "Global", "config.ini"),
"+language", cmb_language.SelectedIndex == 1 ? "ru" : "en",
in_args.Text
};
Expand Down

0 comments on commit c295593

Please sign in to comment.