* colored marker captions

* pale yellow and bright yellow when "Bind Markers" is off/on
* "Help" links to taseditor.chm
This commit is contained in:
ansstuff 2012-01-04 18:00:29 +00:00
parent 7449bff36b
commit e9d157235b
8 changed files with 78 additions and 75 deletions

View File

@ -26,6 +26,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON3 ICON "res\\tasedit-icon.ico"
IDI_ICON4 ICON "res\\tasedit-icon32.ico"
ICON_1 ICON "res/ICON_1.ico"
ICON_2 ICON "res/ICON_2.ico"
@ -1380,7 +1381,6 @@ 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
@ -1427,17 +1427,18 @@ BEGIN
CONTROL " Recording",IDC_RECORDING,"Button",BS_AUTO3STATE,316,74,49,10
END
IDD_TASEDIT_ABOUT DIALOGEX 0, 0, 210, 71
IDD_TASEDIT_ABOUT DIALOGEX 0, 0, 208, 70
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDCANCEL,79,49,50,14
ICON IDI_ICON4,IDC_STATIC,11,10,20,20
LTEXT "TAS Editor",IDC_STATIC,48,10,49,11
LTEXT "Version 1.0",IDC_STATIC,47,23,37,8
LTEXT "Created by AnS in 2011",IDC_STATIC,111,10,77,8
LTEXT "Based on TASEdit v0.1 made by zeromus & adelikat",IDC_STATIC,111,23,91,19,SS_NOPREFIX
DEFPUSHBUTTON "OK",IDCANCEL,78,49,50,14
ICON IDI_ICON4,IDC_STATIC,11,10,21,20
LTEXT "TAS Editor",IDC_STATIC,46,9,49,11
LTEXT "Version 1.0",IDC_STATIC,45,22,37,8
LTEXT "Created by AnS in 2011",IDC_STATIC,107,9,77,8
LTEXT "Based on TASEdit v0.1",IDC_STATIC,107,22,83,9,SS_NOPREFIX
LTEXT "made by zeromus & adelikat",IDC_STATIC,107,31,96,9,SS_NOPREFIX
END
IDD_TASEDIT_EXPORT DIALOGEX 0, 0, 158, 86
@ -1967,6 +1968,10 @@ BEGIN
RIGHTMARGIN, 433
END
IDD_TASEDIT_ABOUT, DIALOG
BEGIN
END
IDD_TASEDIT_EXPORT, DIALOG
BEGIN
END
@ -2050,47 +2055,6 @@ END
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Ðóññêèé (Ðîññèÿ) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON4 ICON "res\\tasedit-icon32.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_TASEDIT_ABOUT, DIALOG
BEGIN
END
END
#endif // APSTUDIO_INVOKED
#endif // Ðóññêèé (Ðîññèÿ) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Àíãëèéñêèé (ÑØÀ) resources

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -5,22 +5,22 @@
#include "Win32InputBox.h"
#include "keyboard.h"
#include "joystick.h"
#include "help.h"
#include "main.h"
#include "tasedit.h"
#include "version.h"
#include <htmlhelp.h>
#include <Shlwapi.h> // for StrStrI
#pragma comment(lib, "Shlwapi.lib")
using namespace std;
// TAS Editor data
HWND hwndTasEdit = 0, hwndFindNote = 0;
HMENU hmenu, hrmenu;
bool TASEdit_focus = false;
bool Tasedit_rewind_now = false;
// note editing/search (probably should be moved to separate class/module)
int marker_note_edit = MARKER_NOTE_EDIT_NONE;
char findnote_string[MAX_NOTE_LEN] = {0};
int search_similar_marker = 0;
@ -94,6 +94,7 @@ const unsigned int MENU_FIRST_RECENT_PROJECT = 55000;
const unsigned int MAX_NUMBER_OF_RECENT_PROJECTS = sizeof(recent_projects)/sizeof(*recent_projects);
// resources
char taseditor_help_filename[] = "\\taseditor.chm";
string tasedithelp = "{16CDE0C4-02B0-4A60-A88D-076319909A4D}"; //Name of TAS Editor Help page
char buttonNames[NUM_JOYPAD_BUTTONS][2] = {"A", "B", "S", "T", "U", "D", "L", "R"};
char windowCaptioBase[] = "TAS Editor";
@ -1382,6 +1383,20 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
TASEdit_focus = false;
ClearTaseditInput();
}
break;
case WM_CTLCOLORSTATIC:
if ((HWND)lParam == playback.hwndPlaybackMarker)
{
SetTextColor((HDC)wParam, PLAYBACK_MARKER_COLOR);
SetBkMode((HDC)wParam, TRANSPARENT);
return (BOOL)(tasedit_list.bg_brush);
} else if ((HWND)lParam == selection.hwndSelectionMarker)
{
SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHT));
SetBkMode((HDC)wParam, TRANSPARENT);
return (BOOL)tasedit_list.bg_brush;
}
break;
case WM_COMMAND:
{
@ -1535,8 +1550,8 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SendMessage(selection.hwndSelectionMarkerEdit, EM_REPLACESEL, true, (LPARAM)insert_V);
} else
PasteInsert();
break;
}
break;
case ID_EDIT_PASTEINSERT:
if (marker_note_edit == MARKER_NOTE_EDIT_UPPER)
SendMessage(playback.hwndPlaybackMarkerEdit, WM_PASTE, 0, 0);
@ -1557,9 +1572,13 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
Truncate();
break;
case ID_HELP_TASEDITHELP:
OpenHelpWindow(tasedithelp);
//link to TAS Editor in help menu
break;
{
//OpenHelpWindow(tasedithelp);
string helpFileName = BaseDirectory;
helpFileName.append(taseditor_help_filename);
HtmlHelp(GetDesktopWindow(), helpFileName.c_str(), HH_DISPLAY_TOPIC, (DWORD)NULL);
break;
}
case ACCEL_INS:
case ID_EDIT_INSERT:
case MENU_CONTEXT_STRAY_INSERTFRAMES:
@ -1599,11 +1618,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
TASEdit_follow_playback ^= 1;
CheckDlgButton(hwndTasEdit, CHECK_FOLLOW_CURSOR, TASEdit_follow_playback?MF_CHECKED : MF_UNCHECKED);
// if switched off then jump to selection
if (TASEdit_follow_playback)
tasedit_list.FollowPlayback();
else if (selection.GetCurrentSelectionSize())
tasedit_list.FollowSelection();
else if (playback.GetPauseFrame())
if (!TASEdit_follow_playback && playback.GetPauseFrame())
tasedit_list.FollowPauseframe();
break;
case CHECK_TURBO_SEEK:
@ -1724,6 +1739,7 @@ BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case ID_CONFIG_BINDMARKERSTOINPUT:
TASEdit_bind_markers ^= 1;
CheckMenuItem(hmenu, ID_CONFIG_BINDMARKERSTOINPUT, TASEdit_bind_markers?MF_CHECKED : MF_UNCHECKED);
tasedit_list.RedrawList();
break;
case ID_CONFIG_EMPTYNEWMARKERNOTES:
TASEdit_empty_marker_notes ^= 1;

