diff --git a/changelog.txt b/changelog.txt index f88197df..1a7377fc 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +16-mar-2009 - adelikat - Win32 - GUI Dialog - added an option to disable the context menu 15-mar-2009 - adelikat - Lua - added movie.rerecordcount(), movie.length(), movie.getname(), movie.playbeginning(), FCEU.getreadonly(), FCEU.setreadonly() 14-mar-2009 - adelikat - Lua - added movie.active() - returns a bool value based on whether a movie is currently loaded 14-mar-2009 - adelikat - Fixed Joypad.set, it uses 3 values instead of 2 now. True will take control of a button and make it on, False will take control and make it off, and Nil will not take control (allowing the user to press the button) diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 98a32af9..5c49cd49 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -54,6 +54,7 @@ extern bool bindSavestate; extern int PPUViewRefresh; extern int NTViewRefresh; extern uint8 gNoBGFillColor; +extern bool rightClickEnabled; //window positions and sizes: extern int ChtPosX,ChtPosY; @@ -239,6 +240,7 @@ static CFGSTRUCT fceuconfig[] = { AC(ClipSidesOffset), AC(PPUViewRefresh), AC(NTViewRefresh), + AC(rightClickEnabled), //ACS(memwLastfile[2048]), ENDCFGSTRUCT }; diff --git a/src/drivers/win/guiconfig.cpp b/src/drivers/win/guiconfig.cpp index 7a5506f1..6b3d21a3 100644 --- a/src/drivers/win/guiconfig.cpp +++ b/src/drivers/win/guiconfig.cpp @@ -2,6 +2,8 @@ #include "main.h" #include "gui.h" +extern bool rightClickEnabled; //Declared in window.cpp and only an extern here + /** * Processes information from the GUI options dialog after * the dialog was closed. @@ -40,6 +42,16 @@ void CloseGuiDialog(HWND hwndDlg) goptions |= GOO_DISABLESS; } + if(IsDlgButtonChecked(hwndDlg, CB_ENABLECONTEXTMENU)==BST_CHECKED) + { + rightClickEnabled = true; + } + + else + { + rightClickEnabled = false; + } + EndDialog(hwndDlg,0); } @@ -72,6 +84,11 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) CheckDlgButton(hwndDlg, CB_DISABLE_SCREEN_SAVER, BST_CHECKED); } + if(rightClickEnabled) + { + CheckDlgButton(hwndDlg, CB_ENABLECONTEXTMENU, BST_CHECKED); + } + CenterWindowOnScreen(hwndDlg); break; diff --git a/src/drivers/win/help/fceux.chm b/src/drivers/win/help/fceux.chm index 819cee86..877e6657 100644 Binary files a/src/drivers/win/help/fceux.chm and b/src/drivers/win/help/fceux.chm differ diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 7f1a83cf..05ac8ee1 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -551,12 +551,12 @@ BEGIN PUSHBUTTON "Turbo A",318,195,122,32,12 END -GUICONFIG DIALOGEX 16, 123, 184, 90 +GUICONFIG DIALOGEX 16, 123, 184, 108 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "GUI Configuration" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "Close",BUTTON_CLOSE,64,68,56,14 + DEFPUSHBUTTON "Close",BUTTON_CLOSE,64,86,56,14 CONTROL "Load ""File Open"" dialog when FCEUX starts.",CB_LOAD_FILE_OPEN, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,8,164,12 CONTROL "Automatically hide menu on game load.",CB_AUTO_HIDE_MENU, @@ -564,6 +564,8 @@ BEGIN CONTROL "Ask confirmation on exit attempt.",CB_ASK_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,38,164,12 CONTROL "Disable screen saver while game is loaded.",CB_DISABLE_SCREEN_SAVER, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,53,164,12 + CONTROL "Enable right-click context menu",CB_ENABLECONTEXTMENU, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,70,115,10 END INPUTCONFIG DIALOGEX 122, 105, 349, 199 @@ -1505,7 +1507,7 @@ BEGIN LEFTMARGIN, 10 RIGHTMARGIN, 174 TOPMARGIN, 8 - BOTTOMMARGIN, 82 + BOTTOMMARGIN, 100 END "INPUTCONFIG", DIALOG diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index 2846e5a7..0787a1cf 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -406,6 +406,8 @@ #define BTN_CANCELED 1200 #define ID_SOUND_TRITOP 1201 #define ID_SOUND_QUALITYNOTIFY 1202 +#define IDC_CHECK1 1203 +#define CB_ENABLECONTEXTMENU 1203 #define MENU_NETWORK 40040 #define MENU_PALETTE 40041 #define MENU_SOUND 40042 @@ -689,7 +691,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 125 #define _APS_NEXT_COMMAND_VALUE 40353 -#define _APS_NEXT_CONTROL_VALUE 1203 +#define _APS_NEXT_CONTROL_VALUE 1204 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index eb8c77d0..8465b7e1 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -122,7 +122,10 @@ int MainWindow_wndx, MainWindow_wndy; static uint32 mousex,mousey,mouseb; static int vchanged = 0; int menuYoffset = 0; -//Function Declarations + +bool rightClickEnabled = true; //If set to false, the right click context menu will be disabled. + +//Function Prototypes void ChangeMenuItemText(int menuitem, string text); //Alters a menu item name void ChangeContextMenuItemText(int menuitem, string text, HMENU menu); //Alters a context menu item name @@ -933,41 +936,44 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) case WM_RBUTTONUP: { - hfceuxcontext = LoadMenu(fceu_hInstance,"FCEUCONTEXTMENUS"); + if (rightClickEnabled) + { + hfceuxcontext = LoadMenu(fceu_hInstance,"FCEUCONTEXTMENUS"); - //If There is a movie loaded in read only - if (GameInfo && FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD) && movie_readonly) - { - hfceuxcontextsub = GetSubMenu(hfceuxcontext,0); - whichContext = 0; - } - - //If there is a movie loaded in read+write - else if (GameInfo && FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD) && !movie_readonly) - { - hfceuxcontextsub = GetSubMenu(hfceuxcontext,3); - whichContext = 3; - } + //If There is a movie loaded in read only + if (GameInfo && FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD) && movie_readonly) + { + hfceuxcontextsub = GetSubMenu(hfceuxcontext,0); + whichContext = 0; + } + + //If there is a movie loaded in read+write + else if (GameInfo && FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD) && !movie_readonly) + { + hfceuxcontextsub = GetSubMenu(hfceuxcontext,3); + whichContext = 3; + } - - //If there is a ROM loaded but no movie - else if (GameInfo) - { - hfceuxcontextsub = GetSubMenu(hfceuxcontext,1); - whichContext = 1; + + //If there is a ROM loaded but no movie + else if (GameInfo) + { + hfceuxcontextsub = GetSubMenu(hfceuxcontext,1); + whichContext = 1; + } + + //Else no ROM + else + { + hfceuxcontextsub = GetSubMenu(hfceuxcontext,2); + whichContext = 2; + } + UpdateContextMenuItems(hfceuxcontextsub, whichContext); + pt.x = LOWORD(lParam); //Get mouse x in terms of client area + pt.y = HIWORD(lParam); //Get mouse y in terms of client area + ClientToScreen(hAppWnd, (LPPOINT) &pt); //Convert client area x,y to screen x,y + TrackPopupMenu(hfceuxcontextsub,0,(pt.x),(pt.y),TPM_RIGHTBUTTON,hWnd,0); //Create menu } - - //Else no ROM - else - { - hfceuxcontextsub = GetSubMenu(hfceuxcontext,2); - whichContext = 2; - } - UpdateContextMenuItems(hfceuxcontextsub, whichContext); - pt.x = LOWORD(lParam); //Get mouse x in terms of client area - pt.y = HIWORD(lParam); //Get mouse y in terms of client area - ClientToScreen(hAppWnd, (LPPOINT) &pt); //Convert client area x,y to screen x,y - TrackPopupMenu(hfceuxcontextsub,0,(pt.x),(pt.y),TPM_RIGHTBUTTON,hWnd,0); //Create menu } case WM_MOVE: diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 14497ed6..b56bbda7 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -872,14 +872,7 @@ static int savestate_load(lua_State *L) { // // Gets the frame counter for the movie, or nil if no movie running. int movie_framecount(lua_State *L) { - /* // qfox, 08-11-21; fceu now counts the number of frames - //since the last reset if no movie is playing - if (!FCEUMOV_IsPlaying() && !FCEUMOV_IsRecording()) { - lua_pushnil(L); - return 1; - } - */ - + lua_pushinteger(L, FCEUMOV_GetFrame()); return 1; }