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

Function CheckStoreBtn

Source/stores.cpp:2721–2771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2719}
2720
2721void CheckStoreBtn()
2722{
2723 int y;
2724
2725 if (qtextflag) {
2726 qtextflag = FALSE;
2727 if (leveltype == DTYPE_TOWN)
2728 sfx_stop();
2729 } else if (stextsel != -1 && MouseY >= 32 && MouseY <= SPANEL_WIDTH) {
2730 if (!stextsize) {
2731 if (MouseX < 344 + PANEL_LEFT || MouseX > 616 + PANEL_LEFT)
2732 return;
2733 } else {
2734 if (MouseX < 24 + PANEL_LEFT || MouseX > 616 + PANEL_LEFT)
2735 return;
2736 }
2737 y = (MouseY - 32) / 12;
2738 if (stextscrl && MouseX > 600 + PANEL_LEFT) {
2739 if (y == 4) {
2740 if (stextscrlubtn <= 0) {
2741 STextUp();
2742 stextscrlubtn = 10;
2743 } else {
2744 stextscrlubtn--;
2745 }
2746 }
2747 if (y == 20) {
2748 if (stextscrldbtn <= 0) {
2749 STextDown();
2750 stextscrldbtn = 10;
2751 } else {
2752 stextscrldbtn--;
2753 }
2754 }
2755 } else if (y >= 5) {
2756 if (y >= 23)
2757 y = 22;
2758 if (stextscrl && y < 21 && !stext[y]._ssel) {
2759 if (stext[y - 2]._ssel) {
2760 y -= 2;
2761 } else if (stext[y - 1]._ssel) {
2762 y--;
2763 }
2764 }
2765 if (stext[y]._ssel || stextscrl && y == 22) {
2766 stextsel = y;
2767 STextEnter();
2768 }
2769 }
2770 }
2771}
2772
2773void ReleaseStoreBtn()
2774{

Callers 1

LeftMouseDownFunction · 0.85

Calls 4

sfx_stopFunction · 0.85
STextUpFunction · 0.85
STextDownFunction · 0.85
STextEnterFunction · 0.85

Tested by

no test coverage detected