Skip to content

Commit

Permalink
v1.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisDiligens committed Sep 20, 2020
1 parent 07a7e74 commit 763f176
Show file tree
Hide file tree
Showing 26 changed files with 1,892 additions and 1,006 deletions.
9 changes: 9 additions & 0 deletions Fo76ini/Fo76ini.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@
<Compile Include="Forms\FormMods\FormMods.NexusMods.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormWhatsNew\FormWhatsNew.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormWhatsNew\FormWhatsNew.Designer.cs">
<DependentUpon>FormWhatsNew.cs</DependentUpon>
</Compile>
<Compile Include="Interface\DropDown.cs" />
<Compile Include="Interface\InvalidXmlException.cs" />
<Compile Include="Interface\Translation.Shared.cs" />
Expand All @@ -164,6 +170,9 @@
<EmbeddedResource Include="Forms\FormMods\FormMods.resx">
<DependentUpon>FormMods.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormWhatsNew\FormWhatsNew.resx">
<DependentUpon>FormWhatsNew.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down
40 changes: 27 additions & 13 deletions Fo76ini/Forms/Form1/Form1.Designer.cs

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

30 changes: 27 additions & 3 deletions Fo76ini/Forms/Form1/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Fo76ini.Properties;
using Fo76ini.Forms.FormWhatsNew;
using Fo76ini.Properties;
using IniParser.Model;
using System;
using System.Collections.Generic;
Expand All @@ -17,6 +18,8 @@ public partial class Form1 : Form
{
private UILoader uiLoader = new UILoader();

private FormWhatsNew formWhatsNew = null;

private FormMods formMods;
private bool formModsBackupCreated = false;

Expand Down Expand Up @@ -156,6 +159,7 @@ public Form1()

// Event handler:
this.FormClosing += this.Form1_FormClosing;
this.Shown += this.Form1_Shown;
this.KeyDown += this.Form1_KeyDown;

this.backgroundWorkerGetLatestVersion.RunWorkerCompleted += backgroundWorkerGetLatestVersion_RunWorkerCompleted;
Expand Down Expand Up @@ -270,9 +274,8 @@ private void Form1_Load(object sender, EventArgs e)

// Load mods:
ManagedMods.Instance.Load();
this.formMods.UpdateUI();

NexusMods.Load();
this.formMods.UpdateUI();

// Account profiles:
this.accountProfileRadioButtons = new RadioButton[] { this.radioButtonAccount1, this.radioButtonAccount2, this.radioButtonAccount3, this.radioButtonAccount4, this.radioButtonAccount5, this.radioButtonAccount6, this.radioButtonAccount7, this.radioButtonAccount8 };
Expand Down Expand Up @@ -308,11 +311,26 @@ private void Form1_Load(object sender, EventArgs e)
this.LoadGallery();

MakePictureBoxButton(this.pictureBoxUpdateButton, "updateNowButton");
}

private void Form1_Shown(Object sender, EventArgs e)
{
// Check display resolution
int[] res = Utils.GetDisplayResolution();
if (res[0] < 920 || res[1] < 750)
MsgBox.Get("displayResolutionTooLow").FormatText($"{res[0]} x {res[1]}", "920 x 750").Show(MessageBoxIcon.Warning);

// Display "What's new?" dialog
if (!IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bDisableWhatsNew", false) &&
Utils.CompareVersions(Shared.VERSION, IniFiles.Instance.GetString(IniFile.Config, "General", "sPreviousVersion", "1.0.0")) > 0)
ShowWhatsNew();
}

private void ShowWhatsNew()
{
if (this.formWhatsNew == null)
this.formWhatsNew = new FormWhatsNew();
this.formWhatsNew.ShowDialog();
}

private void Form1_KeyDown(object sender, KeyEventArgs e)
Expand All @@ -327,6 +345,7 @@ private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
IniFiles.Instance.Set(IniFile.Config, "General", "sPreviousVersion", Shared.VERSION);
IniFiles.Instance.SaveWindowState("Form1", this);
if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bAutoApply", false))
ApplyChanges();
Expand Down Expand Up @@ -2217,6 +2236,11 @@ private void linkLabelAttribution_LinkClicked(object sender, LinkLabelLinkClicke
Utils.OpenNotepad(@"Attribution.txt");
}

private void linkLabelWhatsNew_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
ShowWhatsNew();
}

#endregion
}
}
11 changes: 10 additions & 1 deletion Fo76ini/Forms/FormMods/FormMods.NexusMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ private void InitializeNMControls()

public void UpdateNMProfile()
{
this.textBoxAPIKey.Text = NexusMods.Profile.APIKey;

this.labelNMUserName.Text = NexusMods.Profile.UserName;

switch (NexusMods.Profile.Status)
Expand Down Expand Up @@ -93,12 +95,16 @@ private void textBoxAPIKey_TextChanged(object sender, EventArgs e)

private void buttonNMUpdateProfile_Click(object sender, EventArgs e)
{
if (this.backgroundWorkerRetrieveProfileInfo.IsBusy)
return;
this.pictureBoxNMProfilePicture.Image = Resources.Spinner_200;
this.backgroundWorkerRetrieveProfileInfo.RunWorkerAsync();
}

private void buttonNMUpdateModInfo_Click(object sender, EventArgs e)
{
if (this.backgroundWorkerRetrieveModInfo.IsBusy)
return;
this.backgroundWorkerRetrieveModInfo.RunWorkerAsync();
}

Expand Down Expand Up @@ -187,7 +193,10 @@ private void backgroundWorkerRetrieveModInfo_RunWorkerCompleted(object sender, R
this.UpdateModList();
this.ProgressBarContinuous(100);
this.DisplayAllDone();
this.backgroundWorkerRetrieveProfileInfo.RunWorkerAsync();

if (!this.backgroundWorkerRetrieveModInfo.IsBusy)
this.backgroundWorkerRetrieveProfileInfo.RunWorkerAsync();

MsgBox.Get("nexusModsRemoteInfoRefreshedSuccess").Popup();
}

Expand Down
2 changes: 0 additions & 2 deletions Fo76ini/Forms/FormMods/FormMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ private void UpdateSettings()
//this.textBoxGamePath.Text = Shared.GamePath;

LoadTextBoxResourceLists();

this.textBoxAPIKey.Text = NexusMods.Profile.APIKey;
}

private void UpdateLabel(bool success = true)
Expand Down
144 changes: 144 additions & 0 deletions Fo76ini/Forms/FormWhatsNew/FormWhatsNew.Designer.cs

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

Loading

0 comments on commit 763f176

Please sign in to comment.