View File

@ -9,12 +9,9 @@ extern PLAYBACK playback;
extern BOOKMARKS bookmarks;
extern TASEDIT_LIST tasedit_list;
extern int TASEdit_greenzone_capacity;
extern bool TASEdit_restore_position;
extern void FCEU_printf(char *format, ...);
char greenzone_save_id[GREENZONE_ID_LEN] = "GREENZONE";
char greenzone_skipsave_id[GREENZONE_ID_LEN] = "GREENZONX";

View File

@ -254,6 +254,7 @@ void PLAYBACK::RewindFrame()
if (currFrameCounter > 0)
jump(currFrameCounter-1);
else
// cursor is at frame 0 - can't rewind, but still must make cursor visible if needed
tasedit_list.FollowPlaybackIfNeeded();
if (!pause_frame) PauseEmulation();
}
@ -293,7 +294,7 @@ void PLAYBACK::RedrawMarker()
{
// redraw marker num
char new_text[MAX_NOTE_LEN] = {0};
if (shown_marker <= 99999) // if there's too many digits in the number then don't show the word "Marker" before the number
if (shown_marker <= 9999) // if there's too many digits in the number then don't show the word "Marker" before the number
strcpy(new_text, upperMarkerText);
char num[11];
_itoa(shown_marker, num, 10);

View File

@ -19,6 +19,7 @@ extern TASEDIT_SELECTION selection;
extern bool TASEdit_enable_hot_changes;
extern bool TASEdit_show_markers;
extern bool TASEdit_bind_markers;
extern bool TASEdit_show_lag_frames;
extern bool TASEdit_follow_playback;
extern bool TASEdit_jump_to_undo;
@ -53,9 +54,9 @@ TASEDIT_LIST::TASEDIT_LIST()
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Courier New"); /*font name*/
// create fonts for Marker notes fields
hMarkersFont = CreateFont(16, 7, /*Height,Width*/
hMarkersFont = CreateFont(16, 8, /*Height,Width*/
0, 0, /*escapement,orientation*/
FW_NORMAL, FALSE, FALSE, FALSE, /*weight, italic, underline, strikeout*/
FW_BOLD, FALSE, FALSE, FALSE, /*weight, italic, underline, strikeout*/
ANSI_CHARSET, OUT_DEVICE_PRECIS, CLIP_MASK, /*charset, precision, clipping*/
DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
"Arial"); /*font name*/
@ -71,6 +72,7 @@ TASEDIT_LIST::TASEDIT_LIST()
void TASEDIT_LIST::init()
{
free();
bg_brush = CreateSolidBrush(GetSysColor(COLOR_BTNFACE));
header_colors.resize(MAX_NUM_COLUMNS);
hwndList = GetDlgItem(hwndTasEdit, IDC_LIST1);
// prepare the main listview
@ -180,6 +182,11 @@ void TASEDIT_LIST::init()
}
void TASEDIT_LIST::free()
{
if (bg_brush)
{
DeleteObject(bg_brush);
bg_brush = 0;
}
if (himglist)
{
ImageList_Destroy(himglist);
@ -347,7 +354,18 @@ bool TASEDIT_LIST::CheckItemVisible(int frame)
void TASEDIT_LIST::FollowPlayback()
{
ListView_EnsureVisible(hwndList,currFrameCounter,FALSE);
// center list at jump_frame
int list_items = ListView_GetCountPerPage(hwndList);
int lower_border = (list_items - 1) / 2;
int upper_border = (list_items - 1) - lower_border;
int index = currFrameCounter + lower_border;
if (index >= currMovieData.getNumRecords())
index = currMovieData.getNumRecords()-1;
ListView_EnsureVisible(hwndList, index, false);
index = currFrameCounter - upper_border;
if (index < 0)
index = 0;
ListView_EnsureVisible(hwndList, index, false);
}
void TASEDIT_LIST::FollowPlaybackIfNeeded()
{
@ -538,7 +556,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
// undo hint here
if (TASEdit_show_markers && current_markers.GetMarker(cell_y))
{
msg->clrTextBk = MARKED_UNDOHINT_FRAMENUM_COLOR;
msg->clrTextBk = (TASEdit_bind_markers) ? BINDMARKED_UNDOHINT_FRAMENUM_COLOR : MARKED_UNDOHINT_FRAMENUM_COLOR;
} else
{
msg->clrTextBk = UNDOHINT_FRAMENUM_COLOR;
@ -548,7 +566,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
// current frame
if (TASEdit_show_markers && current_markers.GetMarker(cell_y))
{
msg->clrTextBk = CUR_MARKED_FRAMENUM_COLOR;
msg->clrTextBk = (TASEdit_bind_markers) ? CUR_BINDMARKED_FRAMENUM_COLOR : CUR_MARKED_FRAMENUM_COLOR;
} else
{
msg->clrTextBk = CUR_FRAMENUM_COLOR;
@ -556,7 +574,7 @@ LONG TASEDIT_LIST::CustomDraw(NMLVCUSTOMDRAW* msg)
} else if (TASEdit_show_markers && current_markers.GetMarker(cell_y))
{
// marked frame
msg->clrTextBk = MARKED_FRAMENUM_COLOR;
msg->clrTextBk = (TASEdit_bind_markers) ? BINDMARKED_FRAMENUM_COLOR : MARKED_FRAMENUM_COLOR;
} else
{
if(cell_y < greenzone.greenZoneCount)

View File

@ -84,9 +84,15 @@
#define UNDOHINT_INPUT_COLOR1 0xF7D2E1
#define UNDOHINT_INPUT_COLOR2 0xE9BED1
#define MARKED_FRAMENUM_COLOR 0xC0FCFF
#define CUR_MARKED_FRAMENUM_COLOR 0xDEF7F3
#define MARKED_UNDOHINT_FRAMENUM_COLOR 0xE1E7EC
#define MARKED_FRAMENUM_COLOR 0xAEF0FF
#define CUR_MARKED_FRAMENUM_COLOR 0xCAEDEA
#define MARKED_UNDOHINT_FRAMENUM_COLOR 0xDDE5E9
#define BINDMARKED_FRAMENUM_COLOR 0xC9FFF7
#define CUR_BINDMARKED_FRAMENUM_COLOR 0xD5F2EC
#define BINDMARKED_UNDOHINT_FRAMENUM_COLOR 0xE1EBED
#define PLAYBACK_MARKER_COLOR 0xC9AF00
class TASEDIT_LIST
{
@ -126,6 +132,7 @@ public:
// GDI stuff
HIMAGELIST himglist;
HFONT hMainListFont, hMainListSelectFont, hMarkersFont, hMarkersEditFont;
HBRUSH bg_brush;
private:
std::vector<uint8> header_colors;

View File

@ -216,7 +216,7 @@ void TASEDIT_SELECTION::RedrawMarker()
{
// redraw marker num
char new_text[MAX_NOTE_LEN] = {0};
if (shown_marker <= 99999) // if there's too many digits in the number then don't show the word "Marker" before the number
if (shown_marker <= 9999) // if there's too many digits in the number then don't show the word "Marker" before the number
strcpy(new_text, lowerMarkerText);
char num[11];
_itoa(shown_marker, num, 10);