Skip to content

Commit

Permalink
Fixed drag-drop again
Browse files Browse the repository at this point in the history
  • Loading branch information
bbepis committed May 8, 2016
1 parent c89f4fe commit a659753
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions AA2Pack/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ static void Main(string[] args)
args.ContainsSwitch("h"))
{
PrintHelp();
#if DEBUG
Console.ReadKey();
#endif
return;
}

Expand Down Expand Up @@ -82,7 +85,7 @@ static void Main(string[] args)
using (FileStream fs = new FileStream(path, FileMode.Create))
iw.WriteTo(fs);

ConsoleWriter.WriteFormat("[{0}/{1}] Processed {2}... ({3})",
ConsoleWriter.WriteLineFormat("[{0}/{1}] Processed {2}... ({3})",
(++i).ToString(), //processed subfiles
pp.Subfiles.Count.ToString(), //total subfiles
iw.Name, //current subfile
Expand All @@ -95,11 +98,7 @@ static void Main(string[] args)
{
//packing into a .pp

string localPath = s.TrimEnd('\\') + ".pp";
if (localPath.Contains("\\"))
localPath = localPath.Remove(0, s.LastIndexOf('\\'));

string ppPath = Path.Combine(Path.GetDirectoryName(s.TrimEnd('\\')), localPath);
string ppPath = Path.GetFullPath(s).TrimEnd('\\') + ".pp";

if (File.Exists(ppPath))
{
Expand All @@ -122,7 +121,7 @@ static void Main(string[] args)
bg.ProgressChanged += (sender, e) =>
{
ConsoleWriter.ClearLine();
ConsoleWriter.WriteFormat("Writing " + localPath + "... ({0})", e.ProgressPercentage + "%");
ConsoleWriter.WriteFormat("Writing " + ppPath + "... ({0})", e.ProgressPercentage + "%");
};

bg.RunWorkerAsync();
Expand All @@ -131,10 +130,13 @@ static void Main(string[] args)
System.Threading.Thread.Sleep(50);

ConsoleWriter.ClearLine();
ConsoleWriter.WriteLineFormat("Writing " + localPath + "... ({0})", "100%");
ConsoleWriter.WriteLineFormat("Writing " + ppPath + "... ({0})", "100%");
}

}

#if DEBUG
Console.ReadKey();
#endif
}
}
}

0 comments on commit a659753

Please sign in to comment.