From e6c08973289305f5314fbee5431c111fe3ad37aa Mon Sep 17 00:00:00 2001 From: gocha Date: Thu, 15 Oct 2009 06:12:02 +0000 Subject: [PATCH] win32: main window now accepts dropped *.lua and *.wch files. --- desmume/src/windows/main.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 8ff13790f..fb20fda9c 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -3421,7 +3421,7 @@ 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 + else if (!(fileDropped.find(".lua") == string::npos) && (fileDropped.find(".lua") == fileDropped.length()-4)) //ROM is already loaded and .dsm in filename { if(LuaScriptHWnds.size() < 16) { @@ -3436,6 +3436,21 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM } } + //------------------------------------------------------- + //Check if watchlist file + //------------------------------------------------------- + else if (!(fileDropped.find(".wch") == string::npos) && (fileDropped.find(".wch") == fileDropped.length()-4)) //ROM is already loaded and .dsm in filename + { + if(!RamWatchHWnd) + { + RamWatchHWnd = CreateDialog(hAppInst, MAKEINTRESOURCE(IDD_RAMWATCH), hwnd, (DLGPROC) RamWatchProc); + // DialogsOpen++; + } + else + SetForegroundWindow(RamWatchHWnd); + Load_Watches(true, fileDropped.c_str()); + } + //------------------------------------------------------- //Else load it as a ROM //-------------------------------------------------------