Skip to content

Commit

Permalink
v1.9.0h2
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisDiligens committed Dec 18, 2020
1 parent dc19948 commit 815bff1
Show file tree
Hide file tree
Showing 17 changed files with 247 additions and 171 deletions.
3 changes: 3 additions & 0 deletions Fo76ini/Fo76ini.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\snow.gif" />
<None Include="Resources\snow4.gif" />
<None Include="Resources\snow2.gif" />
<None Include="Resources\login-48.png" />
<None Include="Resources\external-link-16.png" />
<None Include="Resources\checkbox-24.png" />
Expand Down
63 changes: 40 additions & 23 deletions Fo76ini/Forms/Form1/Form1.Designer.cs

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

34 changes: 34 additions & 0 deletions Fo76ini/Forms/Form1/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,36 @@ private void Form1_Load(object sender, EventArgs e)
this.LoadGallery();

MakePictureBoxButton(this.pictureBoxUpdateButton, "updateNowButton");


/*
* Because easter eggs are fun:
*/

this.pictureBoxSnow.Visible = false;
if ((DateTime.Now.Month == 12 && DateTime.Now.Day >= 24) ||
(DateTime.Now.Month == 1 && DateTime.Now.Day <= 2))
EnableWinterEasteregg();
}

private void EnableWinterEasteregg()
{
this.pictureBoxSnow.Visible = true;
this.tabPageInfo.BackColor = Color.FromArgb(54, 70, 93);

foreach (Control control in new Control[] { labelTitle, labelDescription, labelVersion, labelConfigVersion, labelAuthor, labelAuthorName, labelTranslationAuthor, labelTranslationBy, labelNWModeActive, linkLabelAttribution, linkLabelWhatsNew, groupBoxSettings})
{
control.Parent.Controls.Remove(control);
this.pictureBoxSnow.Controls.Add(control);

control.Top -= this.pictureBoxSnow.Top;
control.Left -= this.pictureBoxSnow.Left;
control.ForeColor = Color.White;
control.BackColor = Color.Transparent;
}

this.labelDescription.Text = "Merry Christmas and a happy new year!";
this.labelSettingsNotice.ForeColor = Color.White;
}

private void Form1_Shown(object sender, EventArgs e)
Expand Down Expand Up @@ -633,7 +663,11 @@ private void toolStripButtonApply_Click(object sender, EventArgs e)

private void toolStripButtonLaunchGame_Click(object sender, EventArgs e)
{
if (IniFiles.Config.GetBool("Preferences", "bAutoApply", false))
ApplyChanges();
this.game.LaunchGame();
if (IniFiles.Config.GetBool("Preferences", "bQuitOnLaunch", false))
Application.Exit();
}

#endregion
Expand Down
3 changes: 2 additions & 1 deletion Fo76ini/Forms/FormMods/FormMods.Designer.cs

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

26 changes: 17 additions & 9 deletions Fo76ini/Forms/FormMods/FormMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,6 @@ private void ShowLoadingUI()

