| 3317 | } |
| 3318 | |
| 3319 | static void ScreenPositionWindowUpdate(void * ptr, int x, int y) |
| 3320 | { |
| 3321 | GuiButton * b = (GuiButton *)ptr; |
| 3322 | if(b->GetState() == STATE_CLICKED) |
| 3323 | { |
| 3324 | GCSettings.xshift += x; |
| 3325 | GCSettings.yshift += y; |
| 3326 | |
| 3327 | if(!(GCSettings.xshift > -50 && GCSettings.xshift < 50)) |
| 3328 | GCSettings.xshift = 0; |
| 3329 | if(!(GCSettings.yshift > -50 && GCSettings.yshift < 50)) |
| 3330 | GCSettings.yshift = 0; |
| 3331 | |
| 3332 | char shift[10]; |
| 3333 | sprintf(shift, "%hd, %hd", GCSettings.xshift, GCSettings.yshift); |
| 3334 | settingText->SetText(shift); |
| 3335 | b->ResetState(); |
| 3336 | } |
| 3337 | } |
| 3338 | |
| 3339 | static void ScreenPositionWindowLeftClick(void * ptr) { ScreenPositionWindowUpdate(ptr, -1, 0); } |
| 3340 | static void ScreenPositionWindowRightClick(void * ptr) { ScreenPositionWindowUpdate(ptr, +1, 0); } |
no test coverage detected