MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getForm

Method getForm

forms/ui.cpp:33–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31UI::~UI() = default;
32
33sp<Form> UI::getForm(UString ID)
34{
35 if (forms.find(ID) == forms.end())
36 {
37 auto formPath = UString("forms/") + ID + ".form";
38
39 LogInfo("Trying to load form \"%s\" from \"%s\"", ID, formPath);
40 auto form = Form::loadForm(formPath);
41 if (!form)
42 {
43 LogError("Failed to find form \"%s\" at \"%s\"", ID, formPath);
44 return nullptr;
45 }
46 forms[ID] = form;
47 }
48 return std::dynamic_pointer_cast<Form>(forms[ID]->copyTo(nullptr));
49}
50
51sp<BitmapFont> UI::getFont(UString FontData)
52{

Callers 15

eventOccurredMethod · 0.45
DebugMenuMethod · 0.45
WeeklyFundingScreenMethod · 0.45
BaseSelectScreenMethod · 0.45
BuildingScreenMethod · 0.45
beginMethod · 0.45
InfiltrationScreenMethod · 0.45
BaseDefenseScreenMethod · 0.45
BribeScreenMethod · 0.45
ScoreScreenMethod · 0.45
AlertScreenMethod · 0.45

Calls 2

endMethod · 0.80
copyToMethod · 0.45

Tested by

no test coverage detected