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

Method begin

game/ui/components/locationscreen.cpp:49–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47LocationScreen::~LocationScreen() = default;
48
49void LocationScreen::begin()
50{
51 auto agentAssignmentPlaceholder = menuform->findControlTyped<Graphic>("AGENT_ASSIGNMENT");
52 agentAssignment = menuform->createChild<AgentAssignment>(state);
53 agentAssignment->init(ui().getForm("city/agentassignment"),
54 agentAssignmentPlaceholder->Location, agentAssignmentPlaceholder->Size);
55 if (building)
56 {
57 menuform->findControlTyped<Label>("TEXT_OWNER_NAME")->setText(tr(building->owner->name));
58 agentAssignment->setLocation(building);
59 }
60 else if (agent)
61 {
62 menuform->findControlTyped<Label>("TEXT_OWNER_NAME")->setText(tr(agent->owner->name));
63 agentAssignment->setLocation(agent);
64 }
65 else if (vehicle)
66 {
67 menuform->findControlTyped<Label>("TEXT_OWNER_NAME")->setText(tr(vehicle->owner->name));
68 agentAssignment->setLocation(vehicle);
69 }
70 else
71 {
72 LogError("Nothing set as owner in LocationScreen?");
73 }
74 menuform->findControlTyped<Label>("TEXT_FUNDS")->setText(state->getPlayerBalance());
75}
76
77void LocationScreen::pause() {}
78

Callers

nothing calls this directly

Calls 6

trFunction · 0.85
getPlayerBalanceMethod · 0.80
initMethod · 0.45
getFormMethod · 0.45
setTextMethod · 0.45
setLocationMethod · 0.45

Tested by

no test coverage detected