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

Method drawAbout

3ds/source/SettingsScreen.cpp:470–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470void SettingsScreen::drawAbout(void) const
471{
472 std::string ver = StringUtils::versionString();
473
474 C2D_ImageTint brandTint;
475 C2D_PlainImageTint(&brandTint, COLOR_ACCENT, 1.0f);
476 C2D_DrawImageAt(flag, 20, 36, 0.5f, &brandTint, 1.0f, 1.0f);
477 float x = 20 + ceilf(flag.subtex->width * 1.0f) + 8;
478 TextPool::get().draw("Checkpoint", x, 34, 0.62f, COLOR_TEXT);
479 TextPool::get().draw(ver, x, 54, 0.42f, COLOR_FAINT);
480
481 int y = 82;
482 auto line = [&](const std::string& label, const std::string& value) {
483 TextPool::get().draw(label, 20, y, 0.4f, COLOR_FAINT);
484 float lw = TextPool::get().width(value, 0.42f);
485 TextPool::get().draw(value, 300 - lw, y, 0.42f, COLOR_TEXT);
486 y += 24;
487 };
488 line(i18n::t("settings.about.author"), "Bernardo Giordano");
489 line(i18n::t("settings.about.license"), "GPLv3");
490
491 struct statvfs st;
492 if (statvfs("sdmc:/", &st) == 0 && st.f_blocks > 0) {
493 u64 total = (u64)st.f_blocks * st.f_frsize;
494 u64 avail = (u64)st.f_bavail * st.f_frsize;
495 u64 used = total > avail ? total - avail : 0;
496 line(i18n::t("settings.about.sd_card"), i18n::t("settings.about.sd_usage", {StringUtils::humanBytes(used), StringUtils::humanBytes(total)}));
497 }
498
499 drawHints(320, 223, std::string(GLYPH_B) + " " + i18n::t("hint.back"));
500}
501
502void SettingsScreen::drawBottom(void) const
503{

Callers

nothing calls this directly

Calls 7

getFunction · 0.85
statvfsClass · 0.85
humanBytesFunction · 0.85
drawHintsFunction · 0.85
stringFunction · 0.85
drawMethod · 0.45
widthMethod · 0.45

Tested by

no test coverage detected