Skip to content

Commit

Permalink
v2.0.1 hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
bbepis committed Apr 1, 2016
1 parent b7e2234 commit 0b51aea
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
7 changes: 6 additions & 1 deletion AA2Snowflake/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
v2.0
v2.0.1
+ Fixed some issues
+ Changed crash dialogs to display in english
+ Fixed links in crash dialog

v2.0
+ Massive amount of bugfixes
++ Crashes when border changes have been temporarily dealt with
++ Cards no longer crash when saving whilst being accessed at the same time
Expand Down
2 changes: 1 addition & 1 deletion AA2Snowflake/Personality.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static Dictionary<int, IPersonality> GetAllPersonalities()
{
CustomPersonality cp = LoadPersonality(new ppParser(path, new ppFormat_AA2()));
if (!ReferenceEquals(cp, null)) //is there a better way to check null?
pers.Add(cp.Slot, cp);
pers[cp.Slot] = cp;
}

return pers;
Expand Down
6 changes: 5 additions & 1 deletion AA2Snowflake/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -60,11 +61,14 @@ static bool saveLog(Exception ex)
{
try
{
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

SerializableDictionary<string, string> log = new SerializableDictionary<string, string>();

log["message"] = ex.Message;
log["stacktrace"] = ex.StackTrace;
System.IO.File.WriteAllText(Environment.CurrentDirectory + @"\AA2Snowflake crash " + DateTime.Now.ToString("d-M-yyyy hh-mm-ss") + ".dmp", log.SerializeObject());
File.WriteAllText(Environment.CurrentDirectory + @"\AA2Snowflake crash " + DateTime.Now.ToString("d-M-yyyy hh-mm-ss") + ".dmp", log.SerializeObject());
return true;
}
catch
Expand Down
4 changes: 2 additions & 2 deletions AA2Snowflake/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")]
5 changes: 2 additions & 3 deletions AA2Snowflake/formCrash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void launchLink(string link)

private void linkGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
launchLink(@"https://github.com/aa2g/AA2Install/issues/new");
launchLink(@"https://github.com/aa2g/AA2Snowflake/issues/new");
}

private void linkaa2g_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
Expand All @@ -39,8 +39,7 @@ private void linkaa2g_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e

private void linkHongfire_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
//launchLink(@"http://www.hongfire.com/forum/showthread.php/447075-AA2Install-Open-source-mod-installer-Prerelease-5-2-2");
//need to make a post first
launchLink(@"http://www.hongfire.com/forum/showthread.php/453615-AA2Snowflake-v2-0");
}
}
}
10 changes: 5 additions & 5 deletions AA2Snowflake/formMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,14 @@ private void chkMouth32_CheckedChanged(object sender, EventArgs e)
public void GenerateICFBackups()
{
SerializableDictionary<string, byte[]> backup = new SerializableDictionary<string, byte[]>();
Regex regex = new Regex(@"e\d{2}_\d{2}_\d{2}\.icf");
Regex regex = new Regex(@"e\d{2}_\d{2}_\d{2}\.[Ii][Cc][Ff]");
foreach (IPersonality personality in Personalities.Values)
foreach (IWriteFile icf in personality.GetIcfPP().Subfiles.Where(iw => iw.Name.EndsWith(".icf")))
foreach (IWriteFile icf in personality.GetIcfPP().Subfiles.Where(iw => iw.Name.ToLower().EndsWith(".icf")))
if (regex.IsMatch(icf.Name))
using (MemoryStream ms = new MemoryStream())
{
icf.WriteTo(ms);
backup[icf.Name] = ms.ToByteArray();
backup[icf.Name.ToLower()] = ms.ToByteArray();
}
File.WriteAllText(Paths.BACKUP + "\\icfbackup.xml", backup.SerializeObject());
}
Expand Down Expand Up @@ -814,7 +814,7 @@ private void cmbMode33_SelectedIndexChanged(object sender, EventArgs e)

private void btnSet33_Click(object sender, EventArgs e)
{
if (!File.Exists(Paths.BACKUP + "\\lstbackup.xml"))
if (!File.Exists(Paths.BACKUP + "\\icfbackup.xml"))
if (MessageBox.Show("You haven't created a backup, so restoration is not possible.\nAre you sure you want to continue?", "Unable to restore", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes)
return;

Expand Down Expand Up @@ -870,7 +870,7 @@ private void btnRestore33_Click(object sender, EventArgs e)
string name = "e" + cmbMode33.SelectedIndex.ToString("00") + "_" + personality.Slot.ToString("00") + "_" + cmbHeight33.SelectedIndex.ToString("00") + ".ICF";
var sub = pp.Subfiles.First(iw => iw.Name.ToLower() == name.ToLower());
var index = pp.Subfiles.IndexOf(pp.Subfiles.First(iw => iw.Name.ToLower() == name.ToLower()));
sub = new MemSubfile(new MemoryStream(backup[name]), name);
sub = new MemSubfile(new MemoryStream(backup[name.ToLower()]), name);
pp.Subfiles[index] = sub;
var back = pp.WriteArchive(pp.FilePath, false, "bak", true);
ShowLoadingForm();
Expand Down

0 comments on commit 0b51aea

Please sign in to comment.