MCPcopy Create free account
hub / github.com/dborth/vbagx / ScreenPositionWindowUpdate

Function ScreenPositionWindowUpdate

source/menu.cpp:2984–3002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2982}
2983
2984static 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
3004static void ScreenPositionWindowLeftClick(void * ptr) { ScreenPositionWindowUpdate(ptr, -1, 0); }
3005static void ScreenPositionWindowRightClick(void * ptr) { ScreenPositionWindowUpdate(ptr, +1, 0); }

Calls 3

GetStateMethod · 0.80
SetTextMethod · 0.80
ResetStateMethod · 0.45

Tested by

no test coverage detected