Skip to content

Commit

Permalink
UI Overhault
Browse files Browse the repository at this point in the history
These were some changes to UI I've done a few months ago. I don't have time to work on this project right now but I decided to upload these changes anyway with a few features commented out,. you can compile and try them  for yourself if you want to.

- Main UI changed
- Search and Categories for mods
- Login through Steam (Disabled, not finished)
- Settings Page (Disabled, not even close to be done)
- Get mods Images from folders and zip files (Disabled due to badly optimized and not async right now)
  • Loading branch information
Xferno2 committed Oct 12, 2021
1 parent 5fbefd4 commit 17bcea4
Show file tree
Hide file tree
Showing 51 changed files with 2,321 additions and 882 deletions.
Binary file added Hoi4 Launcher/Firefox/AccessibleMarshal.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/breakpadinjector.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/d3dcompiler_47.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/freebl3.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/icudt58.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/icuin58.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/icuuc58.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/lgpllibs.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/libEGL.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/libGLESv2.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/mozglue.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/nss3.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/nssckbi.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/nssdbm3.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/omni.ja
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/plugin-container.exe
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/plugin-hang-ui.exe
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/sandboxbroker.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/softokn3.dll
Binary file not shown.
Binary file added Hoi4 Launcher/Firefox/xul.dll
Binary file not shown.
383 changes: 294 additions & 89 deletions Hoi4 Launcher/Form1.Designer.cs

Large diffs are not rendered by default.

420 changes: 347 additions & 73 deletions Hoi4 Launcher/Form1.cs

Large diffs are not rendered by default.

672 changes: 1 addition & 671 deletions Hoi4 Launcher/Form1.resx

Large diffs are not rendered by default.

124 changes: 122 additions & 2 deletions Hoi4 Launcher/Hoi4 Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -22,6 +39,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -31,16 +49,35 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>preview</LangVersion>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>hoi4.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Dragablz, Version=0.0.3.223, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Dragablz.0.0.3.223\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="Geckofx-Core, Version=45.0.34.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
<HintPath>..\packages\Geckofx45.45.0.34\lib\net45\Geckofx-Core.dll</HintPath>
</Reference>
<Reference Include="Geckofx-Winforms, Version=45.0.34.0, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
<HintPath>..\packages\Geckofx45.45.0.34\lib\net45\Geckofx-Winforms.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.11.34.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.11.34\lib\Net45\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="MetroSet UI, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MetroSet_UI.2.0.0\lib\net45\MetroSet UI.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -66,13 +103,35 @@
<Compile Include="Parser\dlcParser.cs" />
<Compile Include="Parser\modParser.cs" />
<Compile Include="Parser\Parser.cs" />
<Compile Include="Parser\SteamHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Utility\CustomTabControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Utility\Settings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Utility\Settings.Designer.cs">
<DependentUpon>Settings.cs</DependentUpon>
</Compile>
<Compile Include="Utility\SteamLink.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Utility\SteamLink.Designer.cs">
<DependentUpon>SteamLink.cs</DependentUpon>
</Compile>
<Compile Include="Utility\TransparentCLB.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Utility\TransparentDVG.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Utility\Utility.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
Expand All @@ -82,6 +141,19 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Utility\CustomTabControl.resx">
<DependentUpon>CustomTabControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Utility\Settings.resx">
<DependentUpon>Settings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Utility\SteamLink.resx">
<DependentUpon>SteamLink.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Utility\TransparentDVG.resx">
<DependentUpon>TransparentDVG.cs</DependentUpon>
</EmbeddedResource>
<None Include="Firefox\omni.ja" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand All @@ -103,15 +175,63 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Firefox\AccessibleMarshal.dll" />
<Content Include="Firefox\breakpadinjector.dll" />
<Content Include="Firefox\d3dcompiler_47.dll" />
<Content Include="Firefox\freebl3.dll" />
<Content Include="Firefox\icudt58.dll" />
<Content Include="Firefox\icuin58.dll" />
<Content Include="Firefox\icuuc58.dll" />
<Content Include="Firefox\lgpllibs.dll" />
<Content Include="Firefox\libEGL.dll" />
<Content Include="Firefox\libGLESv2.dll" />
<Content Include="Firefox\mozglue.dll" />
<Content Include="Firefox\nss3.dll" />
<Content Include="Firefox\nssckbi.dll" />
<Content Include="Firefox\nssdbm3.dll" />
<Content Include="Firefox\plugin-container.exe" />
<Content Include="Firefox\plugin-hang-ui.exe" />
<Content Include="Firefox\sandboxbroker.dll" />
<Content Include="Firefox\softokn3.dll" />
<Content Include="Firefox\xul.dll" />
<Content Include="hoi4.ico" />
<Content Include="MetroFramework.txt" />
<Content Include="Resources\3rdparty.png" />
<Content Include="Resources\background.png" />
<Content Include="Resources\button.png" />
<Content Include="Resources\button_Mod.png" />
<None Include="Resources\steam disabled.png" />
<None Include="Resources\degrade.png" />
<None Include="Resources\degrade2.png" />
<Content Include="Resources\hoi4.ico" />
<None Include="Resources\steam normal.png" />
<None Include="Resources\steam hover.png" />
<None Include="Resources\steam click.png" />
<None Include="Resources\listBG.png" />
<Content Include="Resources\play.png" />
<Content Include="Resources\play_click.png" />
<Content Include="Resources\play_hover.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets'))" />
<Error Condition="!Exists('..\packages\Geckofx45.45.0.34\build\Geckofx45.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Geckofx45.45.0.34\build\Geckofx45.targets'))" />
</Target>
<Import Project="..\packages\Geckofx45.45.0.34\build\Geckofx45.targets" Condition="Exists('..\packages\Geckofx45.45.0.34\build\Geckofx45.targets')" />
</Project>
25 changes: 25 additions & 0 deletions Hoi4 Launcher/MetroFramework.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
MetroFramework - Modern UI for WinForms

