MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / OverviewDraw

Method OverviewDraw

src/openrct2-ui/windows/Staff.cpp:544–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542 }
543
544 void OverviewDraw(Drawing::RenderTarget& rt)
545 {
546 // Draw the viewport no sound sprite
547 if (viewport != nullptr)
548 {
549 WindowDrawViewport(rt, *this);
550
551 if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
552 {
553 GfxDrawSprite(rt, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this));
554 }
555 }
556
557 // Draw the centred label
558 auto staff = GetStaff();
559 if (staff == nullptr)
560 {
561 return;
562 }
563 auto ft = Formatter();
564 staff->FormatActionTo(ft);
565 const auto& widget = widgets[WIDX_BTM_LABEL];
566 auto screenPos = windowPos + ScreenCoordsXY{ widget.midX(), widget.top };
567 int32_t widgetWidth = widget.width() - 1;
568 drawTextEllipsised(rt, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::centre });
569 }
570
571 void DrawOverviewTabImage(Drawing::RenderTarget& rt)
572 {

Callers

nothing calls this directly

Calls 9

WindowDrawViewportFunction · 0.85
GfxDrawSpriteFunction · 0.85
drawTextEllipsisedFunction · 0.85
FormatActionToMethod · 0.80
midXMethod · 0.80
widthMethod · 0.80
FormatterClass · 0.70
ImageIdClass · 0.50

Tested by

no test coverage detected