GSDx: dehacked hover description code for hacks

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5171 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-04-23 18:46:09 +00:00
parent 22d9f16c02
commit 595de0a5eb
4 changed files with 59 additions and 70 deletions

View File

@ -427,67 +427,70 @@ void GSHacksDlg::OnInit()
SendMessage(GetDlgItem(m_hWnd, IDC_SKIPDRAWHACK), UDM_SETPOS, 0, MAKELPARAM(theApp.GetConfig("UserHacks_SkipDraw", 0), 0));
// Hacks descriptions
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), ""); // Blank it
sprintf(Hack[HK_MSAA].description, "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory."
" The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (DX9 mode).");
sprintf(Hack[HK_SKIPDRAW].description, "Skipdraw\n\nSkips drawing n surfaces completely. "
"Use it, for example, to try and get rid of messed up post processing effects."
" Try values between 1 and 100.");
sprintf(Hack[HK_ALPHA].description, "Alpha Hack\n\nDifferent alpha handling. Works around some shadow problems.");
sprintf(Hack[HK_OFFSET].description, "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect.");
sprintf(Hack[HK_SPRITE].description, "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites."
" Half option should be the preferred one, for Mana Khemia and ArTonelico for example."
" Full should be used for Tales of Destiny.");
sprintf(Hack[HK_WILD].description, "WildArms\n\nLowers the GS precission to avoid gaps between pixels when"
" upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits"
" in ArTonelico for example.");
SetNotHover(-1);
// Hacks descriptions
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), ""); // Blank it
}
void GSHacksDlg::UpdateControls()
{}
void GSHacksDlg::SetNotHover(int skip)
{
for(int i=0; i<HK_SIZE; i++)
{
if(skip == i) continue;
Hack[i].isHovered = false;
}
}
bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
switch(message)
{
case WM_MOUSEMOVE:
{
POINTS pos = MAKEPOINTS(lParam);
case WM_SETCURSOR:
{
const char *helpstr = "";
if(pos.x >= 20 && pos.x <= 120)
{
int isHovering = -1;
POINT pos;
GetCursorPos(&pos);
ScreenToClient(m_hWnd, &pos);
if(pos.y >= 28 && pos.y <= 52) isHovering = HK_MSAA;
else if(pos.y >= 54 && pos.y <= 82) isHovering = HK_SKIPDRAW;
else if(pos.y >= 84 && pos.y <= 106) isHovering = HK_ALPHA;
else if(pos.y >= 112 && pos.y <= 134) isHovering = HK_OFFSET;
else if(pos.y >= 140 && pos.y <= 164) isHovering = HK_SPRITE;
else if (pos.y >= 168 && pos.y <= 190) isHovering = HK_WILD;
HWND hoveredwnd = ChildWindowFromPointEx(m_hWnd, pos, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT);
if(isHovering > -1 && !Hack[isHovering].isHovered)
{
Hack[isHovering].isHovered = true;
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), Hack[isHovering].description);
SetNotHover(isHovering);
}
}
if (hoveredwnd != hovered_window)
hovered_window = hoveredwnd;
else
break;
switch (GetDlgCtrlID(hoveredwnd))
{
case IDC_SKIPDRAWHACK:
case IDC_SKIPDRAWHACKEDIT:
case IDC_STATIC_SKIPDRAW:
helpstr = "Skipdraw\n\nSkips drawing n surfaces completely. "
"Use it, for example, to try and get rid of messed up post processing effects."
" Try values between 1 and 100.";
break;
case IDC_ALPHAHACK:
helpstr = "Alpha Hack\n\nDifferent alpha handling. Works around some shadow problems.";
break;
case IDC_OFFSETHACK:
helpstr = "Halfpixel\n\nMight fix some misaligned fog, bloom, or blend effect.";
break;
case IDC_SPRITEHACK:
helpstr = "Sprite Hack\n\nHelps getting rid of black inner lines in some filtered sprites."
" Half option should be the preferred one, for Mana Khemia and ArTonelico for example."
" Full should be used for Tales of Destiny.";
break;
case IDC_WILDHACK:
helpstr = "WildArms\n\nLowers the GS precission to avoid gaps between pixels when"
" upscaling. Full option fixes the text on WildArms games, while Half option might improve portraits"
" in ArTonelico for example.";
break;
case IDC_MSAACB:
case IDC_STATIC_MSAA:
helpstr = "Multisample Anti-Aliasing\n\nEnables hardware Anti-Aliasing. Needs lots of memory."
" The Z-24 modes might need to have LogarithmicZ to compensate for the bits lost (DX9 mode).";
break;
default:
helpstr = "";
break;
}
} break;
SetWindowText(GetDlgItem(m_hWnd, IDC_HACK_DESCRIPTION), helpstr);
} break;
case WM_COMMAND:
{

View File

@ -47,25 +47,9 @@ class GSHacksDlg : public GSDialog
bool isdx9;
enum
{
HK_MSAA,
HK_SKIPDRAW,
HK_ALPHA,
HK_OFFSET,
HK_SPRITE,
HK_WILD,
HK_SIZE
};
struct
{
bool isHovered;
char description[1024];
} Hack[HK_SIZE];
HWND hovered_window;
void UpdateControls();
void SetNotHover(int i);
protected:
void OnInit();

View File

@ -81,9 +81,9 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,258,182,50,14
GROUPBOX "Hack",IDC_STATIC,7,7,76,165
GROUPBOX "Description",IDC_STATIC,85,7,223,165
LTEXT "MSAA",IDC_STATIC,14,20,20,8
LTEXT "Skipdraw",IDC_STATIC,14,37,30,8
GROUPBOX "Description",IDC_STATIC,85,7,223,165,0,WS_EX_TRANSPARENT
LTEXT "MSAA",IDC_STATIC_MSAA,14,20,20,8
LTEXT "Skipdraw",IDC_STATIC_SKIPDRAW,14,37,30,8
EDITTEXT IDC_SKIPDRAWHACKEDIT,45,35,24,14,ES_RIGHT | ES_AUTOHSCROLL
CONTROL "",IDC_SKIPDRAWHACK,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS,68,35,10,14
CONTROL "Alpha",IDC_ALPHAHACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,54,34,10

View File

@ -90,6 +90,8 @@
#define IDC_HACKSBUTTON 2071
#define IDC_WILDHACK 2072
#define IDC_HACK_DESCRIPTION 2073
#define IDC_STATIC_MSAA 2074
#define IDC_STATIC_SKIPDRAW 2075
#define IDC_COLORSPACE 3000
#define IDR_CONVERT_FX 10000
#define IDR_TFX_FX 10001
@ -108,7 +110,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 10012
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 2074
#define _APS_NEXT_CONTROL_VALUE 2076
#define _APS_NEXT_SYMED_VALUE 5000
#endif
#endif