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

Function prepareDraw

src/OpenLoco/src/Ui/Windows/StationWindow.cpp:133–157  ·  view source on GitHub ↗

0x0048E352

Source from the content-addressed store, hash-verified

131
132 // 0x0048E352
133 static void prepareDraw(Window& self)
134 {
135 Common::prepareDraw(self);
136
137 self.widgets[widx::viewport].right = self.width - 4;
138 self.widgets[widx::viewport].bottom = self.height - 14;
139
140 self.widgets[widx::status_bar].top = self.height - 12;
141 self.widgets[widx::status_bar].bottom = self.height - 3;
142 self.widgets[widx::status_bar].right = self.width - 14;
143
144 // Set station status
145 auto station = StationManager::get(StationId(self.number));
146 const char* buffer = StringManager::getString(StringIds::buffer_1250);
147 station->getStatusString((char*)buffer);
148 FormatArguments args{ self.widgets[widx::status_bar].textArgs };
149 args.push(StringIds::buffer_1250);
150
151 self.widgets[widx::centre_on_viewport].right = self.widgets[widx::viewport].right - 1;
152 self.widgets[widx::centre_on_viewport].bottom = self.widgets[widx::viewport].bottom - 1;
153 self.widgets[widx::centre_on_viewport].left = self.widgets[widx::viewport].right - 24;
154 self.widgets[widx::centre_on_viewport].top = self.widgets[widx::viewport].bottom - 24;
155
156 Widget::leftAlignTabs(self, Common::widx::tab_station, Common::widx::tab_cargo_ratings);
157 }
158
159 // 0x0048E470
160 static void draw(Window& self, Gfx::DrawingContext& drawingCtx)

Callers

nothing calls this directly

Calls 11

StationIdEnum · 0.85
getStringFunction · 0.85
getCurrentVehicleTypeFunction · 0.85
enumValueFunction · 0.85
isVehicleTypeAvailableFunction · 0.85
VehicleTypeEnum · 0.85
getFunction · 0.50
FormatArgumentsClass · 0.50
getStatusStringMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected