Skip to content

Commit 73aafff

Browse files
v2.2.0 (#80)
* FalconBMS official color applied * VR option added * support BMS4.38 Internal test version * set assembly info as a BMS Launcher (not alternative) * installer info update * removed un-needed updater attempt * fix 4.38 to show 4.38 number * show VR toggle for 4.37 * added VR starter * 4.36I uses 4.37 override * added WINWING Orion * Check if installed files really exists. In case of removing BMS files but not registry. * try-catch open sub key * Made a shortcut to Updater * no need bit-swarm * no need update xml * Update label lights blue * Reg key check fixed * log fix * disable this routine for the time being * Fix not launching who don't have VR. * Don't clear category dropdown after assigning control (#79) * bms-logcat.exe crash fix * fix VR setting not saved * remove callsign window for now, * g_nVRHMD Co-authored-by: Daniel Tian <[email protected]>
1 parent 426526b commit 73aafff

37 files changed

+3946
-693
lines changed

Falcon BMS Alternative Launcher Setup/Falcon BMS Alternative Launcher Setup.vdproj

+105-105
Large diffs are not rendered by default.

Falcon BMS Alternative Launcher.sln

-14
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Falcon BMS Alternative Laun
77
EndProject
88
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Falcon BMS Alternative Launcher Setup", "Falcon BMS Alternative Launcher Setup\Falcon BMS Alternative Launcher Setup.vdproj", "{476CFD8D-0EBB-4CAC-A053-77480B27ABDC}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update Information Generator", "Update Information Generator\Update Information Generator.csproj", "{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}"
11-
EndProject
1210
Global
1311
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1412
Debug|Any CPU = Debug|Any CPU
@@ -41,18 +39,6 @@ Global
4139
{476CFD8D-0EBB-4CAC-A053-77480B27ABDC}.Release|x64.Build.0 = Release
4240
{476CFD8D-0EBB-4CAC-A053-77480B27ABDC}.Release|x86.ActiveCfg = Release
4341
{476CFD8D-0EBB-4CAC-A053-77480B27ABDC}.Release|x86.Build.0 = Release
44-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
46-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|x64.ActiveCfg = Debug|Any CPU
47-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|x64.Build.0 = Debug|Any CPU
48-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|x86.ActiveCfg = Debug|Any CPU
49-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Debug|x86.Build.0 = Debug|Any CPU
50-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
51-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|Any CPU.Build.0 = Release|Any CPU
52-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|x64.ActiveCfg = Release|Any CPU
53-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|x64.Build.0 = Release|Any CPU
54-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|x86.ActiveCfg = Release|Any CPU
55-
{3A6F35D5-0FE8-4AC4-890E-0A0624A8A5BF}.Release|x86.Build.0 = Release|Any CPU
5642
EndGlobalSection
5743
GlobalSection(SolutionProperties) = preSolution
5844
HideSolutionNode = FALSE

Falcon BMS Alternative Launcher/App.config

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
<setting name="BMS_Version" serializeAs="String">
7878
<value>Falcon4.0</value>
7979
</setting>
80+
<setting name="Misc_VR" serializeAs="String">
81+
<value>False</value>
82+
</setting>
8083
</FalconBMS.Launcher.Properties.Settings>
8184
<FalconBMS_Alternative_Launcher_Cs.Properties.Settings>
8285
<setting name="Platform" serializeAs="String">

Falcon BMS Alternative Launcher/App.xaml.cs

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ private static void App_DispatcherUnhandledException(object sender, DispatcherUn
3434

3535
MessageBox.Show("An unknown error has occured. Contact support if this problem persists.", "Error",
3636
MessageBoxButton.OK, MessageBoxImage.Error);
37+
Diagnostics.Log(e.Exception);
38+
Diagnostics.WriteLogFile();
3739

3840
e.Handled = true;
3941
}

Falcon BMS Alternative Launcher/AppProperties.cs

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public AppProperties(MainWindow mainWindow)
3030
mainWindow.Misc_SmartScalingOverride.IsChecked = Properties.Settings.Default.Misc_SmartScalingOverride;
3131
mainWindow.Misc_NaturalHeadMovement.IsChecked = Properties.Settings.Default.Misc_NaturalHeadMovement;
3232
mainWindow.Misc_PilotModel.IsChecked = Properties.Settings.Default.Misc_PilotModel;
33+
mainWindow.Misc_VR.IsChecked = Properties.Settings.Default.Misc_VR;
3334

3435
// Button Status Default
3536
mainWindow.Select_DX_Release.IsChecked = true;
@@ -57,6 +58,7 @@ public void SaveUISetup()
5758
Properties.Settings.Default.Misc_SmartScalingOverride = (bool)mainWindow.Misc_SmartScalingOverride.IsChecked;
5859
Properties.Settings.Default.Misc_NaturalHeadMovement = (bool)mainWindow.Misc_NaturalHeadMovement.IsChecked;
5960
Properties.Settings.Default.Misc_PilotModel = (bool)mainWindow.Misc_PilotModel.IsChecked;
61+
Properties.Settings.Default.Misc_VR = (bool)mainWindow.Misc_VR.IsChecked;
6062
Properties.Settings.Default.Save();
6163
}
6264

Falcon BMS Alternative Launcher/AppRegInfo.cs

+99-59
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class AppRegInfo
5454

5555
public string[] availableBMSVersions =
5656
{
57+
"Falcon BMS 4.38 (Internal)",
5758
"Falcon BMS 4.37 (Internal)",
5859
"Falcon BMS 4.37",
5960
"Falcon BMS 4.36 (Internal)",
@@ -74,12 +75,18 @@ public AppRegInfo(MainWindow mainWindow)
7475
{
7576
if (Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Wow6432Node\\Benchmark Sims\\" + version, false) == null)
7677
continue;
77-
mainWindow.ListBox_BMS.Items.Add(version);
78+
79+
if (BMSExists(version))
80+
mainWindow.ListBox_BMS.Items.Add(version);
81+
else
82+
continue;
83+
7884
if (flg)
7985
{
8086
selectedVersion = version;
8187
flg = false;
8288
}
89+
8390
if (version == Properties.Settings.Default.BMS_Version)
8491
{
8592
selectedVersion = version;
@@ -90,12 +97,98 @@ public AppRegInfo(MainWindow mainWindow)
9097
Init(mainWindow, selectedVersion);
9198
}
9299

100+
public bool BMSExists(string version)
101+
{
102+
string regName64 = "SOFTWARE\\Wow6432Node\\Benchmark Sims\\" + version;
103+
string regName32 = "SOFTWARE\\Benchmark Sims\\" + version;
104+
105+
try
106+
{
107+
RegistryKey regkey64 = Registry.LocalMachine.OpenSubKey(regName64, true);
108+
regName = regName64;
109+
regkey = regkey64;
110+
}
111+
catch (Exception ex1)
112+
{
113+
Diagnostics.Log(regName64);
114+
Diagnostics.Log(ex1);
115+
}
116+
117+
if (regkey == null)
118+
{
119+
try
120+
{
121+
RegistryKey regkey32 = Registry.LocalMachine.OpenSubKey(regName32, true);
122+
123+
if (regkey == null)
124+
{
125+
Diagnostics.Log("No BMS registries found.");
126+
return false;
127+
}
128+
129+
platform = Platform.OS_32bit;
130+
mainWindow.Misc_Platform.IsChecked = false;
131+
mainWindow.Misc_Platform.IsEnabled = false;
132+
133+
regName = regName32;
134+
regkey = regkey32;
135+
}
136+
catch (Exception ex2)
137+
{
138+
Diagnostics.Log(regName32);
139+
Diagnostics.Log(ex2);
140+
return false;
141+
}
142+
143+
if (regkey == null)
144+
{
145+
Diagnostics.Log("No BMS registries found.");
146+
return false;
147+
}
148+
}
149+
150+
byte[] bs;
151+
152+
if (regkey.GetValue("PilotName") == null)
153+
{
154+
bs = Encoding.ASCII.GetBytes("Joe Pilot\0\0\0\0\0\0\0\0\0\0\0");
155+
regkey.SetValue("PilotName", bs);
156+
}
157+
if (regkey.GetValue("PilotCallsign") == null)
158+
{
159+
bs = Encoding.ASCII.GetBytes("Viper\0\0\0\0\0\0\0");
160+
regkey.SetValue("PilotCallsign", bs);
161+
}
162+
if (regkey.GetValue("curTheater") == null)
163+
{
164+
regkey.SetValue("curTheater", "Korea KTO");
165+
}
166+
167+
installDir = (string)regkey.GetValue("baseDir");
168+
currentTheater = (string)regkey.GetValue("curTheater");
169+
170+
pilotCallsign = ReadPilotCallsign((byte[])regkey.GetValue("PilotCallsign"));
171+
172+
if (platform == Platform.OS_64bit)
173+
exeDir = installDir + "\\bin\\x64\\Falcon BMS.exe";
174+
if (platform == Platform.OS_32bit)
175+
exeDir = installDir + "\\bin\\x86\\Falcon BMS.exe";
176+
177+
return File.Exists(exeDir);
178+
}
179+
93180
public void Init(MainWindow mainWindow, string version)
94181
{
95182
this.mainWindow = mainWindow;
96183

97184
switch (version)
98185
{
186+
case "Falcon BMS 4.38 (Internal)":
187+
bms_Version = BMS_Version.BMS438I;
188+
keyFileName = "BMS - Full.key";
189+
overRideSetting = new OverrideSettingFor438(this.mainWindow, this);
190+
starter = new Starter438Internal(this, this.mainWindow);
191+
break;
99192
case "Falcon BMS 4.37 (Internal)":
100193
bms_Version = BMS_Version.BMS437I;
101194
keyFileName = "BMS - Full.key";
@@ -105,7 +198,7 @@ public void Init(MainWindow mainWindow, string version)
105198
case "Falcon BMS 4.36 (Internal)":
106199
bms_Version = BMS_Version.BMS436I;
107200
keyFileName = "BMS - Full.key";
108-
overRideSetting = new OverrideSettingFor436(this.mainWindow, this);
201+
overRideSetting = new OverrideSettingFor437(this.mainWindow, this);
109202
starter = new Starter436Internal(this, this.mainWindow);
110203
break;
111204
case "Falcon BMS 4.37":
@@ -157,62 +250,7 @@ public void Init(MainWindow mainWindow, string version)
157250
break;
158251
}
159252

160-
string regName64 = "SOFTWARE\\Wow6432Node\\Benchmark Sims\\" + version;
161-
string regName32 = "SOFTWARE\\Benchmark Sims\\" + version;
162-
163-
RegistryKey regkey64 = Registry.LocalMachine.OpenSubKey(regName64, true);
164-
RegistryKey regkey32 = Registry.LocalMachine.OpenSubKey(regName32, true);
165-
166-
// Read Registry
167-
if (regkey64 == null)
168-
{
169-
if (regkey32 == null)
170-
{
171-
Properties.Settings.Default.BMS_Version = "Falcon4.0";
172-
MessageBox.Show("Could not find FalconBMS Installed.");
173-
mainWindow.Close();
174-
return;
175-
}
176-
177-
platform = Platform.OS_32bit;
178-
mainWindow.Misc_Platform.IsChecked = false;
179-
mainWindow.Misc_Platform.IsEnabled = false;
180-
181-
regName = regName32;
182-
regkey = regkey32;
183-
}
184-
else
185-
{
186-
regName = regName64;
187-
regkey = regkey64;
188-
}
189-
190-
byte[] bs;
191-
192-
if (regkey.GetValue("PilotName") == null)
193-
{
194-
bs = Encoding.ASCII.GetBytes("Joe Pilot\0\0\0\0\0\0\0\0\0\0\0");
195-
regkey.SetValue("PilotName", bs);
196-
}
197-
if (regkey.GetValue("PilotCallsign") == null)
198-
{
199-
bs = Encoding.ASCII.GetBytes("Viper\0\0\0\0\0\0\0");
200-
regkey.SetValue("PilotCallsign", bs);
201-
}
202-
if (regkey.GetValue("curTheater") == null)
203-
{
204-
regkey.SetValue("curTheater", "Korea KTO");
205-
}
206-
207-
installDir = (string)regkey.GetValue("baseDir");
208-
currentTheater = (string)regkey.GetValue("curTheater");
209-
210-
pilotCallsign = ReadPilotCallsign((byte[])regkey.GetValue("PilotCallsign"));
211-
212-
if (platform == Platform.OS_64bit)
213-
exeDir = installDir + "\\bin\\x64\\Falcon BMS.exe";
214-
if (platform == Platform.OS_32bit)
215-
exeDir = installDir + "\\bin\\x86\\Falcon BMS.exe";
253+
BMSExists(version);
216254

217255
updateVersion = CheckUpdateVersion();
218256

@@ -374,6 +412,8 @@ public enum BMS_Version
374412
BMS436I,
375413
BMS436,
376414
BMS437I,
377-
BMS437
415+
BMS437,
416+
BMS438I,
417+
BMS438
378418
}
379419
}

Falcon BMS Alternative Launcher/Falcon BMS Alternative Launcher.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@
126126
<Compile Include="Input\DxAssgn.cs" />
127127
<Compile Include="Input\InGameAxAssgn.cs" />
128128
<Compile Include="Input\KeyFile.cs" />
129+
<Compile Include="Override\OverrideSettingFor438.cs" />
129130
<Compile Include="Starter\Starter436I.cs" />
131+
<Compile Include="Starter\Starter438I.cs" />
130132
<Compile Include="Starter\Starter437I.cs" />
131133
<Compile Include="Starter\Starter437.cs" />
132134
<Compile Include="Starter\Starter436.cs" />
@@ -141,6 +143,7 @@
141143
<Compile Include="Override\OverrideSettingFor435.cs" />
142144
<Compile Include="Override\OverrideSettingFor436.cs" />
143145
<Compile Include="Override\OverrideSettingFor437.cs" />
146+
<Compile Include="SteamVR.cs" />
144147
<Compile Include="Torrent.cs" />
145148
<Compile Include="Update\Update.cs" />
146149
<Compile Include="Windows\CallsignWindow.xaml.cs">
@@ -343,6 +346,12 @@
343346
<ItemGroup>
344347
<Resource Include="AutoUpdate.xml" />
345348
</ItemGroup>
349+
<ItemGroup>
350+
<Resource Include="Stock\Setup.v100.WINWING Orion Throttle Base II TGRIP-F16 {Stock}.xml" />
351+
</ItemGroup>
352+
<ItemGroup>
353+
<Resource Include="Resources\UPD.png" />
354+
</ItemGroup>
346355
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
347356
<Target Name="AfterResolveReferences">
348357
<ItemGroup>

Falcon BMS Alternative Launcher/Override/OverrideSettingFor437.cs

+48
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,53 @@ public class OverrideSettingFor437 : OverrideSettingFor436
1414
public OverrideSettingFor437(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
1515
{
1616
}
17+
18+
protected override void SaveConfigfile(Hashtable inGameAxis, DeviceControl deviceControl)
19+
{
20+
string filename = appReg.GetInstallDir() + "/User/Config/falcon bms.cfg";
21+
string fbackupname = appReg.GetInstallDir() + "/User/Config/Backup/falcon bms.cfg";
22+
if (!File.Exists(fbackupname) & File.Exists(filename))
23+
File.Copy(filename, fbackupname, true);
24+
25+
if (File.Exists(filename))
26+
File.SetAttributes(filename, File.GetAttributes(filename) & ~FileAttributes.ReadOnly);
27+
28+
StreamReader cReader = new StreamReader
29+
(filename, Encoding.Default);
30+
string stResult = "";
31+
while (cReader.Peek() >= 0)
32+
{
33+
string stBuffer = cReader.ReadLine();
34+
if (stBuffer.Contains("// SETUP OVERRIDE"))
35+
continue;
36+
stResult += stBuffer + "\r\n";
37+
}
38+
cReader.Close();
39+
40+
StreamWriter cfg = new StreamWriter
41+
(filename, false, Encoding.GetEncoding("shift_jis"));
42+
cfg.Write(stResult);
43+
cfg.Write("set g_nButtonsPerDevice " + CommonConstants.DX128
44+
+ " // SETUP OVERRIDE\r\n");
45+
cfg.Write("set g_nHotasPinkyShiftMagnitude " + deviceControl.joyAssign.Length * CommonConstants.DX128
46+
+ " // SETUP OVERRIDE\r\n");
47+
cfg.Write("set g_bHotasDgftSelfCancel " + Convert.ToInt32(mainWindow.Misc_OverrideSelfCancel.IsChecked)
48+
+ " // SETUP OVERRIDE\r\n");
49+
cfg.Write("set g_b3DClickableCursorAnchored " + Convert.ToInt32(mainWindow.Misc_MouseCursorAnchor.IsChecked)
50+
+ " // SETUP OVERRIDE\r\n");
51+
cfg.Write("set g_nVRHMD " + Convert.ToInt32(mainWindow.Misc_VR.IsChecked)
52+
+ " // SETUP OVERRIDE\r\n");
53+
if (((InGameAxAssgn)inGameAxis["Roll"]).GetDeviceNumber() == ((InGameAxAssgn)inGameAxis["Throttle"]).GetDeviceNumber())
54+
{
55+
cfg.Close();
56+
return;
57+
}
58+
cfg.Write("set g_nNumOfPOVs 2 // SETUP OVERRIDE\r\n");
59+
cfg.Write("set g_nPOV1DeviceID " + (((InGameAxAssgn)inGameAxis["Roll"]).GetDeviceNumber() + 2) + " // SETUP OVERRIDE\r\n");
60+
cfg.Write("set g_nPOV1ID 0 // SETUP OVERRIDE\r\n");
61+
cfg.Write("set g_nPOV2DeviceID " + (((InGameAxAssgn)inGameAxis["Throttle"]).GetDeviceNumber() + 2) + " // SETUP OVERRIDE\r\n");
62+
cfg.Write("set g_nPOV2ID 0 // SETUP OVERRIDE\r\n");
63+
cfg.Close();
64+
}
1765
}
1866
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections;
3+
using System.IO;
4+
using System.Text;
5+
using System.Xml.Serialization;
6+
7+
using FalconBMS.Launcher.Input;
8+
using FalconBMS.Launcher.Windows;
9+
10+
namespace FalconBMS.Launcher.Override
11+
{
12+
public class OverrideSettingFor438 : OverrideSettingFor437
13+
{
14+
public OverrideSettingFor438(MainWindow mainWindow, AppRegInfo appReg) : base(mainWindow, appReg)
15+
{
16+
}
17+
}
18+
}

Falcon BMS Alternative Launcher/Program.cs

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc
4242

4343
MessageBox.Show("An unknown error has occured. Contact support if this problem persists.", "Error",
4444
MessageBoxButton.OK, MessageBoxImage.Error);
45+
Diagnostics.Log(e.ExceptionObject.ToString());
46+
Diagnostics.WriteLogFile();
4547

4648
//e.Handled = true;
4749
}

0 commit comments

Comments
 (0)