| 45 | } |
| 46 | |
| 47 | int ScriptTile::uiFrame(const std::string& title, const std::string& note, u32 outline, float z) |
| 48 | { |
| 49 | TextPool& text = TextPool::get(); |
| 50 | card(UI_X, UI_Y, UI_W, UI_H, outline, z); |
| 51 | |
| 52 | float noteW = 0.0f; |
| 53 | if (!note.empty()) { |
| 54 | noteW = text.width(note, NOTE_SIZE); |
| 55 | text.draw(note, UI_X + UI_W - PAD - noteW, UI_Y + PAD + 2, NOTE_SIZE, COLOR_FAINT, z); |
| 56 | noteW += 8; // gap between the title and the note |
| 57 | } |
| 58 | const float titleMax = UI_W - 2 * PAD - noteW; |
| 59 | text.draw(text.truncate(title, titleMax, TITLE_SIZE), UI_X + PAD, UI_Y + PAD - 2, TITLE_SIZE, COLOR_TEXT, z); |
| 60 | |
| 61 | const int lineY = UI_Y + HEADER_H; |
| 62 | C2D_DrawRectSolid((float)(UI_X + PAD), (float)lineY, z, (float)(UI_W - 2 * PAD), 1.0f, COLOR_LINE); |
| 63 | return lineY + 8; |
| 64 | } |
| 65 | |
| 66 | void ScriptTile::uiHints(const std::string& hints, float z) |
| 67 | { |