| 224 | } |
| 225 | |
| 226 | MainScreen::MainScreen(const InputState&) |
| 227 | { |
| 228 | selectionTimer = 0; |
| 229 | snprintf(ver, sizeof(ver), "v%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO); |
| 230 | |
| 231 | backupList = std::make_unique<BackupList>(COL_X, LIST_Y, COL_W, LIST_ROWS * BackupList::ROW_PITCH, LIST_ROWS); |
| 232 | buttonBackup = std::make_unique<Clickable>(COL_X, BTN_BACKUP_Y, BTN_W, BTN_H, COLOR_ACCENT, COLOR_WHITE, i18n::t("main.backup"), true); |
| 233 | buttonRestore = std::make_unique<Clickable>(COL_X, BTN_RESTORE_Y, BTN_W, BTN_H, COLOR_SURFACE, COLOR_TEXT, i18n::t("main.restore"), true); |
| 234 | // Contextual slot stacked above Backup (Receive lives inside the backup |
| 235 | // list, mirroring the 3DS layout): Send when an existing backup is |
| 236 | // highlighted, Scripts otherwise. The Clickable only hit-tests touches; |
| 237 | // the label drawn comes from drawActionButton. |
| 238 | buttonSend = std::make_unique<Clickable>(COL_X, BTN_TRANSFER_Y, BTN_W, BTN_H, COLOR_ACCENT, COLOR_WHITE, i18n::t("transfer.send"), true); |
| 239 | |
| 240 | // The rail Clickables exist only so released() can hit-test touches; the |
| 241 | // rail is drawn by drawRailItem, not by Clickable::draw. |
| 242 | for (int k = 0; k < 4; k++) { |
| 243 | int y = RAIL_ITEM_Y0 + RAIL_ITEM_PITCH * k; |
| 244 | filterButtons[k] = std::make_unique<Clickable>(RAIL_ITEM_X, y, RAIL_ITEM, RAIL_ITEM, COLOR_FILL1, COLOR_TEXT2, "", true); |
| 245 | } |
| 246 | scriptButton = std::make_unique<Clickable>(RAIL_ITEM_X, SCRIPT_BTN_Y, RAIL_ITEM, RAIL_ITEM, COLOR_FILL1, COLOR_TEXT2, "", true); |
| 247 | settingsButton = std::make_unique<Clickable>(RAIL_ITEM_X, SETTINGS_BTN_Y, RAIL_ITEM, RAIL_ITEM, COLOR_FILL1, COLOR_TEXT2, "", true); |
| 248 | avatarButton = std::make_unique<Clickable>(AVATAR_X, AVATAR_Y, AVATAR_SIZE, AVATAR_SIZE, COLOR_TILE, COLOR_TEXT2, "", true); |
| 249 | } |
| 250 | |
| 251 | int MainScreen::selectorX(size_t i) const |
| 252 | { |
nothing calls this directly
no outgoing calls
no test coverage detected