Skip to content

Commit

Permalink
Fixed Not launching after clean install.
Browse files Browse the repository at this point in the history
foxed Pinky shift Stuck.
  • Loading branch information
chihirobelmo committed Mar 12, 2019
1 parent e1144df commit 72918f3
Show file tree
Hide file tree
Showing 7 changed files with 661 additions and 466 deletions.
19 changes: 19 additions & 0 deletions FalconBMS Alternative Launcher Cs/AppRegInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,25 @@ public AppRegInfo(MainWindow mainWindow)
return;
}

byte[] bs;
if (regkey.GetValue("PilotName") == null)
{
this.regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regName, true);
bs = new byte[] { 0x4a, 0x6f, 0x65, 0x20, 0x50, 0x69, 0x6c, 0x6f, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
regkey.SetValue("PilotName", bs);
}
if (regkey.GetValue("PilotCallsign") == null)
{
this.regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regName, true);
bs = new byte[] { 0x56, 0x69, 0x70, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
regkey.SetValue("PilotCallsign", bs);
}
if (regkey.GetValue("curTheater") == null)
{
this.regkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(regName, true);
regkey.SetValue("curTheater", "Korea KTO");
}

this.installDir = (string)regkey.GetValue("baseDir");
this.currentTheater = (string)regkey.GetValue("curTheater");
this.pilotCallsign = (Encoding.UTF8.GetString((byte[])regkey.GetValue("PilotCallsign"))).Replace("\0", "");
Expand Down
15 changes: 15 additions & 0 deletions FalconBMS Alternative Launcher Cs/DeviceControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public DeviceControl(AppRegInfo appReg)
System.Xml.Serialization.XmlSerializer serializer;
System.IO.StreamReader sr;
string fileName = "";
string stockFileName = "";
int i = 0;

foreach (DeviceInstance dev in devList)
Expand All @@ -58,6 +59,20 @@ public DeviceControl(AppRegInfo appReg)
joyAssign[i] = (JoyAssgn)serializer.Deserialize(sr);
sr.Close();
}
else
{
stockFileName = appReg.GetInstallDir() + "/User/Config/Setup.v100." + joyAssign[i].GetProductName().Replace("/", "-")
+ " {Stock}.xml";
if (File.Exists(stockFileName))
{
File.Copy(stockFileName, fileName);

serializer = new System.Xml.Serialization.XmlSerializer(typeof(JoyAssgn));
sr = new System.IO.StreamReader(fileName, new System.Text.UTF8Encoding(false));
joyAssign[i] = (JoyAssgn)serializer.Deserialize(sr);
sr.Close();
}
}
joyAssign[i].SetDeviceInstance(dev);
i += 1;
}
Expand Down
22 changes: 22 additions & 0 deletions FalconBMS Alternative Launcher Cs/JoyAssgn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,28 @@ public string GetKeyLineDX(int joynum, int numOfDevices)
{
if (this.dx[i].assign[ii].GetCallback() == "SimDoNothing")
continue;
if (this.dx[i].assign[ii].GetCallback() == "SimHotasPinkyShift")
{
if (ii != 0)
continue;
assign += this.dx[i].assign[ii].GetCallback();
assign += " " + (joynum * 32 + i).ToString();
assign += " " + ((int)Invoke.Default).ToString();
assign += " " + "-2";
assign += " " + "0";
assign += " " + "0x0";
assign += " " + this.dx[i].assign[ii].GetSoundID();
assign += "\n";
assign += this.dx[i].assign[ii].GetCallback();
assign += " " + (numOfDevices * 32 + joynum * 32 + i).ToString();
assign += " " + ((int)Invoke.Default).ToString();
assign += " " + "-2";
assign += " " + "0";
assign += " " + "0x0";
assign += " " + this.dx[i].assign[ii].GetSoundID();
assign += "\n";
continue;
}
assign += this.dx[i].assign[ii].GetCallback();
if (ii == 0 | ii == 2)
assign += " " + (joynum * 32 + i).ToString();
Expand Down
Loading

0 comments on commit 72918f3

Please sign in to comment.