Moves the mouse to the first attribute "+" button.
| 41 | |
| 42 | // Moves the mouse to the first attribute "+" button. |
| 43 | void FocusOnCharInfo() |
| 44 | { |
| 45 | if (invflag || plr[myplr]._pStatPts <= 0) |
| 46 | return; |
| 47 | |
| 48 | // Find the first incrementable stat. |
| 49 | int pc = plr[myplr]._pClass; |
| 50 | int stat = -1; |
| 51 | for (int i = 4; i >= 0; --i) { |
| 52 | switch (i) { |
| 53 | case ATTRIB_STR: |
| 54 | if (plr[myplr]._pBaseStr >= MaxStats[pc][ATTRIB_STR]) |
| 55 | continue; |
| 56 | break; |
| 57 | case ATTRIB_MAG: |
| 58 | if (plr[myplr]._pBaseMag >= MaxStats[pc][ATTRIB_MAG]) |
| 59 | continue; |
| 60 | break; |
| 61 | case ATTRIB_DEX: |
| 62 | if (plr[myplr]._pBaseDex >= MaxStats[pc][ATTRIB_DEX]) |
| 63 | continue; |
| 64 | break; |
| 65 | case ATTRIB_VIT: |
| 66 | if (plr[myplr]._pBaseVit >= MaxStats[pc][ATTRIB_VIT]) |
| 67 | continue; |
| 68 | break; |
| 69 | default: |
| 70 | continue; |
| 71 | } |
| 72 | stat = i; |
| 73 | } |
| 74 | if (stat == -1) |
| 75 | return; |
| 76 | const auto &rect = ChrBtnsRect[stat]; |
| 77 | SetCursorPos(rect.x + (rect.w / 2), rect.y + (rect.h / 2)); |
| 78 | } |
| 79 | |
| 80 | static int translate_sdl_key(SDL_Keysym key) |
| 81 | { |
no test coverage detected