public void ToggleNuclearWinterMode()
{
if (Mods == null)
return;

if (Mods.NuclearWinterModeEnabled)
DisableNuclearWinterMode();
else
Expand All @@ -565,8 +562,9 @@ public void ToggleNuclearWinterMode()

public void EnableNuclearWinterMode()
{
if (Mods == null)
return;
ModDeployment.LogFile.WriteLine("\n");
ModDeployment.LogFile.WriteTimeStamp();
ModDeployment.LogFile.WriteLine("Enabling Nuclear Winter mode");

Mods.NuclearWinterModeEnabled = true;

Expand All @@ -589,12 +587,14 @@ public void EnableNuclearWinterMode()
// Save and update UI:
Mods.Save();
TriggerNWModeUpdated();
ModDeployment.LogFile.WriteLine("NW mode enabled, done.");
}

public void DisableNuclearWinterMode()
{
if (Mods == null)
return;
ModDeployment.LogFile.WriteLine("\n");
ModDeployment.LogFile.WriteTimeStamp();
ModDeployment.LogFile.WriteLine("Disabling Nuclear Winter mode");

Mods.NuclearWinterModeEnabled = false;

Expand All @@ -617,6 +617,7 @@ public void DisableNuclearWinterMode()
// Save and update UI:
Mods.Save();
TriggerNWModeUpdated();
ModDeployment.LogFile.WriteLine("NW mode disabled, done.");
}

private void TriggerNWModeUpdated()
Expand All @@ -633,7 +634,11 @@ public bool IsNuclearWinterModeEnabled()
public void ToggleNuclearWinterModeThreaded()
{
if (Mods == null)
{
MsgBox.ShowID("modsGamePathNotSet", MessageBoxIcon.Error);
TriggerNWModeUpdated();
return;
}

if (Mods.NuclearWinterModeEnabled)
DisableNuclearWinterModeThreaded();
Expand All @@ -653,7 +658,7 @@ public void EnableNuclearWinterModeThreaded()
return true;
}, (success) => {
if (success)
MsgBox.Get("nwModeDisabled").Popup(MessageBoxIcon.Information);
MsgBox.Get("nwModeEnabled").Popup(MessageBoxIcon.Information);
UpdateUI();
EnableUI();
Hide();
Expand Down Expand Up @@ -682,7 +687,10 @@ public void DisableNuclearWinterModeThreaded()
private NuclearWinterEventArgs BuildNuclearWinterEventArgs()
{
NuclearWinterEventArgs args = new NuclearWinterEventArgs();
args.NuclearWinterModeEnabled = Mods.NuclearWinterModeEnabled;
if (Mods != null)
args.NuclearWinterModeEnabled = Mods.NuclearWinterModeEnabled;
else
args.NuclearWinterModeEnabled = false;
return args;
}

Expand Down
3 changes: 0 additions & 3 deletions Fo76ini/Forms/FormMods/FormMods.resx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@
Yy7JZ6QAAAAASUVORK5CYII=
</value>
</data>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>5, 63</value>
</metadata>
<metadata name="openFileDialogMod.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>137, 46</value>
</metadata>
Expand Down
4 changes: 3 additions & 1 deletion Fo76ini/Forms/FormSettings/FormSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public FormSettings()
InitializeComponent();

// Make this form translatable:
Localization.LocalizedForms.Add(new LocalizedForm(this, toolTip));
LocalizedForm form = new LocalizedForm(this, this.toolTip);
form.SpecialControls.Add(this.contextMenuStripGame);
Localization.LocalizedForms.Add(form);

// Handle translations:
Translation.LanguageChanged += OnLanguageChanged;
Expand Down
2 changes: 2 additions & 0 deletions Fo76ini/Mods/ModDeployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static void Deploy(ManagedMods mods, Action<Progress> ProgressChanged, bo
LogFile.WriteLine("\n\n");
LogFile.WriteTimeStamp();
LogFile.WriteLine($"Version {Shared.VERSION}, deploying...");
LogFile.WriteLine($"Game path: {mods.GamePath}");

// TODO: More descriptive ProgressChanged
ProgressChanged?.Invoke(Progress.Indetermined("Deploying..."));
Expand Down Expand Up @@ -88,6 +89,7 @@ public static void Deploy(ManagedMods mods, Action<Progress> ProgressChanged, bo
ProgressChanged?.Invoke(Progress.Done("Mods removed."));

LogFile.WriteLine("Deployment finished.");
LogFile.WriteLine($"Resource list ({mods.Resources.Count} files): \"{mods.Resources}\"");
}

/// <summary>
Expand Down
9 changes: 4 additions & 5 deletions Fo76ini/Mods/ModInstallations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ public static void ImportInstalledMods(ManagedMods mods, Action<Progress> Progre

// Ignore any game files ("SeventySix - *.ba2"):
foreach (string archiveName in IndexFileList)
if (archiveName.StartsWith("SeventySix"))
if (archiveName.Trim().ToLower().StartsWith("seventysix"))
installedMods.Remove(archiveName);
foreach (string archiveName in Archive2List)
if (archiveName.StartsWith("SeventySix"))
if (archiveName.Trim().ToLower().StartsWith("seventysix"))
installedMods.Remove(archiveName);
foreach (string archiveName in mods.Resources)
if (archiveName.StartsWith("SeventySix"))
if (archiveName.Trim().ToLower().StartsWith("seventysix"))
installedMods.Remove(archiveName);

/*
Expand All @@ -208,8 +208,7 @@ public static void ImportInstalledMods(ManagedMods mods, Action<Progress> Progre
foreach (string archiveName in installedMods)
{
string path = Path.Combine(mods.GamePath, "Data", archiveName);
Console.WriteLine(path);
if (File.Exists(path))
if (File.Exists(path) && !archiveName.Trim().ToLower().StartsWith("seventysix"))
{
// Import archive:
ModInstallations.InstallArchive(mods, path, true);
Expand Down
10 changes: 10 additions & 0 deletions Fo76ini/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 815bff1

Please sign in to comment.