| 44 | } |
| 45 | |
| 46 | void Window_Name::Append(std::string_view text) { |
| 47 | // Avoid string copies by reusing the buffer in name |
| 48 | name.append(text.begin(), text.end()); |
| 49 | if (Text::GetSize(*Font::Default(), name).width <= (12 * 6)) { |
| 50 | Refresh(); |
| 51 | } else { |
| 52 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Buzzer)); |
| 53 | name.resize(name.size() - text.size()); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | void Window_Name::Update() { |
| 58 | Rect const name_size = Text::GetSize(*Font::Default(), name); |
no test coverage detected