| 129 | AEquipScreen::~AEquipScreen() = default; |
| 130 | |
| 131 | void AEquipScreen::begin() |
| 132 | { |
| 133 | if (state->current_battle) |
| 134 | { |
| 135 | formMain->findControlTyped<Graphic>("DOLLAR")->setVisible(false); |
| 136 | } |
| 137 | else |
| 138 | { |
| 139 | formMain->findControlTyped<Graphic>("DOLLAR")->setVisible(true); |
| 140 | formMain->findControlTyped<Label>("TEXT_FUNDS")->setText(state->getPlayerBalance()); |
| 141 | } |
| 142 | |
| 143 | auto owner = state->getPlayer(); |
| 144 | if (state->current_battle) |
| 145 | { |
| 146 | owner = state->current_battle->currentPlayer; |
| 147 | } |
| 148 | |
| 149 | if (firstAgent) |
| 150 | { |
| 151 | selectAgent(firstAgent); |
| 152 | } |
| 153 | else |
| 154 | { |
| 155 | for (auto &agent : state->agents) |
| 156 | { |
| 157 | if (!checkAgent(agent.second, owner)) |
| 158 | { |
| 159 | continue; |
| 160 | } |
| 161 | if (agent.second->unit && !agent.second->unit->isConscious()) |
| 162 | { |
| 163 | continue; |
| 164 | } |
| 165 | selectAgent(agent.second); |
| 166 | break; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | auto mode = getMode(); |
| 171 | if (mode == Mode::Enemy) |
| 172 | { |
| 173 | formMain->findControlTyped<Label>("EQUIP_AGENT")->setText(tr("MIND PROBE")); |
| 174 | } |
| 175 | else |
| 176 | { |
| 177 | formMain->findControlTyped<Label>("EQUIP_AGENT")->setText(tr("EQUIP AGENT")); |
| 178 | } |
| 179 | |
| 180 | formMain->findControlTyped<RadioButton>("BUTTON_SHOW_WEAPONS")->setChecked(true); |
| 181 | |
| 182 | updateAgents(); |
| 183 | } |
| 184 | |
| 185 | void AEquipScreen::pause() {} |
| 186 |
no test coverage detected