MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / MessageOverlay

Method MessageOverlay

3ds/source/MessageOverlay.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include "textpool.hpp"
31
32MessageOverlay::MessageOverlay(Screen& screen, const std::string& mtext, const Style& style) : Overlay(screen), mStyle(style), mText(mtext)
33{
34 // Grow the card to the message before anything is placed: the button row
35 // rides on the card's bottom edge, so its y comes out of the layout too.
36 mLayout = ModalChrome::fitText(mText, SIZE, !mStyle.header.empty());
37 mButton = std::make_unique<Clickable>(
38 ModalChrome::BTN_WIDE_X, mLayout.btnY, ModalChrome::BTN_WIDE_W, ModalChrome::BTN_H, style.buttonBg, style.buttonFg, " OK", true);
39 mButton->selected(true);
40 mPosx = ceilf((320 - StringUtils::textWidth(mText, SIZE)) / 2);
41}
42
43void MessageOverlay::drawTop(void) const
44{

Callers

nothing calls this directly

Calls 2

selectedMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected