Skip to content

Commit 41a6e69

Browse files
authored
Merge pull request #2 from SpeedReflect/vector
Merging Vector branch to Master
2 parents 637ac82 + c66274e commit 41a6e69

21 files changed

Lines changed: 477 additions & 93 deletions

Binary.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILWrapper", "..\ILWrapper\I
1111
EndProject
1212
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Endscript", "..\Endscript\Endscript\Endscript.csproj", "{ACC9EEB0-18B8-4EBA-B9D0-739E9C4501A1}"
1313
EndProject
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreExtensions", "..\CoreExtensions\CoreExtensions\CoreExtensions.csproj", "{4C6FAA97-A899-4EFC-94B0-9E0DA55FB99B}"
15+
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1618
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
3335
{ACC9EEB0-18B8-4EBA-B9D0-739E9C4501A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
3436
{ACC9EEB0-18B8-4EBA-B9D0-739E9C4501A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
3537
{ACC9EEB0-18B8-4EBA-B9D0-739E9C4501A1}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{4C6FAA97-A899-4EFC-94B0-9E0DA55FB99B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{4C6FAA97-A899-4EFC-94B0-9E0DA55FB99B}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{4C6FAA97-A899-4EFC-94B0-9E0DA55FB99B}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{4C6FAA97-A899-4EFC-94B0-9E0DA55FB99B}.Release|Any CPU.Build.0 = Release|Any CPU
3642
EndGlobalSection
3743
GlobalSection(SolutionProperties) = preSolution
3844
HideSolutionNode = FALSE

Binary/Binary.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
77
<ApplicationIcon>binary.ico</ApplicationIcon>
8-
<Version>2.1.0</Version>
8+
<Version>2.5.5</Version>
99
<Authors>MaxHwoy</Authors>
1010
<Description>Tool for editing Need for Speed binary files (.BIN, .BUN, .LZC).</Description>
1111
<Copyright>Copyright © 2020 MaxHwoy</Copyright>
@@ -26,12 +26,6 @@
2626
<ProjectReference Include="..\..\Nikki\Nikki\Nikki.csproj" />
2727
</ItemGroup>
2828

29-
<ItemGroup>
30-
<Reference Include="CoreExtensions">
31-
<HintPath>..\..\Nikki\Nikki\CoreExtensions.dll</HintPath>
32-
</Reference>
33-
</ItemGroup>
34-
3529
<ItemGroup>
3630
<Compile Update="Prompt\Combo.cs">
3731
<SubType>Form</SubType>

Binary/Editor.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,22 @@ private void EMSMainNewLauncher_Click(object sender, EventArgs e)
386386
{
387387
using var form = new LanMaker();
388388
form.ShowDialog();
389+
390+
if (form.WasCreated)
391+
{
392+
393+
var result = MessageBox.Show("New launcher was created. Would you like to load it?", "Prompt",
394+
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
395+
396+
if (result == DialogResult.Yes)
397+
{
398+
399+
this.LoadProfile(form.NewLanPath, true);
400+
401+
}
402+
403+
}
404+
389405
}
390406

391407
private void EMSMainLoadFiles_Click(object sender, EventArgs e)
@@ -856,12 +872,12 @@ private void EMSWindowsNew_Click(object sender, EventArgs e)
856872

857873
private void EMSHelpAbout_Click(object sender, EventArgs e)
858874
{
859-
MessageBox.Show("Binary by MaxHwoy v2.1.0", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
875+
MessageBox.Show("Binary by MaxHwoy v2.5.5", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
860876
}
861877

862878
private void EMSHelpTutorials_Click(object sender, EventArgs e)
863879
{
864-
MessageBox.Show("Coming soon TM", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
880+
MessageBox.Show("Join Discord server at the start page to get help and full tool documentation!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
865881
}
866882

867883
#endregion
@@ -1369,9 +1385,9 @@ private void LoadProfile(string filename, bool showerrors)
13691385

13701386
this.EditorPropertyGrid.SelectedObject = null;
13711387
this.Profile = BaseProfile.NewProfile(launch.GameID, launch.Directory);
1388+
this.EditorStatusLabel.Text = "Loading... Please wait...";
13721389

13731390
var watch = new Stopwatch();
1374-
this.EditorStatusLabel.Text = "Loading... Please wait...";
13751391
watch.Start();
13761392

13771393
this.Profile.Load(launch);
@@ -1459,8 +1475,8 @@ private void SaveProfile()
14591475
{
14601476
#endif
14611477

1462-
var watch = new Stopwatch();
14631478
this.EditorStatusLabel.Text = "Saving... Please wait...";
1479+
var watch = new Stopwatch();
14641480
watch.Start();
14651481

14661482
this.Profile.Save();
@@ -1521,7 +1537,7 @@ private void EditorTreeView_AfterSelect(object sender, TreeViewEventArgs e)
15211537
this.ManageButtonScriptNode(e.Node);
15221538

15231539
this.EditorPropertyGrid.SelectedObject = selected;
1524-
this.EditorNodeInfo.Text = $"| {e.Node.Nodes.Count} subnodes";
1540+
this.EditorNodeInfo.Text = $"| Index: {e.Node.Index} | {e.Node.Nodes.Count} subnodes";
15251541
}
15261542

15271543
private void EditorTreeView_DoubleClick(object sender, EventArgs e)

Binary/Interact/AttribCreator.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,31 +99,39 @@ private void PopulateAttribTypesBasedOnGame(GameINT game)
9999
this.AttribTypeComboBox.SelectedIndex = 0;
100100
break;
101101

102+
case GameINT.Underground1:
102103
case GameINT.Underground2:
103104
case GameINT.MostWanted:
104105
this.AttribTypeComboBox.Items.AddRange(new string[]
105106
{
106107
Boolean, /// <see cref="Nikki.Support.MostWanted.Attributes.BoolAttribute"/>
108+
/// <see cref="Nikki.Support.Underground2.Attributes.BoolAttribute"/>
109+
/// <see cref="Nikki.Support.Underground1.Attributes.BoolAttribute"/>
107110

108111

109112
Floating, /// <see cref="Nikki.Support.MostWanted.Attributes.FloatAttribute"/>
113+
/// <see cref="Nikki.Support.Underground2.Attributes.FloatAttribute"/>
114+
/// <see cref="Nikki.Support.Underground1.Attributes.FloatAttribute"/>
110115

111116

112117
Integer, /// <see cref="Nikki.Support.MostWanted.Attributes.IntAttribute"/>
118+
/// <see cref="Nikki.Support.Underground2.Attributes.IntAttribute"/>
119+
/// <see cref="Nikki.Support.Underground1.Attributes.IntAttribute"/>
113120

114121

115122
Key, /// <see cref="Nikki.Support.MostWanted.Attributes.KeyAttribute"/>
123+
/// <see cref="Nikki.Support.Underground2.Attributes.KeyAttribute"/>
124+
/// <see cref="Nikki.Support.Underground1.Attributes.KeyAttribute"/>
116125

117126

118127
String, /// <see cref="Nikki.Support.MostWanted.Attributes.StringAttribute"/>
128+
/// <see cref="Nikki.Support.Underground2.Attributes.StringAttribute"/>
129+
/// <see cref="Nikki.Support.Underground1.Attributes.StringAttribute"/>
119130

120131
});
121132
this.AttribTypeComboBox.SelectedIndex = 0;
122133
break;
123134

124-
case GameINT.Underground1:
125-
break;
126-
127135
default:
128136
break;
129137
}

Binary/Interact/LanMaker.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace Binary.Interact
1010
public partial class LanMaker : Form
1111
{
1212
private bool IsValidDirectoryChosen => Directory.Exists(this.LanMakerTextBoxDir.Text);
13+
public bool WasCreated { get; private set; }
14+
public string NewLanPath { get; private set; }
1315

1416
public LanMaker()
1517
{
@@ -90,6 +92,9 @@ private void LanMakerButtonSave_Click(object sender, EventArgs e)
9092
MessageBox.Show($"File {dialog.FileName} has been saved.", "Success",
9193
MessageBoxButtons.OK, MessageBoxIcon.Information);
9294

95+
this.WasCreated = true;
96+
this.NewLanPath = dialog.FileName;
97+
9398
}
9499
}
95100

Binary/IntroUI.Designer.cs

Lines changed: 37 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Binary/IntroUI.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,19 +87,21 @@ private void IntroPictureUser_Click(object sender, EventArgs e)
8787

8888
private void IntroPictureModder_Click(object sender, EventArgs e)
8989
{
90-
// If password check was not done yet
90+
// If password check was not done yet (deprecated)
91+
/*
9192
if (!Configurations.Default.PassPassed)
9293
{
9394
using var form = new ModderPass();
9495
9596
if (form.ShowDialog() != DialogResult.OK)
9697
{
97-
98+
9899
return;
99-
100+
100101
}
101102
102103
}
104+
*/
103105

104106
this.ModderInteract();
105107
ForcedX.GCCollect();
@@ -325,12 +327,12 @@ private void AskForGameRun(BaseProfile profile)
325327

326328
private void PictureBoxDiscord_Click(object sender, EventArgs e)
327329
{
328-
Utils.OpenBrowser("https://discord.gg/jzksXXn");
330+
Utils.OpenBrowser("https://discord.gg/xy5TjTa");
329331
}
330332

331333
private void PictureBoxUpdates_Click(object sender, EventArgs e)
332334
{
333-
MessageBox.Show("No updates yet, follow discord server for news", "Updates");
335+
Utils.OpenBrowser("https://github.com/SpeedReflect/Binary/tags");
334336
}
335337

336338
private void PictureBoxAutoBackups_Click(object sender, EventArgs e)
@@ -368,7 +370,7 @@ private void PictureBoxSoon_Click(object sender, EventArgs e)
368370

369371
private void LabelBinary_Click(object sender, EventArgs e)
370372
{
371-
MessageBox.Show("Binary by MaxHwoy v2.1.0", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
373+
MessageBox.Show("Binary by MaxHwoy v2.5.5", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
372374
}
373375
}
374376
}

Binary/Program.cs

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,35 @@ static void Main()
7676

7777
private static void SetDependencyPaths(string thispath)
7878
{
79-
CarbonProfile.MainHashList = Path.Combine(thispath, @"mainkeys\carbon.txt");
80-
CarbonProfile.CustomHashList = Path.Combine(thispath, @"userkeys\carbon.txt");
81-
MostWantedProfile.MainHashList = Path.Combine(thispath, @"mainkeys\mostwanted.txt");
82-
MostWantedProfile.CustomHashList = Path.Combine(thispath, @"userkeys\mostwanted.txt");
83-
Underground2Profile.MainHashList = Path.Combine(thispath, @"mainkeys\underground2.txt");
84-
Underground2Profile.CustomHashList = Path.Combine(thispath, @"userkeys\underground2.txt");
85-
ProstreetProfile.MainHashList = Path.Combine(thispath, @"mainkeys\prostreet.txt");
86-
ProstreetProfile.CustomHashList = Path.Combine(thispath, @"userkeys\prostreet.txt");
79+
var userdir = Path.Combine(thispath, "userkeys");
80+
var mainc = Path.Combine(thispath, @"mainkeys\carbon.txt");
81+
var userc = Path.Combine(thispath, @"userkeys\carbon.txt");
82+
var mainmw = Path.Combine(thispath, @"mainkeys\mostwanted.txt");
83+
var usermw = Path.Combine(thispath, @"userkeys\mostwanted.txt");
84+
var mainps = Path.Combine(thispath, @"mainkeys\prostreet.txt");
85+
var userps = Path.Combine(thispath, @"userkeys\prostreet.txt");
86+
var mainug1 = Path.Combine(thispath, @"mainkeys\underground1.txt");
87+
var userug1 = Path.Combine(thispath, @"userkeys\underground1.txt");
88+
var mainug2 = Path.Combine(thispath, @"mainkeys\underground2.txt");
89+
var userug2 = Path.Combine(thispath, @"userkeys\underground2.txt");
90+
91+
CarbonProfile.MainHashList = mainc;
92+
CarbonProfile.CustomHashList = userc;
93+
MostWantedProfile.MainHashList = mainmw;
94+
MostWantedProfile.CustomHashList = usermw;
95+
ProstreetProfile.MainHashList = mainps;
96+
ProstreetProfile.CustomHashList = userps;
97+
Underground1Profile.MainHashList = mainug1;
98+
Underground1Profile.CustomHashList = userug1;
99+
Underground2Profile.MainHashList = mainug2;
100+
Underground2Profile.CustomHashList = userug2;
101+
102+
if (!Directory.Exists(userdir)) Directory.CreateDirectory(userdir);
103+
if (!File.Exists(userc)) { using var _ = File.Create(userc); }
104+
if (!File.Exists(usermw)) { using var _ = File.Create(usermw); }
105+
if (!File.Exists(userps)) { using var _ = File.Create(userps); }
106+
if (!File.Exists(userug1)) { using var _ = File.Create(userug1); }
107+
if (!File.Exists(userug2)) { using var _ = File.Create(userug2); }
87108
}
88109

89110
public static void ThreadExceptionHandler(object sender, ThreadExceptionEventArgs e)
@@ -112,8 +133,8 @@ public static void ThreadExceptionHandler(object sender, ThreadExceptionEventArg
112133
if (form is Editor editor)
113134
{
114135

115-
editor.EmergencySaveDatabase();
116-
MessageBox.Show("Database backup up.", "Done");
136+
//editor.EmergencySaveDatabase();
137+
//MessageBox.Show("Database backup up.", "Done");
117138

118139
}
119140

0 commit comments

Comments
 (0)