MCPcopy Create free account
hub / github.com/diasurgical/devilution / DoPanBtn

Function DoPanBtn

Source/control.cpp:890–907  ·  view source on GitHub ↗

* Checks if the mouse cursor is within any of the panel buttons and flag it if so. */

Source from the content-addressed store, hash-verified

888 * Checks if the mouse cursor is within any of the panel buttons and flag it if so.
889 */
890void DoPanBtn()
891{
892 int i;
893
894 for (i = 0; i < numpanbtns; i++) {
895 if (MouseX >= PanBtnPos[i][0] && MouseX <= PanBtnPos[i][0] + PanBtnPos[i][2]) {
896 if (MouseY >= PanBtnPos[i][1] && MouseY <= PanBtnPos[i][1] + PanBtnPos[i][3]) {
897 panbtn[i] = 1;
898 drawbtnflag = TRUE;
899 panbtndown = TRUE;
900 }
901 }
902 }
903 if (!spselflag && MouseX >= 565 + PANEL_LEFT && MouseX < 621 + PANEL_LEFT && MouseY >= 64 + PANEL_TOP && MouseY < 120 + PANEL_TOP) {
904 DoSpeedBook();
905 gamemenu_off();
906 }
907}
908
909void control_set_button_down(int btn_id)
910{

Callers 1

LeftMouseDownFunction · 0.85

Calls 2

DoSpeedBookFunction · 0.85
gamemenu_offFunction · 0.85

Tested by

no test coverage detected