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

Method drawBorder

library/modules/Screen.cpp:409–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409bool Screen::drawBorder(const std::string &title)
410{
411 if (!gps) return false;
412
413 auto dim = getWindowSize();
414 Pen border('\xDB', 8);
415 Pen text(0, 0, 7);
416 Pen signature(0, 0, 8);
417
418 for (int x = 0; x < dim.x; x++)
419 {
420 doSetTile(border, x, 0, false);
421 doSetTile(border, x, dim.y - 1, false);
422 }
423 for (int y = 0; y < dim.y; y++)
424 {
425 doSetTile(border, 0, y, false);
426 doSetTile(border, dim.x - 1, y, false);
427 }
428
429 paintString(signature, dim.x-8, dim.y-1, "DFHack");
430
431 return paintString(text, (dim.x - title.length()) / 2, 0, title);
432}
433
434bool Screen::clear()
435{

Callers

nothing calls this directly

Calls 2

doSetTileFunction · 0.85
lengthMethod · 0.80

Tested by

no test coverage detected