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

Method show

library/modules/Screen.cpp:490–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488static std::map<df::viewscreen*, Plugin*> plugin_screens;
489
490bool Screen::show(std::unique_ptr<df::viewscreen> screen, df::viewscreen *before, Plugin *plugin)
491{
492 CHECK_NULL_POINTER(screen);
493 CHECK_INVALID_ARGUMENT(!screen->parent && !screen->child);
494
495 if (!gps || !gview) return false;
496
497 df::viewscreen *parent = &gview->view;
498 while (parent && parent->child != before)
499 parent = parent->child;
500
501 if (!parent) return false;
502
503 gps->force_full_display_count += 2;
504
505 screen->child = parent->child;
506 screen->parent = parent;
507 df::viewscreen* s = screen.release();
508 parent->child = s;
509 if (s->child)
510 s->child->parent = s;
511
512 if (dfhack_viewscreen::is_instance(s))
513 static_cast<dfhack_viewscreen*>(s)->onShow();
514
515 if (plugin)
516 plugin_screens[s] = plugin;
517
518 return true;
519}
520
521void Screen::dismiss(df::viewscreen *screen, bool to_first)
522{

Callers

nothing calls this directly

Calls 3

is_instanceFunction · 0.85
onShowMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected