From 4e81ece9ed2b2d3ec3878fea81095002604bd60d Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 2 Aug 2008 17:37:11 +0000 Subject: [PATCH] oh yeah i forgot to check that in --- src/config.cpp | 1 + src/drivers/win/window.cpp | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index ed5b6931..5a2212bf 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -27,6 +27,7 @@ FCEUX\n\ - SP, zeromus\n\ - CaH4e3, Luke Gustafson, qfox\n\ - adelikat, _mz, nitsujrehtona\n\ + - Lukas Sabota \n\ \n\ "__TIME__" "__DATE__"\n"; diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index bf9c1e6b..8a093378 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1640,10 +1640,25 @@ INT_PTR CALLBACK DlgLuaScriptDialog(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l void FCEUD_LuaRunFrom(void) { - int success = 0; + int success = 0; - //StopSound(); + //mbg 8/2/08 - i decided i didnt like this dialog box. so for now we are just going to run the script directly + //DialogBoxParam(fceu_hInstance, "IDD_LUA_ADD", hAppWnd, DlgLuaScriptDialog,(LPARAM) &success); - DialogBoxParam(fceu_hInstance, "IDD_LUA_ADD", hAppWnd, DlgLuaScriptDialog,(LPARAM) &success); + OPENFILENAME ofn; + char szFileName[MAX_PATH]; + szFileName[0] = '\0'; + ZeroMemory( (LPVOID)&ofn, sizeof(OPENFILENAME) ); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hAppWnd; + ofn.lpstrFilter = "Lua scripts\0*.lua\0All files\0*.*\0\0"; + ofn.lpstrFile = szFileName; + ofn.lpstrDefExt = "lua"; + ofn.nMaxFile = MAX_PATH; + ofn.Flags = OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; // hide previously-ignored read-only checkbox (the real read-only box is in the open-movie dialog itself) + if(GetOpenFileName( &ofn )) + { + FCEU_LoadLuaCode(szFileName); + } }