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

Function findAt

src/OpenLoco/src/Ui/WindowManager.cpp:196–242  ·  view source on GitHub ↗

0x004C9A95

Source from the content-addressed store, hash-verified

194
195 // 0x004C9A95
196 Window* findAt(int32_t x, int32_t y)
197 {
198 for (auto it = _windows.rbegin(); it != _windows.rend(); ++it)
199 {
200 auto& w = *it;
201 if (x < w.x)
202 {
203 continue;
204 }
205
206 if (x >= (w.x + w.width))
207 {
208 continue;
209 }
210
211 if (y < w.y)
212 {
213 continue;
214 }
215 if (y >= (w.y + w.height))
216 {
217 continue;
218 }
219
220 if (w.hasFlags(WindowFlags::ignoreInFindAt))
221 {
222 continue;
223 }
224
225 if (w.hasFlags(WindowFlags::noBackground))
226 {
227 auto index = w.findWidgetAt(x, y);
228 if (index == kWidgetIndexNull)
229 {
230 continue;
231 }
232 }
233
234 if (w.callOnResize() == nullptr)
235 {
236 return findAt(x, y);
237 }
238
239 return &w;
240 }
241 return nullptr;
242 }
243
244 Window* findAt(Ui::Point point)
245 {

Callers 15

getItemLeftFunction · 0.85
rightOverFunction · 0.85
getMapCoordinatesFromPosFunction · 0.85
screenGetMapXyWithZFunction · 0.85
findAtAltFunction · 0.85
wheelInputFunction · 0.85
onUpdateFunction · 0.85
setHoverItemTabFunction · 0.85
getVehicleDetailsWindowFunction · 0.85
onUpdateFunction · 0.85
setLegendHoverFunction · 0.85
onUpdateFunction · 0.85

Calls 5

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

Tested by

no test coverage detected