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

Method TransactionScreen

game/ui/base/transactionscreen.cpp:33–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31{
32
33TransactionScreen::TransactionScreen(sp<GameState> state, bool forceLimits)
34 : BaseStage(state), forceLimits(forceLimits)
35{
36 // Load resources
37 form = ui().getForm("transactionscreen");
38 formItemAgent = form->findControlTyped<Form>("AGENT_ITEM_VIEW");
39 formItemVehicle = form->findControlTyped<Form>("VEHICLE_ITEM_VIEW");
40 formAgentStats = form->findControlTyped<Form>("AGENT_STATS_VIEW");
41 formPersonnelStats = form->findControlTyped<Form>("PERSONNEL_STATS_VIEW");
42
43 formItemAgent->setVisible(false);
44 formItemVehicle->setVisible(false);
45 formAgentStats->setVisible(false);
46 formPersonnelStats->setVisible(false);
47
48 // Assign event handlers
49 onScrollChange = [this](FormsEvent *) { this->updateFormValues(); };
50 onHover = [this](FormsEvent *e) {
51 auto tctrl = std::dynamic_pointer_cast<TransactionControl>(e->forms().RaisedBy);
52 if (!tctrl)
53 {
54 LogError("Non-Transaction Control called a callback? WTF?");
55 return;
56 }
57 this->displayItem(tctrl);
58 };
59
60 // Assign main form contents
61 textViewBaseStatic = form->findControlTyped<Label>("TEXT_BUTTON_BASE_STATIC");
62}
63
64void TransactionScreen::changeBase(sp<Base> newBase)
65{

Callers

nothing calls this directly

Calls 4

updateFormValuesMethod · 0.95
displayItemMethod · 0.95
getFormMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected