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

Function draw

src/OpenLoco/src/Ui/Windows/Tutorial.cpp:61–82  ·  view source on GitHub ↗

0x00439B4A

Source from the content-addressed store, hash-verified

59
60 // 0x00439B4A
61 static void draw(Window& self, Gfx::DrawingContext& drawingCtx)
62 {
63 static constexpr StringId titleStringIds[] = {
64 StringIds::tutorial_1_title,
65 StringIds::tutorial_2_title,
66 StringIds::tutorial_3_title,
67 };
68
69 auto tr = Gfx::TextRenderer(drawingCtx);
70
71 auto tutorialNumber = OpenLoco::Tutorial::getTutorialNumber();
72
73 FormatArguments args{};
74 args.push(titleStringIds[tutorialNumber]);
75
76 auto& widget = self.widgets[Widx::frame];
77 auto point = Point(self.x + widget.midX(), self.y + widget.top + 4);
78 tr.drawStringCentred(point, Colour::black, StringIds::tutorial_text, args);
79
80 point.y += 10;
81 tr.drawStringCentred(point, Colour::black, StringIds::tutorial_control);
82 }
83
84 static constexpr WindowEventList kEvents = {
85 .prepareDraw = prepareDraw,

Callers

nothing calls this directly

Calls 5

TextRendererClass · 0.85
getTutorialNumberFunction · 0.85
midXMethod · 0.80
drawStringCentredMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected