Skip to content

Commit

Permalink
Fixed #16 and #8
Browse files Browse the repository at this point in the history
Removed Steam link because it was incomplete.
  • Loading branch information
Xferno2 committed Jun 7, 2023
1 parent c96cb1a commit f0d92df
Show file tree
Hide file tree
Showing 39 changed files with 6,532 additions and 6,350 deletions.
16 changes: 16 additions & 0 deletions Hoi4 Launcher/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Principal.Windows" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
Expand Down
Binary file removed Hoi4 Launcher/Firefox/AccessibleMarshal.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/breakpadinjector.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/d3dcompiler_47.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/freebl3.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/icudt58.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/icuin58.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/icuuc58.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/lgpllibs.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/libEGL.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/libGLESv2.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/mozglue.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/nss3.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/nssckbi.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/nssdbm3.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/omni.ja
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/plugin-container.exe
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/plugin-hang-ui.exe
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/sandboxbroker.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/softokn3.dll
Binary file not shown.
Binary file removed Hoi4 Launcher/Firefox/xul.dll
Binary file not shown.
33 changes: 18 additions & 15 deletions Hoi4 Launcher/Form1.Designer.cs

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

109 changes: 76 additions & 33 deletions Hoi4 Launcher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
using Hoi4_Launcher.Utility;
using System.Drawing.Imaging;
using Hoi4_Launcher.Parser;
using System.Reflection;
using System.Reflection;

namespace Hoi4_Launcher
{
public partial class Form1 : MetroSet_UI.Forms.MetroSetForm
{
private static string ParadoxFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Paradox Interactive");
private static string Hoi4_Doc = Path.Combine(ParadoxFolder, "Hearts of Iron IV");
private static string Hoi4_Enb_Mods = Path.Combine(Hoi4_Doc, "dlc_load.json");
private static string Hoi4_Mods = Path.Combine(Hoi4_Doc, "mod");

private static string ParadoxFolder;
private static string Hoi4_Doc;
private static string Hoi4_Enb_Mods;
private static string Hoi4_Mods;
private static dlcModel[] dis_dlc = null;

private static List<newModInfo> globalMods;
Expand Down Expand Up @@ -52,7 +53,7 @@ public Form1(string[] args)
}
InitializeComponent();
var steamLink = new SteamLink { Dock = DockStyle.Fill, TopLevel = false };
panel2.Controls.Add(steamLink) ;
panel2.Controls.Add(steamLink);
steamLink.Show();
if (Properties.Settings.Default.generateDescriptor)
{
Expand All @@ -77,14 +78,37 @@ protected override CreateParams CreateParams
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED
// cp.Style &= ~~0x02000000; // Turn off WS_CLIPCHILDREN
// cp.Style &= ~~0x02000000; // Turn off WS_CLIPCHILDREN
return cp;
}
}


private void Form1_Load_1(object sender, EventArgs e)
{

InitializeModsTable();
InitializeSettings();

categoriesBox.DropDownStyle = ComboBoxStyle.DropDownList;
Logger("Application arguments: " + (String.IsNullOrWhiteSpace(args) ? "null" : args));
this.DoubleBuffered = true;
Util.enableDoubleBuff(tabControl1);
Util.enableDoubleBuff(tabPage1);

dlcParser dlcParser = new dlcParser();
dis_dlc = dlcParser.GetDLCs();
userControl11._3rdParty = dlcParser.is3rdParty;


loadLancherData();


updateUI.Elapsed += updateUI_DoWork;
updateUI.Start();
}

private void InitializeModsTable() {
modsTable.Columns.Add("IMG", typeof(Image));
modsTable.Columns.Add("ENABLE", typeof(bool));
modsTable.Columns.Add("NAME", typeof(string));
Expand All @@ -104,15 +128,18 @@ private void Form1_Load_1(object sender, EventArgs e)
list_mods.DefaultCellStyle.NullValue = null;
list_mods.ReadOnly = true;

//list_mods.CellBackgroundImage = Hoi4_Launcher.Properties.Resources.button_Mod;

imEmpty.Columns.Add("ph1", typeof(Nullable));
imEmpty.Columns.Add("ph2", typeof(Nullable));
imEmpty.Columns.Add("NAME", typeof(string));
imEmpty.Columns.Add("IMG", typeof(Nullable));
imEmpty.Columns.Add("ID", typeof(Nullable));
imEmpty.Columns.Add("MSG", typeof(Nullable));
imEmpty.Rows.Add(null, null, "Nothing here huh", null, null, null);
}


private void InitializeSettings() {
//Release Candidate disable settings
//Remove this when Finished
Settings settingsForm = new Settings();
Expand All @@ -121,32 +148,22 @@ private void Form1_Load_1(object sender, EventArgs e)
settingsForm.Dock = DockStyle.Fill;
panel1.Controls.Add(settingsForm);
settingsForm.Show();


panel1.AutoScroll = true;


categoriesBox.DropDownStyle = ComboBoxStyle.DropDownList;
Logger("Application arguments: " + (String.IsNullOrWhiteSpace(args) ? "null" : args));
this.DoubleBuffered = true;
Util.enableDoubleBuff(tabControl1);
Util.enableDoubleBuff(tabPage1);
dlcParser dlcParser = new dlcParser();
dis_dlc = dlcParser.GetDLCs();
userControl11._3rdParty = dlcParser.is3rdParty;
load();
updateUI.Elapsed += updateUI_DoWork;
updateUI.Start();
}

