From 9324ad14dc04d0a68d2c2e03f82f7dbdd78e5101 Mon Sep 17 00:00:00 2001 From: "alexey.min" Date: Thu, 24 May 2012 21:57:41 +0000 Subject: [PATCH] DebugDlg: display also user coords for easy copy-paste into scripts --- l2detect/DebugDlg.cpp | 8 ++++++++ l2detect/L2Detect.rc | 20 +++++++++++--------- l2detect/Resource.h | 1 + 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/l2detect/DebugDlg.cpp b/l2detect/DebugDlg.cpp index 0014fe4..7389a73 100644 --- a/l2detect/DebugDlg.cpp +++ b/l2detect/DebugDlg.cpp @@ -261,6 +261,7 @@ void DebugDlg_updateInfo( HWND hDlg ) if( g_game_client->getState() == GCST_IN_GAME ) { TCHAR tstr[256]; + TCHAR tstr_test[256] = {0}; // hp wsprintf( tstr, _T("%d / %d"), g_game_client->ai.usr.hp, g_game_client->ai.usr.hp_max ); SetDlgItemText( hDlg, IDC_HP, tstr ); @@ -276,6 +277,13 @@ void DebugDlg_updateInfo( HWND hDlg ) g_game_client->ai.usr.level, g_game_client->ai.usr.getClassStr(), g_game_client->ai.usr.getBaseClassStr() ); SetDlgItemText( hDlg, IDC_CHARNAME, tstr ); + // coords + wsprintf( tstr, _T("(%d,%d,%d) -> (%d,%d,%d)"), + g_game_client->ai.usr.x, g_game_client->ai.usr.y, g_game_client->ai.usr.z, + g_game_client->ai.usr.xDst, g_game_client->ai.usr.yDst, g_game_client->ai.usr.zDst ); + GetDlgItemText( hDlg, IDC_E_COORDS, tstr_test, sizeof(tstr_test)/sizeof(tstr_test[0]) ); + if( _tcscmp( tstr, tstr_test ) ) // set new text only if changed + SetDlgItemText( hDlg, IDC_E_COORDS, tstr ); } else SetDlgItemText( hDlg, IDC_CHARNAME, TEXT("") ); } diff --git a/l2detect/L2Detect.rc b/l2detect/L2Detect.rc index cd02e75..41736ef 100644 --- a/l2detect/L2Detect.rc +++ b/l2detect/L2Detect.rc @@ -76,7 +76,7 @@ BEGIN END -IDD_DEBUG DIALOGEX 0,0,266,160 +IDD_DEBUG DIALOGEX 0,0,266,180 CAPTION "Debug" FONT 8,"MS Shell Dlg",400,0,1 STYLE WS_POPUP|WS_VISIBLE|WS_CAPTION|WS_SYSMENU|DS_MODALFRAME|DS_SETFONT|DS_FIXEDSYS @@ -96,14 +96,16 @@ BEGIN CONTROL "char_name",IDC_CHARNAME,"Static",WS_CHILD|WS_VISIBLE|WS_GROUP|SS_SUNKEN,7,76,251,11 CONTROL "Enable Console",IDC_B_CONENABLE,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,65,42,64,14 CONTROL "Disable Console",IDC_B_CONDISABLE,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,141,42,63,14 - CONTROL "Check Interceptions",IDC_B_VALIDATEINTERCEPT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,6,94,74,15 - CONTROL "Intercept connect",IDC_B_INTERCEPTCONNECT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,136,94,62,15 - CONTROL "Check VPEx",IDC_B_CHECK_VIRTUALPROTECTEX,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,84,94,48,15 - CONTROL "Load L2Walker.dll",IDC_B_LOADWALKER,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,8,118,76,15 - CONTROL "Unload L2Walker.dll",IDC_B_UNLOADWALKER,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,90,118,76,15 - CONTROL "Dump All Relations",IDC_B_DUMP_ALL_RELATIONS,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,8,140,86,15 - CONTROL "Print address of UserAI::dwThreadID",IDC_B_PRINTADDRTID,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,102,140,136,15 - CONTROL "Restore connect",IDC_B_RESTORECONNECT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,200,94,62,15 + CONTROL "Check Interceptions",IDC_B_VALIDATEINTERCEPT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,6,114,74,15 + CONTROL "Intercept connect",IDC_B_INTERCEPTCONNECT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,136,114,62,15 + CONTROL "Check VPEx",IDC_B_CHECK_VIRTUALPROTECTEX,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,84,114,48,15 + CONTROL "Load L2Walker.dll",IDC_B_LOADWALKER,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,8,138,76,15 + CONTROL "Unload L2Walker.dll",IDC_B_UNLOADWALKER,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,90,138,76,15 + CONTROL "Dump All Relations",IDC_B_DUMP_ALL_RELATIONS,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,8,160,86,15 + CONTROL "Print address of UserAI::dwThreadID",IDC_B_PRINTADDRTID,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,102,160,136,15 + CONTROL "Restore connect",IDC_B_RESTORECONNECT,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,200,114,62,15 + CONTROL "Coords:",IDC_STATIC,"Static",WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE,8,94,28,13 + CONTROL "(x,y,z) -> (xDst,yDst,zDst)",IDC_E_COORDS,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_READONLY,54,92,206,15,WS_EX_CLIENTEDGE END diff --git a/l2detect/Resource.h b/l2detect/Resource.h index 0dfe28d..cc14a50 100644 --- a/l2detect/Resource.h +++ b/l2detect/Resource.h @@ -105,6 +105,7 @@ #define IDC_B_PRINTADDRTID 1128 #define IDC_C_TEONPVP_HACKS 1159 #define IDC_E_INGAME_GAMESERVER_PORT 1160 +#define IDC_E_COORDS 1161 // radar sound alerts setup dlg #define IDC_C_SOUNDENEMYENTER 1089