MCPcopy Create free account
hub / github.com/crossuo/crossuo / DeleteConsoleTypePrefix

Method DeleteConsoleTypePrefix

src/TextEngine/GameConsole.cpp:452–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452void CGameConsole::DeleteConsoleTypePrefix(GAME_CONSOLE_TEXT_TYPE type)
453{
454 const wstr_t prefix = wstr_from(s_ConsolePrefix[type]);
455 switch (type)
456 {
457 case GCTT_YELL:
458 case GCTT_WHISPER:
459 case GCTT_EMOTE:
460 case GCTT_C:
461 case GCTT_BROADCAST:
462 case GCTT_PARTY:
463 {
464 auto str = g_GameConsole.GetTextW();
465 if (str.find(prefix) == 0)
466 {
467 str.erase(str.begin(), str.begin() + prefix.length());
468 g_GameConsole.SetTextW(str);
469 }
470
471 break;
472 }
473 default:
474 break;
475 }
476}
477
478void CGameConsole::SetConsoleTypePrefix(GAME_CONSOLE_TEXT_TYPE type)
479{

Callers

nothing calls this directly

Calls 7

wstr_fromFunction · 0.85
GetTextWMethod · 0.80
findMethod · 0.80
eraseMethod · 0.80
lengthMethod · 0.80
beginMethod · 0.45
SetTextWMethod · 0.45

Tested by

no test coverage detected