private void load()
private void loadLancherData()
{
//Load LHSetthings
string data = File.ReadAllText(@"launcher-settings.json");
gameSettings = JsonConvert.DeserializeObject<LHSettings>(data);
ParadoxFolder = gameSettings.gameDataPath.Replace('/','\\').Replace("%USER_DOCUMENTS%", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
Hoi4_Doc = ParadoxFolder;
Hoi4_Enb_Mods = Path.Combine(Hoi4_Doc, "dlc_load.json");
Hoi4_Mods = Path.Combine(Hoi4_Doc, "mod");


//Load Mods
var items = load_items();
//Load Mods
var items = loadLHSettings();
globalMods = modParser.load_mods_info(Hoi4_Mods);
categoriesBox.Items.AddRange(modParser.comboBoxCategories.ToArray());
generateCategories();
Expand All @@ -162,7 +179,13 @@ private void load()
+ "The mod supports version " + mod.supported_version);
}
if (items.enabled_mods.Contains(mod.gameRegestryMod)) { enabled = true; enabled_mods++; }
modsTable.Rows.Add(mod.picture, enabled, mod.displayName, version, mod.remote_fileid, msg);
if (mod.remote_fileid != null)
{
modsTable.Rows.Add(mod.picture, enabled, mod.displayName, version, mod.remote_fileid, msg);
}
else {
modsTable.Rows.Add(mod.picture, enabled, mod.displayName, version, mod.dirPath, msg);
}

}
updateModsCount(enabled_mods, globalMods.Count);
Expand All @@ -177,7 +200,7 @@ private void load()
label_version.Text += " " + gameSettings.version;
}

public launchSettings load_items()
public launchSettings loadLHSettings()
{
launchSettings obj;

Expand Down Expand Up @@ -210,7 +233,7 @@ private void UserControl11_Click(object sender, EventArgs e)
}
}
}
var config = load_items();
var config = loadLHSettings();
config.enabled_mods = enabled_mods;
config.disabled_dlcs = disabled_dlc;
SerializeConfig(config);
Expand Down Expand Up @@ -307,11 +330,20 @@ private void generateCategories()
{
if (enabled_mods.Contains(mod.gameRegestryMod))
{
currentCategory.Rows.Add(mod.picture, true, mod.displayName, version, mod.remote_fileid, msg);
if (mod.remote_fileid != null)
{ currentCategory.Rows.Add(mod.picture, true, mod.displayName, version, mod.remote_fileid, msg); }
else {
currentCategory.Rows.Add(mod.picture, true, mod.displayName, version, mod.dirPath, msg);
}
}
else
{
currentCategory.Rows.Add(mod.picture, false, mod.displayName, version, mod.remote_fileid, msg);
if (mod.remote_fileid != null)
{ currentCategory.Rows.Add(mod.picture, false, mod.displayName, version, mod.remote_fileid, msg); }
else
{
currentCategory.Rows.Add(mod.picture, false, mod.displayName, version, mod.dirPath, msg);
}

}
}
Expand Down Expand Up @@ -397,7 +429,7 @@ private void updateCategories()
foreach (DataGridViewRow row in list_mods.Rows)
{if (list_mods.DataSource != imEmpty)
{
if (Convert.ToBoolean(row.Cells[1].Value) && Convert.ToString(row.Cells[4].Value) == mod.remote_fileid)
if (Convert.ToBoolean(row.Cells[1].Value) && (Convert.ToString(row.Cells[4].Value) == mod.remote_fileid || Convert.ToString(row.Cells[4].Value) == mod.dirPath))
{
if (mod.displayName != null && !enabled_mods.Contains(mod.gameRegestryMod))
{
Expand All @@ -406,7 +438,7 @@ private void updateCategories()
}

}
else if (!Convert.ToBoolean(row.Cells[1].Value) && Convert.ToString(row.Cells[4].Value) == mod.remote_fileid)
else if (!Convert.ToBoolean(row.Cells[1].Value) && (Convert.ToString(row.Cells[4].Value) == mod.remote_fileid || Convert.ToString(row.Cells[4].Value) == mod.dirPath))
{
if (mod.displayName != null && enabled_mods.Contains(mod.gameRegestryMod))
{
Expand Down Expand Up @@ -458,6 +490,7 @@ private void textBox2_TextChanged(object sender, EventArgs e)
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Properties.Settings.Default.Save();
updateUI.Stop();
}

private void list_mods_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
Expand All @@ -471,6 +504,16 @@ private void list_mods_CellFormatting(object sender, DataGridViewCellFormattingE
}
}
}

private void userControl11_Load(object sender, EventArgs e)
{

}

private void list_dlc_SelectedIndexChanged(object sender, EventArgs e)
{

}
}

}
Expand Down
Loading

0 comments on commit f0d92df

Please sign in to comment.