| 133 | } |
| 134 | |
| 135 | command_result follow (color_ostream &out, std::vector <std::string> & parameters) |
| 136 | { |
| 137 | if (!parameters.empty()) |
| 138 | return CR_WRONG_USAGE; |
| 139 | |
| 140 | if (followedUnit) |
| 141 | { |
| 142 | out.print("No longer following previously selected unit.\n"); |
| 143 | followedUnit = 0; |
| 144 | } |
| 145 | followedUnit = Gui::getSelectedUnit(out); |
| 146 | if (followedUnit) |
| 147 | { |
| 148 | is_enabled = true; |
| 149 | std::ostringstream ss; |
| 150 | ss << "Unpause to begin following " << world->raws.creatures.all[followedUnit->race]->name[0]; |
| 151 | if (followedUnit->name.has_name) ss << " " << followedUnit->name.first_name; |
| 152 | ss << ". Simply manually move the view to break the following.\n"; |
| 153 | out.print("{}", ss.str()); |
| 154 | } |
| 155 | else followedUnit = 0; |
| 156 | is_enabled = (followedUnit != NULL); |
| 157 | return CR_OK; |
| 158 | } |
nothing calls this directly
no test coverage detected