mirror of
https://github.com/oldmud0/LilithPort.git
synced 2024-11-21 14:16:16 +01:00
Fixed Fighter Maker compatibility
This commit is contained in:
parent
6ba05ca392
commit
74414edca8
6 changed files with 27 additions and 10 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -32,3 +32,4 @@ ipch*/
|
|||
*.ipch
|
||||
LilithPort.sdf
|
||||
LilithPortCLI/
|
||||
*.VC.opendb
|
||||
|
|
|
@ -1124,11 +1124,10 @@ void MainForm::ReceivePackets(IAsyncResult^ asyncResult)
|
|||
|
||||
// 格ツクじゃないよ
|
||||
try{
|
||||
//TODO: change FM exe check
|
||||
String^ exe = gcnew String(MTOPTION.GAME_EXE);
|
||||
FileVersionInfo^ info = FileVersionInfo::GetVersionInfo(exe);
|
||||
|
||||
if(info->FileDescription != L"2D格闘ツクール2nd." && info->FileDescription != L"2D格闘ツクール95"){
|
||||
if(!IsCompatibleFMExecutable(info->FileDescription)){
|
||||
throw gcnew Exception;
|
||||
}
|
||||
/*
|
||||
|
@ -1143,7 +1142,7 @@ void MainForm::ReceivePackets(IAsyncResult^ asyncResult)
|
|||
if((INT32)(Path::GetFileNameWithoutExtension(exe)->GetHashCode()) != BitConverter::ToInt32(rcv, 3)){
|
||||
send[1] = 0xFE;
|
||||
}
|
||||
if(info->FileDescription == L"2D格闘ツクール2nd."){
|
||||
if(IsCompatibleFM2KExecutable(info->FileDescription)){
|
||||
MTINFO.KGT2K = true;
|
||||
}
|
||||
else{
|
||||
|
@ -1154,7 +1153,7 @@ void MainForm::ReceivePackets(IAsyncResult^ asyncResult)
|
|||
catch(Exception^){
|
||||
send[1] = 0xFF;
|
||||
form->WriteMessage(L"ERROR: This is not a valid 2D Fighter Maker executable.\n", ErrorMessageColor);
|
||||
form->WriteMessage(L"Please go to the settings menu and set it.\n", ErrorMessageColor);
|
||||
form->WriteMessage(L"Please go to the settings menu and set the path to a compatible game executable.\n", ErrorMessageColor);
|
||||
}
|
||||
|
||||
UDP->BeginSend(send, send->Length, ep, gcnew AsyncCallback(SendPackets), UDP);
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
using namespace LilithPort;
|
||||
|
||||
void OptionForm::SaveOption(bool apply){
|
||||
//TODO: change FM exe check
|
||||
MainForm^ parent = safe_cast<MainForm^>(this->Owner);
|
||||
|
||||
try{
|
||||
FileVersionInfo^ info = FileVersionInfo::GetVersionInfo(textBoxGameExe->Text);
|
||||
|
||||
if(info->FileDescription != L"2D格闘ツクール2nd." && info->FileDescription != L"2D格闘ツクール95"){
|
||||
if(!IsCompatibleFMExecutable(info->FileDescription)){
|
||||
throw gcnew Exception;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2407,14 +2407,13 @@ private: System::Windows::Forms::CheckBox^ checkBoxShowResult;
|
|||
openFileDialog1->Title = gcnew String(L"Select a Fighter Maker executable file");
|
||||
openFileDialog1->Filter = gcnew String(L"Executable file (*.exe)|*.exe");
|
||||
|
||||
//TODO: Again, detecting whether it is supported should NOT be dependent on the file description.
|
||||
if(openFileDialog1->ShowDialog() == ::DialogResult::OK){
|
||||
FileVersionInfo^ info = FileVersionInfo::GetVersionInfo(openFileDialog1->FileName);
|
||||
|
||||
if (MTINFO.DEBUG)
|
||||
MessageBox::Show(info->Language + "\n" + info->FileDescription, "Debug: File version info");
|
||||
|
||||
if(info->FileDescription == L"2D格闘ツクール2nd." || info->FileDescription == L"2D格闘ツクール95"){
|
||||
if(IsCompatibleFMExecutable(info->FileDescription)){
|
||||
textBoxGameExe->Text = openFileDialog1->FileName;
|
||||
}
|
||||
else{
|
||||
|
@ -2628,8 +2627,7 @@ private: System::Windows::Forms::CheckBox^ checkBoxShowResult;
|
|||
String^ extension = Path::GetExtension(file[0])->ToLower();
|
||||
FileVersionInfo^ info = FileVersionInfo::GetVersionInfo(file[0]);
|
||||
|
||||
//TODO: game file detection
|
||||
if(extension == ".exe" && (info->FileDescription == L"2D格闘ツクール2nd." || info->FileDescription == L"2D格闘ツクール95")){
|
||||
if(extension == ".exe" && (IsCompatibleFMExecutable(info->FileDescription))) {
|
||||
e->Effect = DragDropEffects::All;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -606,6 +606,22 @@ void SetCaption()
|
|||
LeaveCriticalSection(&CS_CAPTION);
|
||||
}
|
||||
|
||||
bool IsCompatibleFM2KExecutable(String ^ fileDesc)
|
||||
{
|
||||
return fileDesc == L"2D格闘ツクール2nd." ||
|
||||
fileDesc == L"2D Fighter Maker 2015";
|
||||
}
|
||||
|
||||
bool IsCompatibleFM95Executable(String ^ fileDesc)
|
||||
{
|
||||
return fileDesc == L"2D格闘ツクール95";
|
||||
}
|
||||
|
||||
bool IsCompatibleFMExecutable(String ^ fileDesc)
|
||||
{
|
||||
return IsCompatibleFM2KExecutable(fileDesc) || IsCompatibleFM95Executable(fileDesc);
|
||||
}
|
||||
|
||||
// 暗号復号用乱数
|
||||
UINT CipherRand(UINT32 seed)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,10 @@ void DeleteSection(TCHAR* obj);
|
|||
void ChangeStageValue();
|
||||
void SetCaption();
|
||||
|
||||
bool IsCompatibleFM2KExecutable(String^ fileDesc);
|
||||
bool IsCompatibleFM95Executable(String^ fileDesc);
|
||||
bool IsCompatibleFMExecutable(String^ fileDesc);
|
||||
|
||||
String^ EncryptionIP(String^ ip);
|
||||
String^ MTEncryptionIP(String^ ip);
|
||||
_int64 DecryptionIP(String^ cipher_ip, bool enc);
|
||||
|
|
Loading…
Reference in a new issue