| 31 | { |
| 32 | |
| 33 | TransactionScreen::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 | |
| 64 | void TransactionScreen::changeBase(sp<Base> newBase) |
| 65 | { |
nothing calls this directly
no test coverage detected