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

Function drawInteractionRequest

src/OpenLoco/src/Ui/Windows/DebugWindow.cpp:148–163  ·  view source on GitHub ↗

Basic prototype of requesting the user to click on stuff.

Source from the content-addressed store, hash-verified

146
147 // Basic prototype of requesting the user to click on stuff.
148 static void drawInteractionRequest(Gfx::DrawingContext& drawingCtx, const Widget& widget, WidgetState& state)
149 {
150 auto* window = state.window;
151
152 Ui::Point localPos = {};
153
154 // Center of widget.
155 localPos.x = widget.left + ((widget.right - widget.left) / 2);
156 localPos.y = widget.top + ((widget.bottom - widget.top) / 2);
157
158 auto radius = 4;
159 radius += (window->frameNo / 4) % 12;
160
161 Ui::Point windowPos = state.window->position();
162 drawingCtx.drawCircle(windowPos + localPos, radius, 2, PaletteIndex::red5);
163 }
164
165 static void onUpdate(Ui::Window& window)
166 {

Callers 1

drawFunction · 0.85

Calls 2

drawCircleMethod · 0.80
positionMethod · 0.45

Tested by

no test coverage detected