Skip to content

Commit

Permalink
Merge pull request #8 from WoW-Tools/cli
Browse files Browse the repository at this point in the history
cli into master
  • Loading branch information
tomrus88 committed May 10, 2016
2 parents b0bbc3b + f3d81ad commit 0fb60ef
Show file tree
Hide file tree
Showing 35 changed files with 825 additions and 641 deletions.
15 changes: 8 additions & 7 deletions CASCConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;

namespace CASCConsole
{
class Program
{
static object progressLock = new object();
static readonly object ProgressLock = new object();

static void Main(string[] args)
{
Expand Down Expand Up @@ -45,15 +46,15 @@ static void Main(string[] args)

Console.WriteLine("Loaded.");

Console.WriteLine("Extract params:", pattern, dest, locale);
Console.WriteLine("Extract params:");
Console.WriteLine(" Pattern: {0}", pattern);
Console.WriteLine(" Destination: {0}", dest);
Console.WriteLine(" LocaleFlags: {0}", locale);
Console.WriteLine(" ContentFlags: {0}", content);

Wildcard wildcard = new Wildcard(pattern, true, RegexOptions.IgnoreCase);

foreach (var file in root.GetFiles())
foreach (var file in CASCFolder.GetFiles(root.Entries.Select(kv => kv.Value)))
{
if (wildcard.IsMatch(file.FullName))
{
Expand All @@ -77,7 +78,7 @@ static void Main(string[] args)

private static void BgLoader_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
lock (progressLock)
lock (ProgressLock)
{
if (e.UserState != null)
Console.WriteLine(e.UserState);
Expand All @@ -88,16 +89,16 @@ private static void BgLoader_ProgressChanged(object sender, ProgressChangedEvent

private static void DrawProgressBar(long complete, long maxVal, int barSize, char progressCharacter)
{
float perc = (float)complete / (float)maxVal;
float perc = (float)complete / maxVal;
DrawProgressBar(perc, barSize, progressCharacter);
}

private static void DrawProgressBar(float percent, int barSize, char progressCharacter)
{
Console.CursorVisible = false;
int left = Console.CursorLeft;
int chars = (int)Math.Round(percent / (1.0f / (float)barSize));
string p1 = String.Empty, p2 = String.Empty;
int chars = (int)Math.Round(percent / (1.0f / barSize));
string p1 = string.Empty, p2 = string.Empty;

for (int i = 0; i < chars; i++)
p1 += progressCharacter;
Expand Down
2 changes: 1 addition & 1 deletion CASCExplorer/AboutBox.Designer.cs

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

11 changes: 5 additions & 6 deletions CASCExplorer/AboutBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@

namespace CASCExplorer
{
partial class AboutBox : Form
sealed partial class AboutBox : Form
{
public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.Text = string.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelVersion.Text = string.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
var link = new LinkLabel.Link();
link.LinkData = Properties.Resources.donateURL;
var link = new LinkLabel.Link {LinkData = Properties.Resources.donateURL};
this.labelDonate.Links.Add(link);
this.textBoxDescription.Text = AssemblyDescription;
}
Expand Down Expand Up @@ -89,7 +88,7 @@ public string AssemblyCopyright

private void labelDonate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(e.Link.LinkData as string);
Process.Start(e.Link?.LinkData as string);
}
}
}
2 changes: 0 additions & 2 deletions CASCExplorer/CASCExplorer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
<DependentUpon>BruteforceForm.cs</DependentUpon>
</Compile>
<Compile Include="CASCViewHelper.cs" />
<Compile Include="DB2Reader.cs" />
<Compile Include="DB3Reader.cs" />
<Compile Include="FileScanner.cs" />
<Compile Include="CASCEntrySorter.cs" />
<Compile Include="ExtractProgress.cs">
Expand Down
Loading

0 comments on commit 0fb60ef

Please sign in to comment.