Copyright (c) 2013 Jens Thiel, http://thielj.github.io/MetroFramework

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Portions of this software are:

Copyright (c) 2011 Sven Walter, http://github.com/viperneo
4 changes: 4 additions & 0 deletions Hoi4 Launcher/Model/newModInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -14,5 +15,8 @@ public class newModInfo
public List<string> tags { get; set; }
public string supported_version { get; set; }
public string remote_fileid { get; set; }
public string dirPath { get; set; }
public bool isPath { get; set; }
public Image picture { get; set; }
}
}
62 changes: 62 additions & 0 deletions Hoi4 Launcher/Parser/SteamHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Gecko;
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Timer = System.Timers.Timer;

namespace Hoi4_Launcher.Parser
{
public class SteamHandler
{
public string steamLogin = "https://store.steampowered.com/login/";
public string steamStore = "https://store.steampowered.com/";
public string[] steamMods = { "https://steamcommunity.com/id/", "/myworkshopfiles/?appid=394360&browsefilter=mysubscriptions", "&p=" };
public bool isAuthentificated = false;
public List<string> userAndID = new List<string>();

Timer browserCheck = new Timer(100);
public bool checkIfAuthentificated(string url)
{
if (url == steamStore)
{ return true; }
else { return false; }
}
public void getUser(GeckoWebBrowser browser)
{
HtmlDocument content = new HtmlDocument();
content.LoadHtml(browser.Document.Body.OuterHtml);
if (content.DocumentNode.OuterHtml != null)
{
HtmlNode contentNode = content.DocumentNode.SelectSingleNode("//div[contains(@class,'playerAvatar')]");
string id = contentNode.ChildNodes[1].Attributes["href"].Value;
string user = id.Split('/')[4];
userAndID.Add(id);
userAndID.Add(user);
}
}
public Dictionary<string, Image> getModsImages(GeckoWebBrowser browser)
{
Dictionary<string, Image> modsIMG = new Dictionary<string, Image>();
var steamModsUrl = steamMods[0] + userAndID.Last() + steamMods[1];
browser.Navigate(steamModsUrl);
while (browser.IsBusy) {
};
HtmlDocument content = new HtmlDocument();
content.LoadHtml(browser.Document.Body.OuterHtml);
if (content.DocumentNode.OuterHtml != null)
{
HtmlNode contentNode = content.DocumentNode.SelectSingleNode("//div[contains(@class,'workshopBrowsePagingControls')]");
string lastEntri = contentNode.ChildNodes[contentNode.ChildNodes.Count - 2].InnerText;
}
return modsIMG;
}
}
}
70 changes: 70 additions & 0 deletions Hoi4 Launcher/Properties/Resources.Designer.cs

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

Loading

0 comments on commit 17bcea4

Please sign in to comment.