MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / findAtAlt

Function findAtAlt

src/OpenLoco/src/Ui/WindowManager.cpp:250–291  ·  view source on GitHub ↗

0x004C9AFA

Source from the content-addressed store, hash-verified

248
249 // 0x004C9AFA
250 Window* findAtAlt(int32_t x, int32_t y)
251 {
252 for (auto it = _windows.rbegin(); it != _windows.rend(); ++it)
253 {
254 auto& w = *it;
255 if (x < w.x)
256 {
257 continue;
258 }
259
260 if (x >= (w.x + w.width))
261 {
262 continue;
263 }
264
265 if (y < w.y)
266 {
267 continue;
268 }
269 if (y >= (w.y + w.height))
270 {
271 continue;
272 }
273
274 if (w.hasFlags(WindowFlags::noBackground))
275 {
276 auto index = w.findWidgetAt(x, y);
277 if (index == kWidgetIndexNull)
278 {
279 continue;
280 }
281 }
282
283 if (w.callOnResize() == nullptr)
284 {
285 return findAt(x, y);
286 }
287
288 return &w;
289 }
290 return nullptr;
291 }
292
293 // 0x004CB966
294 void invalidate(WindowType type)

Callers 1

onUpdateFunction · 0.85

Calls 6

findAtFunction · 0.85
rbeginMethod · 0.80
rendMethod · 0.80
findWidgetAtMethod · 0.80
callOnResizeMethod · 0.80
hasFlagsMethod · 0.45

Tested by

no test coverage detected