MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / WindowPushOthersRight

Function WindowPushOthersRight

src/openrct2/interface/Window.cpp:249–274  ·  view source on GitHub ↗

* * rct2: 0x006EE65A */

Source from the content-addressed store, hash-verified

247 * rct2: 0x006EE65A
248 */
249 void WindowPushOthersRight(WindowBase& window)
250 {
251 WindowVisitEach([&window](WindowBase* w) {
252 if (w == &window)
253 return;
254 if (w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront))
255 return;
256 if (w->windowPos.x >= window.windowPos.x + window.width)
257 return;
258 if (w->windowPos.x + w->width <= window.windowPos.x)
259 return;
260 if (w->windowPos.y >= window.windowPos.y + window.height)
261 return;
262 if (w->windowPos.y + w->height <= window.windowPos.y)
263 return;
264
265 w->invalidate();
266 if (window.windowPos.x + window.width + 13 >= ContextGetWidth())
267 return;
268 auto push_amount = window.windowPos.x + window.width - w->windowPos.x + 3;
269 w->windowPos.x += push_amount;
270 w->invalidate();
271 if (w->viewport != nullptr)
272 w->viewport->pos.x += push_amount;
273 });
274 }
275
276 /**
277 *

Callers 5

onOpenMethod · 0.85
onOpenMethod · 0.85
onOpenMethod · 0.85
onOpenMethod · 0.85
onOpenMethod · 0.85

Calls 4

WindowVisitEachFunction · 0.85
ContextGetWidthFunction · 0.85
hasAnyMethod · 0.80
invalidateMethod · 0.45

Tested by

no test coverage detected