MCPcopy Create free account
hub / github.com/EasyRPG/Player / Append

Method Append

src/window_name.cpp:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void 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
57void Window_Name::Update() {
58 Rect const name_size = Text::GetSize(*Font::Default(), name);

Callers 4

RegisterMethod · 0.45
vUpdateMethod · 0.45
testAppendFunction · 0.45
drawable_list.cppFile · 0.45

Calls 4

SePlayMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected