From 98e97351b9f779ea4c2341aaf7e59e88dcc71ac5 Mon Sep 17 00:00:00 2001 From: Robin Eklind Date: Fri, 9 Aug 2019 11:15:03 +0200 Subject: [PATCH] control: rename attribute_inc_rects to ChrBtnsRect Rationale described in sanctuary/notes@541e63f85a442cbb2293734c24c5868ccceec800 as included below: Note, the ChrBtnsRect global doesn't have PSX debug info. However, the functionality correspond to that of InvRect of inv.h. Moreover, the we may infer the name from the function CheckChrBtns, and simply combine the two names. --- Source/control.cpp | 18 +++++++++--------- Source/control.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index e69c9013e..e5b9535b3 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -152,7 +152,7 @@ char *PanBtnStr[8] = { "Send Message", "Player Attack" }; -RECT32 attribute_inc_rects[4] = { +RECT32 ChrBtnsRect[4] = { { 137, 138, 41, 22 }, { 137, 166, 41, 22 }, { 137, 195, 41, 22 }, @@ -1975,10 +1975,10 @@ void CheckChrBtns() default: continue; } - if (MouseX >= attribute_inc_rects[i].x - && MouseX <= attribute_inc_rects[i].x + attribute_inc_rects[i].w - && MouseY >= attribute_inc_rects[i].y - && MouseY <= attribute_inc_rects[i].y + attribute_inc_rects[i].h) { + if (MouseX >= ChrBtnsRect[i].x + && MouseX <= ChrBtnsRect[i].x + ChrBtnsRect[i].w + && MouseY >= ChrBtnsRect[i].y + && MouseY <= ChrBtnsRect[i].y + ChrBtnsRect[i].h) { chrbtn[i] = 1; chrbtnactive = TRUE; } @@ -1994,10 +1994,10 @@ void ReleaseChrBtns() for (i = 0; i < 4; ++i) { if (chrbtn[i]) { chrbtn[i] = 0; - if (MouseX >= attribute_inc_rects[i].x - && MouseX <= attribute_inc_rects[i].x + attribute_inc_rects[i].w - && MouseY >= attribute_inc_rects[i].y - && MouseY <= attribute_inc_rects[i].y + attribute_inc_rects[i].h) { + if (MouseX >= ChrBtnsRect[i].x + && MouseX <= ChrBtnsRect[i].x + ChrBtnsRect[i].w + && MouseY >= ChrBtnsRect[i].y + && MouseY <= ChrBtnsRect[i].y + ChrBtnsRect[i].h) { switch (i) { case 0: NetSendCmdParam1(TRUE, CMD_ADDSTR, 1); diff --git a/Source/control.h b/Source/control.h index 803bdc4c3..c2e08e0a5 100644 --- a/Source/control.h +++ b/Source/control.h @@ -132,7 +132,7 @@ extern char SpellITbl[MAX_SPELLS]; extern int PanBtnPos[8][5]; extern char *PanBtnHotKey[8]; extern char *PanBtnStr[8]; -extern RECT32 attribute_inc_rects[4]; +extern RECT32 ChrBtnsRect[4]; extern int SpellPages[6][7]; #endif /* __CONTROL_H__ */