Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5 from H1emu/New-GUI---ALL-CODE-IS-THE-SAME
Browse files Browse the repository at this point in the history
New-GUI
  • Loading branch information
QuentinGruber authored May 5, 2021
2 parents 44746fa + 95480df commit f9c4505
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 112 deletions.
2 changes: 1 addition & 1 deletion H1DepotDownloader/ContentDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static class ContentDownloader
private static Steam3Session.Credentials steam3Credentials;
private static CDNClientPool cdnPool;

private static string DEFAULT_DOWNLOAD_DIR = "depots";
public static string DEFAULT_DOWNLOAD_DIR = "depots";
private static string CONFIG_DIR = "DepotDownloader";
private static string STAGING_DIR = Path.Combine(CONFIG_DIR, "staging");

Expand Down
3 changes: 3 additions & 0 deletions H1DepotDownloader/H1DepotDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
<Reference Include="Costura, Version=5.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.5.3.0\lib\netstandard1.0\Costura.dll</HintPath>
</Reference>
<Reference Include="MaterialSkin, Version=2.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MaterialSkin.2.2.1.4\lib\net461\MaterialSkin.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
Expand Down
199 changes: 106 additions & 93 deletions H1DepotDownloader/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions H1DepotDownloader/MainForm.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using System;
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
Expand All @@ -13,26 +16,33 @@

namespace H1DepotDownloader
{
public partial class MainForm : Form
public partial class MainForm : MaterialForm
{

TextWriter _writer = null;

public MainForm()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
materialSkinManager.ColorScheme = new ColorScheme(Primary.Grey800, Primary.Grey900, Primary.BlueGrey500, Accent.Red100, TextShade.WHITE);
materialSkinManager.AddFormToManage(this);

_writer = new TextBoxStreamWriter(consoleLogs);
Console.SetOut(_writer);
}

private void startDownloadBtn_Click(object sender, EventArgs e)
private void startDownloadBtn_Click_1(object sender, EventArgs e)
{
if (usernameText.Text == "" || passwordText.Text == "") { MessageBox.Show("Please fill in Username AND Password fields", "H1Emu - DepotDownloader", MessageBoxButtons.OK, MessageBoxIcon.Error); return; }

directory.Text = ContentDownloader.DEFAULT_DOWNLOAD_DIR;
startDownloadBtn_ClickAsync();
}

private async Task startDownloadBtn_ClickAsync()
{

string [] args = argsText.Text.Split(' ');

try {
Expand Down Expand Up @@ -111,7 +121,7 @@ private async Task startDownloadBtn_ClickAsync()
}
}

ContentDownloader.Config.InstallDirectory = GetParameter<string>(args, "-dir");
ContentDownloader.Config.InstallDirectory = GetParameter<string> (args, "-dir");

ContentDownloader.Config.VerifyAll = HasParameter(args, "-verify-all") || HasParameter(args, "-verify_all") || HasParameter(args, "-validate");
ContentDownloader.Config.MaxServers = GetParameter<int>(args, "-max-servers", 20);
Expand Down Expand Up @@ -363,7 +373,13 @@ static List<T> GetParameterList<T>(string[] args, string param)
return list;
}

}
private void MainForm_Load(object sender, EventArgs e)
{
string localVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString().TrimEnd('0').TrimEnd('.');
this.Text = $"H1Emu - DepotDownloader - v{localVersion}";

outputLabel.Font = new Font("Roboto", 14);
}
}
}
#endregion
3 changes: 3 additions & 0 deletions H1DepotDownloader/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
4 changes: 2 additions & 2 deletions H1DepotDownloader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.3")]
[assembly: AssemblyFileVersion("1.0.3")]
Loading

0 comments on commit f9c4505

Please sign in to comment.