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

Function draw

src/OpenLoco/src/Ui/Windows/ToolTip.cpp:228–252  ·  view source on GitHub ↗

0x004C9397

Source from the content-addressed store, hash-verified

226
227 // 0x004C9397
228 static void draw(Ui::Window& window, Gfx::DrawingContext& drawingCtx)
229 {
230 auto tr = Gfx::TextRenderer(drawingCtx);
231
232 const auto x = window.x;
233 const auto y = window.y;
234 const auto width = window.width;
235 const auto height = window.height;
236
237 drawingCtx.drawRect(x + 1, y + 1, width - 2, height - 2, enumValue(ExtColour::unk2D), Gfx::RectFlags::transparent);
238 drawingCtx.drawRect(x + 1, y + 1, width - 2, height - 2, (enumValue(ExtColour::unk74) + enumValue(ObjectManager::get<InterfaceSkinObject>()->tooltipColour)), Gfx::RectFlags::transparent);
239
240 drawingCtx.drawRect(x, y + 2, 1, height - 4, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
241 drawingCtx.drawRect(x + width - 1, y + 2, 1, height - 4, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
242 drawingCtx.drawRect(x + 2, y + height - 1, width - 4, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
243 drawingCtx.drawRect(x + 2, y, width - 4, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
244
245 drawingCtx.drawRect(x + 1, y + 1, 1, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
246 drawingCtx.drawRect(x + width - 1 - 1, y + 1, 1, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
247 drawingCtx.drawRect(x + 1, y + height - 1 - 1, 1, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
248 drawingCtx.drawRect(x + width - 1 - 1, y + height - 1 - 1, 1, 1, enumValue(ExtColour::unk2E), Gfx::RectFlags::transparent);
249
250 auto point = Point(((width + 1) / 2) + x - 1, y + 1);
251 tr.drawStringCentredRaw(point, _lineBreakCount, Colour::black, _text);
252 }
253
254 // 0x004C94F7
255 static void onClose([[maybe_unused]] Ui::Window& window)

Callers

nothing calls this directly

Calls 4

TextRendererClass · 0.85
enumValueFunction · 0.85
drawStringCentredRawMethod · 0.80
drawRectMethod · 0.45

Tested by

no test coverage detected