* Tasedit: modeless FindNote window
* allow tabbing in Cheat console (#3384776)
This commit is contained in:
parent
b3c53d5ad5
commit
4c8af77326
|
@ -27,7 +27,7 @@
|
|||
#include "../../cart.h"
|
||||
|
||||
static HWND pwindow = 0; //Handle to Cheats dialog
|
||||
HWND hCheat; //mbg merge 7/19/06 had to add
|
||||
HWND hCheat = 0; //mbg merge 7/19/06 had to add
|
||||
static HMENU hCheatcontext; //Handle to context menu
|
||||
static HMENU hCheatcontextsub; //Handle to context sub menu
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@ extern bool TASEdit_show_branch_screenshots;
|
|||
extern bool TASEdit_show_branch_tooltips;
|
||||
extern bool TASEdit_bind_markers;
|
||||
extern bool TASEdit_empty_marker_notes;
|
||||
extern bool TASEdit_findnote_reappear;
|
||||
extern bool TASEdit_combine_consecutive_rec;
|
||||
extern bool TASEdit_use_1p_rec;
|
||||
extern bool TASEdit_columnset_by_keys;
|
||||
|
@ -124,6 +123,7 @@ extern int Tracer_wndx, Tracer_wndy;
|
|||
extern int CDLogger_wndx, CDLogger_wndy;
|
||||
extern int GGConv_wndx, GGConv_wndy;
|
||||
extern int TasEdit_wndx, TasEdit_wndy;
|
||||
extern int FindNote_wndx, FindNote_wndy;
|
||||
extern int MetaPosX,MetaPosY;
|
||||
extern int MLogPosX,MLogPosY;
|
||||
|
||||
|
@ -321,6 +321,8 @@ static CFGSTRUCT fceuconfig[] = {
|
|||
AC(GGConv_wndy),
|
||||
AC(TasEdit_wndx),
|
||||
AC(TasEdit_wndy),
|
||||
AC(FindNote_wndx),
|
||||
AC(FindNote_wndy),
|
||||
AC(TextHookerPosX),
|
||||
AC(TextHookerPosY),
|
||||
AC(MetaPosX),
|
||||
|
@ -343,7 +345,6 @@ static CFGSTRUCT fceuconfig[] = {
|
|||
AC(TASEdit_show_branch_tooltips),
|
||||
AC(TASEdit_bind_markers),
|
||||
AC(TASEdit_empty_marker_notes),
|
||||
AC(TASEdit_findnote_reappear),
|
||||
AC(TASEdit_combine_consecutive_rec),
|
||||
AC(TASEdit_use_1p_rec),
|
||||
AC(TASEdit_columnset_by_keys),
|
||||
|
|
|
@ -308,7 +308,12 @@ int BlockingCheck()
|
|||
//other accelerator capable dialogs could be added here
|
||||
extern HWND hwndMemWatch;
|
||||
extern HWND hwndTasEdit;
|
||||
extern HWND hwndFindNote;
|
||||
int handled = 0;
|
||||
|
||||
if(hCheat)
|
||||
if(IsChild(hCheat, msg.hwnd))
|
||||
handled = IsDialogMessage(hCheat, &msg);
|
||||
if(hwndMemWatch)
|
||||
{
|
||||
if(IsChild(hwndMemWatch,msg.hwnd))
|
||||
|
@ -330,11 +335,18 @@ int BlockingCheck()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!handled && hwndTasEdit)
|
||||
{
|
||||
if(IsChild(hwndTasEdit,msg.hwnd))
|
||||
if(IsChild(hwndTasEdit, msg.hwnd))
|
||||
handled = TranslateAccelerator(hwndTasEdit,fceu_hAccel,&msg);
|
||||
}
|
||||
if(!handled && hwndFindNote)
|
||||
{
|
||||
if(IsChild(hwndFindNote, msg.hwnd))
|
||||
handled = IsDialogMessage(hwndFindNote, &msg);
|
||||
}
|
||||
/* //adelikat - Currently no accel keys are used in the main window. Uncomment this block to activate them.
|
||||
if(!handled)
|
||||
if(msg.hwnd == hAppWnd)
|
||||
|
|
|
@ -255,17 +255,18 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
MENUITEM "Truncate\tCtrl+T", ID_EDIT_TRUNCATE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Find Note...\tCtrl+F", ID_EDIT_FINDNOTE
|
||||
END
|
||||
POPUP "&View"
|
||||
BEGIN
|
||||
MENUITEM "&Find Note window\tCtrl+F", ID_VIEW_FINDNOTE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Show &Lag Frames", ID_VIEW_SHOW_LAG_FRAMES
|
||||
MENUITEM "Highlight &Markers", ID_VIEW_SHOW_MARKERS
|
||||
MENUITEM "Display Branch &Screenshots", ID_VIEW_SHOWBRANCHSCREENSHOTS
|
||||
MENUITEM "Display Branch &Tooltips", ID_VIEW_SHOWBRANCHTOOLTIPS
|
||||
MENUITEM "Enable Hot &Changes", ID_VIEW_ENABLEHOTCHANGES
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Follow undo context", ID_VIEW_JUMPWHENMAKINGUNDO
|
||||
MENUITEM "Follow &undo context", ID_VIEW_JUMPWHENMAKINGUNDO
|
||||
MENUITEM "Follow Marker &Note context", ID_VIEW_FOLLOWMARKERNOTECONTEXT
|
||||
END
|
||||
POPUP "&Config"
|
||||
|
@ -280,7 +281,6 @@ BEGIN
|
|||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Bind Markers to Input", ID_CONFIG_BINDMARKERSTOINPUT
|
||||
MENUITEM "&Empty new Marker Notes", ID_CONFIG_EMPTYNEWMARKERNOTES
|
||||
MENUITEM "Reappearing &Find Note dialog", ID_CONFIG_REAPPEARINGFINDNOTEDIALOG
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Combine consecutive Recordings", ID_CONFIG_COMBINECONSECUTIVERECORDINGS
|
||||
MENUITEM "&Use 1P keys for all single Recordings", ID_CONFIG_USE1PFORRECORDING
|
||||
|
@ -1379,6 +1379,7 @@ END
|
|||
|
||||
TASEDIT DIALOGEX 0, 0, 438, 396
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "TAS Editor"
|
||||
MENU TASEDITMENU
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
|
@ -1425,7 +1426,7 @@ BEGIN
|
|||
END
|
||||
|
||||
IDD_TASEDIT_EXPORT DIALOGEX 0, 0, 158, 86
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Export to FM2"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
|
@ -1439,7 +1440,7 @@ BEGIN
|
|||
END
|
||||
|
||||
IDD_TASEDIT_FINDNOTE DIALOGEX 0, 0, 228, 52
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Find Note"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
|
@ -1453,7 +1454,7 @@ BEGIN
|
|||
END
|
||||
|
||||
IDD_TASEDIT_SAVECOMPACT DIALOGEX 0, 0, 122, 134
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dialog"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
|
@ -1595,34 +1596,34 @@ BEGIN
|
|||
GROUPBOX "Active Cheats",201,3,1,133,168,WS_TABSTOP
|
||||
GROUPBOX "Cheat Search",202,139,1,238,168,WS_TABSTOP
|
||||
LISTBOX IDC_LIST_CHEATS,12,14,115,110,LBS_EXTENDEDSEL | WS_VSCROLL
|
||||
LTEXT "Name:",IDC_STATIC,12,118,22,10
|
||||
LTEXT "Address:",IDC_STATIC,12,134,28,10
|
||||
LTEXT "Value:",IDC_STATIC,85,134,21,10
|
||||
LTEXT "Name:",IDC_STATIC,12,118,22,10
|
||||
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
EDITTEXT IDC_CHEAT_ADDR,42,132,30,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
EDITTEXT IDC_CHEAT_VAL,107,132,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
EDITTEXT IDC_CHEAT_NAME,35,116,92,12,ES_AUTOHSCROLL | ES_WANTRETURN
|
||||
PUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
|
||||
DEFPUSHBUTTON "Add",IDC_BTN_CHEAT_ADD,12,148,35,16
|
||||
PUSHBUTTON "Delete",IDC_BTN_CHEAT_DEL,52,148,35,16
|
||||
PUSHBUTTON "Update",IDC_BTN_CHEAT_UPD,92,148,35,16
|
||||
GROUPBOX "Possibilities",IDC_CHEAT_BOX_POSSIBILITIES,252,13,125,156,WS_TABSTOP
|
||||
LISTBOX IDC_CHEAT_LIST_POSSIBILITIES,260,25,99,147,LBS_SORT | LBS_WANTKEYBOARDINPUT
|
||||
SCROLLBAR IDC_CHEAT_SCRL_POSSIBILITIES,360,25,10,138,SBS_VERT
|
||||
PUSHBUTTON "Reset",IDC_BTN_CHEAT_RESET,146,12,55,15
|
||||
PUSHBUTTON "Known Value:",IDC_BTN_CHEAT_KNOWN,146,31,55,15
|
||||
EDITTEXT IDC_CHEAT_VAL_KNOWN,213,32,20,12,ES_UPPERCASE
|
||||
GROUPBOX "Previous Compare",204,139,51,114,118,WS_TABSTOP
|
||||
PUSHBUTTON "Equal",IDC_BTN_CHEAT_EQ,146,64,55,15
|
||||
PUSHBUTTON "Not Equal",IDC_BTN_CHEAT_NE,146,91,55,15
|
||||
PUSHBUTTON "Greater Than",IDC_BTN_CHEAT_GT,146,118,55,15
|
||||
PUSHBUTTON "Less Than",IDC_BTN_CHEAT_LT,146,145,55,15
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_NE_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,94,22,10
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_GT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,121,22,10
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_LT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,148,22,10
|
||||
EDITTEXT IDC_CHEAT_VAL_NE_BY,228,93,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
EDITTEXT IDC_CHEAT_VAL_GT_BY,228,120,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
EDITTEXT IDC_CHEAT_VAL_LT_BY,228,147,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
LTEXT "0x",IDC_STATIC,204,34,9,8
|
||||
CONTROL "Pause when active",IDC_CHEAT_PAUSEWHENACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,173,76,10
|
||||
EDITTEXT IDC_CHEAT_VAL_KNOWN,213,32,20,12,ES_UPPERCASE
|
||||
GROUPBOX "Previous Compare",204,139,51,114,118
|
||||
PUSHBUTTON "Equal",IDC_BTN_CHEAT_EQ,146,64,55,15,WS_GROUP
|
||||
PUSHBUTTON "Not Equal",IDC_BTN_CHEAT_NE,146,91,55,15
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_NE_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,94,22,10
|
||||
EDITTEXT IDC_CHEAT_VAL_NE_BY,228,93,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
PUSHBUTTON "Greater Than",IDC_BTN_CHEAT_GT,146,118,55,15
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_GT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,121,22,10
|
||||
EDITTEXT IDC_CHEAT_VAL_GT_BY,228,120,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
PUSHBUTTON "Less Than",IDC_BTN_CHEAT_LT,146,145,55,15
|
||||
CONTROL "By:",IDC_CHEAT_CHECK_LT_BY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,148,22,10
|
||||
EDITTEXT IDC_CHEAT_VAL_LT_BY,228,147,20,12,ES_UPPERCASE | ES_WANTRETURN
|
||||
GROUPBOX "Possibilities",IDC_CHEAT_BOX_POSSIBILITIES,252,13,125,156,WS_TABSTOP
|
||||
LISTBOX IDC_CHEAT_LIST_POSSIBILITIES,260,25,99,147,LBS_SORT | LBS_WANTKEYBOARDINPUT | WS_TABSTOP
|
||||
SCROLLBAR IDC_CHEAT_SCRL_POSSIBILITIES,360,25,10,138,SBS_VERT
|
||||
CONTROL "Pause when active",IDC_CHEAT_PAUSEWHENACTIVE,"Button",BS_AUTOCHECKBOX,7,173,76,10
|
||||
END
|
||||
|
||||
IDD_LUA DIALOGEX 0, 0, 270, 150
|
||||
|
|
|
@ -962,6 +962,7 @@
|
|||
#define ID_CONFIG_EMPTYNEWMARKERNOTES 40510
|
||||
#define ID_EDIT_FINDNOTE 40513
|
||||
#define ID_CONFIG_REAPPEARINGFINDNOTEDIALOG 40514
|
||||
#define ID_VIEW_FINDNOTE 40515
|
||||
#define IDC_DEBUGGER_ICONTRAY 55535
|
||||
#define MW_ValueLabel2 65423
|
||||
#define MW_ValueLabel1 65426
|
||||
|
@ -971,7 +972,7 @@
|
|||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 199
|
||||
#define _APS_NEXT_COMMAND_VALUE 40515
|
||||
#define _APS_NEXT_COMMAND_VALUE 40516
|
||||
#define _APS_NEXT_CONTROL_VALUE 1274
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
HWND hwndTasEdit = 0;
|
||||
HWND hwndTasEdit = 0, hwndFindNote = 0;
|
||||
HMENU hmenu, hrmenu;
|
||||
|
||||
bool TASEdit_focus = false;
|
||||
|
@ -43,9 +43,11 @@ extern int EnableAutosave;
|
|||
|
||||
extern EMOVIEMODE movieMode; // maybe we need normal setter for movieMode, to encapsulate it
|
||||
extern void UpdateCheckedMenuItems();
|
||||
BOOL CALLBACK FindNoteProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
// vars saved in cfg file (need dedicated storage class?)
|
||||
int TasEdit_wndx, TasEdit_wndy;
|
||||
int TasEdit_wndx = 0, TasEdit_wndy = 0;
|
||||
int FindNote_wndx = 0, FindNote_wndy = 0;
|
||||
bool TASEdit_follow_playback = true;
|
||||
bool TASEdit_turbo_seek = true;
|
||||
bool TASEdit_show_lag_frames = true;
|
||||
|
@ -83,7 +85,6 @@ bool TASEdit_savecompact_list = true;
|
|||
bool TASEdit_savecompact_selection = false;
|
||||
bool TASEdit_findnote_matchcase = false;
|
||||
bool TASEdit_findnote_search_up = false;
|
||||
bool TASEdit_findnote_reappear = true;
|
||||
|
||||
// Recent Menu
|
||||
HMENU recent_projects_menu;
|
||||
|
@ -1706,10 +1707,6 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
TASEdit_empty_marker_notes ^= 1;
|
||||
CheckMenuItem(hmenu, ID_CONFIG_EMPTYNEWMARKERNOTES, TASEdit_empty_marker_notes?MF_CHECKED : MF_UNCHECKED);
|
||||
break;
|
||||
case ID_CONFIG_REAPPEARINGFINDNOTEDIALOG:
|
||||
TASEdit_findnote_reappear ^= 1;
|
||||
CheckMenuItem(hmenu, ID_CONFIG_REAPPEARINGFINDNOTEDIALOG, TASEdit_findnote_reappear?MF_CHECKED : MF_UNCHECKED);
|
||||
break;
|
||||
case ID_CONFIG_COMBINECONSECUTIVERECORDINGS:
|
||||
//switch "Combine consecutive Recordings" flag
|
||||
TASEdit_combine_consecutive_rec ^= 1;
|
||||
|
@ -1917,9 +1914,14 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
|
|||
selection.JumpNextMarker();
|
||||
break;
|
||||
case ACCEL_CTRL_F:
|
||||
case ID_EDIT_FINDNOTE:
|
||||
FindNote();
|
||||
break;
|
||||
case ID_VIEW_FINDNOTE:
|
||||
{
|
||||
if (hwndFindNote)
|
||||
SetFocus(GetDlgItem(hwndFindNote, IDC_NOTE_TO_FIND));
|
||||
else
|
||||
hwndFindNote = CreateDialog(fceu_hInstance, MAKEINTRESOURCE(IDD_TASEDIT_FINDNOTE), hwndTasEdit, FindNoteProc);
|
||||
break;
|
||||
}
|
||||
case TASEDIT_FIND_BEST_SIMILAR_MARKER:
|
||||
FindSimilarMarker();
|
||||
break;
|
||||
|
@ -1950,7 +1952,7 @@ bool EnterTasEdit()
|
|||
if(!hwndTasEdit)
|
||||
{
|
||||
hTaseditorIcon = (HICON)LoadImage(fceu_hInstance, MAKEINTRESOURCE(IDI_ICON3), IMAGE_ICON, 16, 16, LR_DEFAULTSIZE);
|
||||
hwndTasEdit = CreateDialog(fceu_hInstance,"TASEDIT", hAppWnd, WndprocTasEdit);
|
||||
hwndTasEdit = CreateDialog(fceu_hInstance, "TASEDIT", hAppWnd, WndprocTasEdit);
|
||||
if(hwndTasEdit)
|
||||
{
|
||||
SetTaseditInput();
|
||||
|
@ -1987,7 +1989,6 @@ bool EnterTasEdit()
|
|||
CheckMenuItem(hmenu, ID_CONFIG_HUDINBRANCHSCREENSHOTS, TASEdit_branch_scr_hud?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_BINDMARKERSTOINPUT, TASEdit_bind_markers?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_EMPTYNEWMARKERNOTES, TASEdit_empty_marker_notes?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_REAPPEARINGFINDNOTEDIALOG, TASEdit_findnote_reappear?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_COMBINECONSECUTIVERECORDINGS, TASEdit_combine_consecutive_rec?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_USE1PFORRECORDING, TASEdit_use_1p_rec?MF_CHECKED : MF_UNCHECKED);
|
||||
CheckMenuItem(hmenu, ID_CONFIG_USEINPUTKEYSFORCOLUMNSET, TASEdit_columnset_by_keys?MF_CHECKED : MF_UNCHECKED);
|
||||
|
@ -2049,6 +2050,11 @@ bool ExitTasEdit()
|
|||
{
|
||||
if (!AskSaveProject()) return false;
|
||||
|
||||
if (hwndFindNote)
|
||||
{
|
||||
DestroyWindow(hwndFindNote);
|
||||
hwndFindNote = 0;
|
||||
}
|
||||
DestroyWindow(hwndTasEdit);
|
||||
hwndTasEdit = 0;
|
||||
TASEdit_focus = false;
|
||||
|
@ -2135,7 +2141,10 @@ BOOL CALLBACK FindNoteProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
SetWindowPos(hwndDlg, 0, TasEdit_wndx + 70, TasEdit_wndy + 160, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
||||
if (FindNote_wndx == -32000) FindNote_wndx = 0; //Just in case
|
||||
if (TasEdit_wndy == -32000) FindNote_wndy = 0;
|
||||
SetWindowPos(hwndDlg, 0, FindNote_wndx, FindNote_wndy, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
|
||||
|
||||
CheckDlgButton(hwndDlg, IDC_MATCH_CASE, TASEdit_findnote_matchcase?MF_CHECKED : MF_UNCHECKED);
|
||||
if (TASEdit_findnote_search_up)
|
||||
Button_SetCheck(GetDlgItem(hwndDlg, IDC_RADIO_UP), BST_CHECKED);
|
||||
|
@ -2151,7 +2160,20 @@ BOOL CALLBACK FindNoteProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||
}
|
||||
return true;
|
||||
}
|
||||
case WM_MOVE:
|
||||
{
|
||||
if (!IsIconic(hwndDlg))
|
||||
{
|
||||
RECT wrect;
|
||||
GetWindowRect(hwndDlg, &wrect);
|
||||
FindNote_wndx = wrect.left;
|
||||
FindNote_wndy = wrect.top;
|
||||
WindowBoundsCheckNoResize(FindNote_wndx, FindNote_wndy, wrect.right);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_NOTE_TO_FIND:
|
||||
|
@ -2179,83 +2201,69 @@ BOOL CALLBACK FindNoteProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
int len = SendMessage(GetDlgItem(hwndDlg, IDC_NOTE_TO_FIND), WM_GETTEXT, MAX_NOTE_LEN, (LPARAM)findnote_string);
|
||||
findnote_string[len] = 0;
|
||||
EndDialog(hwndDlg, 1);
|
||||
// scan frames from current selection to the border
|
||||
int cur_marker = 0;
|
||||
bool result;
|
||||
int movie_size = currMovieData.getNumRecords();
|
||||
int current_frame = selection.GetCurrentSelectionBeginning();
|
||||
if (current_frame < 0 && TASEdit_findnote_search_up)
|
||||
current_frame = movie_size;
|
||||
while (true)
|
||||
{
|
||||
// move forward
|
||||
if (TASEdit_findnote_search_up)
|
||||
{
|
||||
current_frame--;
|
||||
if (current_frame < 0)
|
||||
{
|
||||
MessageBox(hwndFindNote, "Nothing was found.", "Find Note", MB_OK);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
current_frame++;
|
||||
if (current_frame >= movie_size)
|
||||
{
|
||||
MessageBox(hwndFindNote, "Nothing was found!", "Find Note", MB_OK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// scan marked frames
|
||||
cur_marker = current_markers.GetMarker(current_frame);
|
||||
if (cur_marker)
|
||||
{
|
||||
if (TASEdit_findnote_matchcase)
|
||||
result = (strstr(current_markers.GetNote(cur_marker).c_str(), findnote_string) != 0);
|
||||
else
|
||||
result = (StrStrI(current_markers.GetNote(cur_marker).c_str(), findnote_string) != 0);
|
||||
if (result)
|
||||
{
|
||||
// found note containing searched string - jump there
|
||||
selection.JumpToFrame(current_frame);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDCANCEL:
|
||||
EndDialog(hwndDlg, 0);
|
||||
DestroyWindow(hwndFindNote);
|
||||
hwndFindNote = 0;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
case WM_QUIT:
|
||||
{
|
||||
DestroyWindow(hwndFindNote);
|
||||
hwndFindNote = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FindNote()
|
||||
{
|
||||
selection.update();
|
||||
int movie_size = currMovieData.getNumRecords();
|
||||
int entries_found = 0;
|
||||
int current_frame;
|
||||
int cur_marker = 0;
|
||||
bool result;
|
||||
|
||||
do
|
||||
{
|
||||
if (DialogBox(fceu_hInstance, MAKEINTRESOURCE(IDD_TASEDIT_FINDNOTE), hwndTasEdit, FindNoteProc) > 0 && strlen(findnote_string))
|
||||
{
|
||||
current_frame = selection.GetCurrentSelectionBeginning();
|
||||
if (TASEdit_findnote_search_up)
|
||||
if (current_frame < 0)
|
||||
current_frame = movie_size;
|
||||
while (true)
|
||||
{
|
||||
// move forward
|
||||
if (TASEdit_findnote_search_up)
|
||||
{
|
||||
current_frame--;
|
||||
if (current_frame < 0)
|
||||
{
|
||||
if (entries_found)
|
||||
MessageBox(hwndTasEdit, "No more entries found.", "Find Note", MB_OK);
|
||||
else
|
||||
MessageBox(hwndTasEdit, "Nothing was found!", "Find Note", MB_OK);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
current_frame++;
|
||||
if (current_frame >= movie_size)
|
||||
{
|
||||
if (entries_found)
|
||||
MessageBox(hwndTasEdit, "No more entries found.", "Find Note", MB_OK);
|
||||
else
|
||||
MessageBox(hwndTasEdit, "Nothing was found!", "Find Note", MB_OK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// scan marked frames
|
||||
cur_marker = current_markers.GetMarker(current_frame);
|
||||
if (cur_marker)
|
||||
{
|
||||
if (TASEdit_findnote_matchcase)
|
||||
result = (strstr(current_markers.GetNote(cur_marker).c_str(), findnote_string) != 0);
|
||||
else
|
||||
result = (StrStrI(current_markers.GetNote(cur_marker).c_str(), findnote_string) != 0);
|
||||
if (result)
|
||||
{
|
||||
// found note containing searched string - jump there
|
||||
entries_found++;
|
||||
selection.JumpToFrame(current_frame);
|
||||
selection.update();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else break;
|
||||
} while (TASEdit_findnote_reappear);
|
||||
}
|
||||
|
||||
void FindSimilarMarker()
|
||||
{
|
||||
char playback_marker_text[MAX_NOTE_LEN];
|
||||
|
|
|
@ -58,7 +58,6 @@ void SetTaseditInput();
|
|||
void ClearTaseditInput();
|
||||
|
||||
void UpdateMarkerNote();
|
||||
void FindNote();
|
||||
void FindSimilarMarker();
|
||||
|
||||
void UpdateRecentProjectsMenu();
|
||||
|
|
Loading…
Reference in New Issue