MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetString

Method GetString

TombEngine/Scripting/Internal/TEN/Flow/FlowHandler.cpp:505–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505 const char* FlowHandler::GetString(const char* id) const
506{
507 if (id == nullptr || *id == '\0')
508 {
509 TENLog("Provided string ID is empty.", LogLevel::Warning);
510 return _translationMap.begin()->second[0].c_str();
511 }
512
513 if (!ScriptAssert(_translationMap.find(id) != _translationMap.end(), std::string{ "Couldn't find string " } + id))
514 {
515 return id;
516 }
517 else
518 {
519 return _translationMap.at(std::string(id)).at(0).c_str();
520 }
521}
522
523bool FlowHandler::IsStringPresent(const char* id) const
524{

Callers 15

Str_EnabledFunction · 0.80
Str_LoadSaveFunction · 0.80
RenderOptionsMenuMethod · 0.80
RenderTitleMenuMethod · 0.80
RenderPauseMenuMethod · 0.80
RenderLoadSaveMenuMethod · 0.80
DrawStatisticsMethod · 0.80
DrawExaminesMethod · 0.80
WinMainFunction · 0.80
DialogProcFunction · 0.80
DoInventoryMethod · 0.80

Calls 7

TENLogFunction · 0.85
ScriptAssertFunction · 0.85
c_strMethod · 0.45
beginMethod · 0.45
findMethod · 0.45
endMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected