| 2982 | } |
| 2983 | |
| 2984 | static void ScreenPositionWindowUpdate(void * ptr, int x, int y) |
| 2985 | { |
| 2986 | GuiButton * b = (GuiButton *)ptr; |
| 2987 | if(b->GetState() == STATE_CLICKED) |
| 2988 | { |
| 2989 | GCSettings.xshift += x; |
| 2990 | GCSettings.yshift += y; |
| 2991 | |
| 2992 | if(!(GCSettings.xshift > -50 && GCSettings.xshift < 50)) |
| 2993 | GCSettings.xshift = 0; |
| 2994 | if(!(GCSettings.yshift > -50 && GCSettings.yshift < 50)) |
| 2995 | GCSettings.yshift = 0; |
| 2996 | |
| 2997 | char shift[10]; |
| 2998 | sprintf(shift, "%hd, %hd", GCSettings.xshift, GCSettings.yshift); |
| 2999 | settingText->SetText(shift); |
| 3000 | b->ResetState(); |
| 3001 | } |
| 3002 | } |
| 3003 | |
| 3004 | static void ScreenPositionWindowLeftClick(void * ptr) { ScreenPositionWindowUpdate(ptr, -1, 0); } |
| 3005 | static void ScreenPositionWindowRightClick(void * ptr) { ScreenPositionWindowUpdate(ptr, +1, 0); } |
no test coverage detected