main windows can handle dropped lua script from now.

This commit is contained in:
gocha 2009-09-30 04:52:52 +00:00
parent bc1d031b29
commit 3af6e8075b
1 changed files with 18 additions and 0 deletions

View File

@ -3417,6 +3417,24 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
}
}
//-------------------------------------------------------
//Check if Lua script file
//-------------------------------------------------------
if (!(fileDropped.find(".lua") == string::npos) && (fileDropped.find(".lua") == fileDropped.length()-4)) //ROM is already loaded and .dsm in filename
{
if(LuaScriptHWnds.size() < 16)
{
char temp [1024];
strcpy(temp, fileDropped.c_str());
HWND IsScriptFileOpen(const char* Path);
if(!IsScriptFileOpen(temp))
{
HWND hDlg = CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_LUA), MainWindow->getHWnd(), (DLGPROC) LuaScriptProc);
SendDlgItemMessage(hDlg,IDC_EDIT_LUAPATH,WM_SETTEXT,0,(LPARAM)temp);
}
}
}
//-------------------------------------------------------
//Else load it as a ROM
//-------------------------------------------------------