Tasedit - enable nav and truncate buttons (with fixes)
This commit is contained in:
parent
f576691091
commit
2aab99feb6
|
@ -223,21 +223,21 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Close\tAlt+F4", ID_TASEDIT_FILE_CLOSE
|
||||
END
|
||||
POPUP "&Edit", INACTIVE
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "&Select All", ID_EDIT_SELECTALL
|
||||
MENUITEM "&Select All", ID_EDIT_SELECTALL, INACTIVE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Cu&t\tCtrl+X", ID_TASEDIT_CUT
|
||||
MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY
|
||||
MENUITEM "&Paste\tCtrl+V", ID_TASEDIT_PASTE
|
||||
MENUITEM "Paste to &New\tCtrl+Shift+V", ID_TASEDIT_PASTETONEW
|
||||
MENUITEM "&Delete\tCtrl+Delete", ID_TASEDIT_DELETE
|
||||
MENUITEM "Cu&t\tCtrl+X", ID_TASEDIT_CUT, INACTIVE
|
||||
MENUITEM "&Copy\tCtrl+C", ID_TASEDIT_COPY, INACTIVE
|
||||
MENUITEM "&Paste\tCtrl+V", ID_TASEDIT_PASTE, INACTIVE
|
||||
MENUITEM "Paste to &New\tCtrl+Shift+V", ID_TASEDIT_PASTETONEW, INACTIVE
|
||||
MENUITEM "&Delete\tCtrl+Delete", ID_TASEDIT_DELETE, INACTIVE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Add Marker", ID_EDIT_ADDMARKER
|
||||
MENUITEM "&Remove Marker", ID_EDIT_REMOVEMARKER
|
||||
MENUITEM "&Add Marker", ID_EDIT_ADDMARKER, INACTIVE
|
||||
MENUITEM "&Remove Marker", ID_EDIT_REMOVEMARKER, INACTIVE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Truncate\tCtrl+T", ID_EDIT_TRUNCATE
|
||||
MENUITEM "&Branch\tCtrl+B", ID_EDIT_BRANCH
|
||||
MENUITEM "&Branch\tCtrl+B", ID_EDIT_BRANCH, INACTIVE
|
||||
END
|
||||
MENUITEM "&View", ID_VIEW, INACTIVE
|
||||
POPUP "&Help"
|
||||
|
@ -1283,13 +1283,13 @@ MENU TASEDITMENU
|
|||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
CONTROL "",IDC_LIST1,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_OWNERDATA | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,11,324,364
|
||||
PUSHBUTTON "Truncate",IDC_HACKY1,338,46,51,16,WS_DISABLED
|
||||
PUSHBUTTON "Truncate",IDC_HACKY1,338,46,51,16
|
||||
//PUSHBUTTON "Commit",IDC_HACKY2,404,46,51,16,WS_DISABLED
|
||||
LTEXT "Any number of these icon buttons are pressed",IDC_STATIC,395,84,47,34
|
||||
PUSHBUTTON "<",TASEDIT_REWIND,367,25,26,14,WS_DISABLED
|
||||
PUSHBUTTON ">",TASEDIT_FOWARD,391,25,26,14,WS_DISABLED
|
||||
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,341,25,26,14,WS_DISABLED
|
||||
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,417,25,26,14,WS_DISABLED
|
||||
PUSHBUTTON "<",TASEDIT_REWIND,367,25,26,14
|
||||
PUSHBUTTON ">",TASEDIT_FOWARD,391,25,26,14
|
||||
PUSHBUTTON "<<",TASEDIT_REWIND_FULL,341,25,26,14
|
||||
PUSHBUTTON ">>",TASEDIT_FOWARD_FULL,417,25,26,14
|
||||
GROUPBOX "Static",IDC_STATIC,335,11,120,176
|
||||
GROUPBOX "Project Input Logs",IDC_STATIC,335,200,120,175
|
||||
PUSHBUTTON "Record P1",IDC_BUTTON5,340,95,50,14,WS_DISABLED
|
||||
|
|
|
@ -237,13 +237,16 @@ void InvalidateGreenZone(int after)
|
|||
*/
|
||||
bool JumpToFrame(int index)
|
||||
{
|
||||
if (index<0) return false;
|
||||
|
||||
/* Work only within the greenzone. */
|
||||
if (index>currMovieData.greenZoneCount)
|
||||
{
|
||||
return JumpToFrame(currMovieData.greenZoneCount);
|
||||
}
|
||||
|
||||
if (!currMovieData.records[index].savestate.empty() &&
|
||||
if (index<currMovieData.records.size() &&
|
||||
!currMovieData.records[index].savestate.empty() &&
|
||||
MovieData::loadSavestateFrom(&currMovieData.records[index].savestate))
|
||||
{
|
||||
currFrameCounter = index;
|
||||
|
@ -255,15 +258,19 @@ bool JumpToFrame(int index)
|
|||
if (FCEUI_EmulationPaused())
|
||||
FCEUI_ToggleEmulationPause();
|
||||
|
||||
int i = index-1;
|
||||
if (i>=currMovieData.records.size())
|
||||
i=currMovieData.records.size()-1;
|
||||
|
||||
/* Search for an earlier frame, and try warping to the current. */
|
||||
for (int i=index-1; i>0; --i)
|
||||
for (; i>0; --i)
|
||||
{
|
||||
if (!currMovieData.records[index].savestate.empty() &&
|
||||
MovieData::loadSavestateFrom(&currMovieData.records[index].savestate))
|
||||
if (!currMovieData.records[i].savestate.empty() &&
|
||||
MovieData::loadSavestateFrom(&currMovieData.records[i].savestate))
|
||||
{
|
||||
currFrameCounter=i;
|
||||
turbo=i+256<index; // turbo unless close
|
||||
pauseframe=index;
|
||||
turbo=i+60<index; // turbo unless close
|
||||
pauseframe=index+1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -273,8 +280,8 @@ bool JumpToFrame(int index)
|
|||
PowerNES();
|
||||
disableBatteryLoading = 0;
|
||||
currFrameCounter=0;
|
||||
turbo = index>256;
|
||||
pauseframe=index;
|
||||
turbo = index>60;
|
||||
pauseframe=index+1;
|
||||
}
|
||||
|
||||
// Simply do a reset.
|
||||
|
@ -932,17 +939,21 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
|
||||
case TASEDIT_FOWARD:
|
||||
//advance 1 frame
|
||||
JumpToFrame(currFrameCounter+1);
|
||||
break;
|
||||
|
||||
case TASEDIT_REWIND:
|
||||
//rewinds 1 frame
|
||||
JumpToFrame(currFrameCounter-1);
|
||||
break;
|
||||
|
||||
case TASEDIT_REWIND_FULL:
|
||||
//rewinds to beginning of movie
|
||||
JumpToFrame(0);
|
||||
break;
|
||||
case TASEDIT_FOWARD_FULL:
|
||||
//moves to the end of the move (or green zone?)
|
||||
JumpToFrame(currMovieData.records.size()-1 );
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue