MCPcopy Create free account
hub / github.com/DFHack/dfhack / draw

Method draw

plugins/stockflow.cpp:174–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 }
173
174 void draw(building_stockpilest *sp) {
175 if (sp->id != stockpile_id) {
176 if (!collect_settings(sp)) {
177 Core::printerr("Stockflow job collection failed!\n");
178 return;
179 }
180 }
181
182 auto dims = Gui::getDwarfmodeViewDims();
183 int left_margin = dims.menu_x1 + 1;
184 int x = left_margin;
185 int y = dims.y2 - 2; // below autodump, automelt, autotrade, stocks, stockpiles
186
187 int links = 0;
188 links += sp->links.give_to_pile.size();
189 links += sp->links.take_from_pile.size();
190 links += sp->links.give_to_workshop.size();
191 links += sp->links.take_from_workshop.size();
192 if (links + 12 >= y)
193 y += 1;
194
195 OutputHotkeyString(x, y, current_job, "j", true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
196 if (*current_trigger)
197 OutputHotkeyString(x, y, current_trigger, " J", true, left_margin, COLOR_WHITE, COLOR_LIGHTRED);
198 }
199
200
201private:

Callers 1

Calls 3

OutputHotkeyStringFunction · 0.85
printerrFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected