Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisDiligens committed Jun 7, 2020
1 parent 93f5cb8 commit 07a3a3b
Show file tree
Hide file tree
Showing 20 changed files with 694 additions and 358 deletions.
28 changes: 28 additions & 0 deletions Fo76ini/Fo76ini.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,21 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<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>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -187,7 +202,20 @@
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<None Include="icons\defrost.png" />
<None Include="icons\frozen-plus.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" />
</Project>
13 changes: 13 additions & 0 deletions Fo76ini/Fo76ini.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Fo76ini/Form1.Colors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Color PipboyColor
{
get
{
float r = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorR", 1.0f);
float r = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorR", 0.1f);
float g = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorG", 1.0f);
float b = IniFiles.Instance.GetFloat("Pipboy", "fPipboyEffectColorB", 0.5f);
return Color.FromArgb(
Expand Down
186 changes: 157 additions & 29 deletions Fo76ini/Form1.Designer.cs

Large diffs are not rendered by default.

131 changes: 113 additions & 18 deletions Fo76ini/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Fo76ini
{
public partial class Form1 : Form
{
public const String VERSION = "1.6.1";
public const String VERSION = "1.6.2";

protected System.Globalization.CultureInfo enUS = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");

Expand Down Expand Up @@ -306,6 +306,14 @@ private void AddAllEventHandler()
"0"
);

// Launch options
uiLoader.LinkList(
new RadioButton[] { this.radioButtonLaunchViaLink, this.radioButtonLaunchViaExecutable },
new String[] { "1", "2" },
IniFile.Config, "Preferences", "uLaunchOption",
"1"
);

// Nuclear winter mode
uiLoader.LinkBool(this.checkBoxNWMode, IniFile.Config, "Preferences", "bNWMode", false);

Expand Down Expand Up @@ -808,27 +816,43 @@ private void checkBoxReadOnly_CheckedChanged(object sender, EventArgs e)
private void buttonLaunchGame_Click(object sender, EventArgs e)
{
uint uGameEdition = IniFiles.Instance.GetUInt(IniFile.Config, "Preferences", "uGameEdition", 0);
uint uLaunchOption = IniFiles.Instance.GetUInt(IniFile.Config, "Preferences", "uLaunchOption", 1);
String process = null;
switch (uGameEdition)
if (uLaunchOption == 1)
{
switch (uGameEdition)
{
case (uint)GameEdition.BethesdaNet:
process = "bethesdanet://run/20";
break;
case (uint)GameEdition.Steam:
process = "steam://run/1151340"; // "steam://runappid/1151340"
break;
case (uint)GameEdition.BethesdaNetPTS:
process = "bethesdanet://run/57";
break;
default:
MsgBox.Get("chooseGameEdition").Show(MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
else if (uLaunchOption == 2)
{
case (uint)GameEdition.BethesdaNet:
process = "bethesdanet://run/20";
break;
case (uint)GameEdition.Steam:
process = "steam://run/1151340"; // "steam://runappid/1151340"
break;
case (uint)GameEdition.BethesdaNetPTS:
process = "bethesdanet://run/57";
break;
default:
MsgBox.Get("chooseGameEdition").Show(MessageBoxButtons.OK, MessageBoxIcon.Information);
if (!ManagedMods.Instance.ValidateGamePath())
{
MsgBox.Get("modsGamePathNotSet").Show(MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
process = Path.GetFullPath(Path.Combine(ManagedMods.Instance.GamePath, "Fallout76.exe"));
}
if (process != null)
{
if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bAutoApply", false))
ApplyChanges();
System.Diagnostics.Process.Start(process);
if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bQuitOnLaunch", false))
this.Close();
}
if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bAutoApply", false))
ApplyChanges();
System.Diagnostics.Process.Start(process);
if (IniFiles.Instance.GetBool(IniFile.Config, "Preferences", "bQuitOnLaunch", false))
this.Close();
}

// "Get the latest version from NexusMods" link:
Expand Down Expand Up @@ -865,6 +889,7 @@ private void buttonManageMods_Click(object sender, EventArgs e)
formModsBackupCreated = true;
}
Utils.SetFormPosition(this.formMods, this.Location.X + this.Width, this.Location.Y);
this.formMods.UpdateUI();
this.formMods.Show();
}

Expand Down Expand Up @@ -904,19 +929,28 @@ private void buttonFixIssuesEarlierVersion_Click(object sender, EventArgs e)
private void radioButtonEditionSteam_CheckedChanged(object sender, EventArgs e)
{
if (this.radioButtonEditionSteam.Checked)
{
this.formMods.ChangeGameEdition(GameEdition.Steam);
this.textBoxGamePath.Text = ManagedMods.Instance.GamePath;
}
}

private void radioButtonEditionBethesdaNet_CheckedChanged(object sender, EventArgs e)
{
if (this.radioButtonEditionBethesdaNet.Checked)
{
this.formMods.ChangeGameEdition(GameEdition.BethesdaNet);
this.textBoxGamePath.Text = ManagedMods.Instance.GamePath;
}
}

private void radioButtonEditionBethesdaNetPTS_CheckedChanged(object sender, EventArgs e)
{
if (this.radioButtonEditionBethesdaNetPTS.Checked)
{
this.formMods.ChangeGameEdition(GameEdition.BethesdaNetPTS);
this.textBoxGamePath.Text = ManagedMods.Instance.GamePath;
}
}

// Nuclear Winter mode
Expand Down Expand Up @@ -1044,5 +1078,66 @@ private void checkBoxIgnoreUpdates_CheckedChanged(object sender, EventArgs e)
IniFiles.Instance.Set(IniFile.Config, "Preferences", "bIgnoreUpdates", this.checkBoxIgnoreUpdates.Checked);
this.CheckVersion();
}

/*
* Game path
*/

// Pick game path
private void buttonPickGamePath_Click(object sender, EventArgs e)
{
if (ManagedMods.Instance.isDeploymentNecessary())
{
MsgBox.ShowID("modsDeploymentNecessary");
return;
}
if (this.openFileDialogGamePath.ShowDialog() == DialogResult.OK)
{
String path = Path.GetDirectoryName(this.openFileDialogGamePath.FileName); // We want the path where Fallout76.exe resides.
if (Directory.Exists(Path.Combine(path, "Data")))
{
this.textBoxGamePath.Text = path;
ManagedMods.Instance.GamePath = path;
IniFiles.Instance.Set(IniFile.Config, "Preferences", ManagedMods.Instance.GamePathKey, path);
IniFiles.Instance.SaveConfig();
ManagedMods.Instance.Load();
}
else
MsgBox.ShowID("modsGamePathInvalid");
}
}

// Game path textbox changed
private void textBoxGamePath_TextChanged(object sender, EventArgs e)
{
if (this.textBoxGamePath.Focused)
{
if (ManagedMods.Instance.isDeploymentNecessary())
{
if (this.textBoxGamePath.Text != ManagedMods.Instance.GamePath)
this.textBoxGamePath.Text = ManagedMods.Instance.GamePath;
return;
}
else if (Directory.Exists(Path.Combine(this.textBoxGamePath.Text, "Data")))
{
ManagedMods.Instance.GamePath = this.textBoxGamePath.Text;
IniFiles.Instance.Set(IniFile.Config, "Preferences", ManagedMods.Instance.GamePathKey, this.textBoxGamePath.Text);
IniFiles.Instance.SaveConfig();
ManagedMods.Instance.Load();
this.textBoxGamePath.ForeColor = Color.Black;
this.textBoxGamePath.BackColor = Color.White;
}
else
{
this.textBoxGamePath.ForeColor = Color.White;
this.textBoxGamePath.BackColor = Color.Red;
}
}
}

private void radioButtonLaunchViaExecutable_CheckedChanged(object sender, EventArgs e)
{
this.labelLaunchOptionTip.Visible = this.radioButtonLaunchViaExecutable.Checked;
}
}
}
3 changes: 3 additions & 0 deletions Fo76ini/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ Affected files: Fallout76Custom.ini</value>
<metadata name="timerCheckFiles.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>221, 17</value>
</metadata>
<metadata name="openFileDialogGamePath.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>864, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>82</value>
</metadata>
Expand Down
Loading

0 comments on commit 07a3a3b

Please sign in to comment.