| 174 | static map<activity_type, string> activity_labels; |
| 175 | |
| 176 | static string getActivityLabel(const activity_type activity) |
| 177 | { |
| 178 | string label; |
| 179 | |
| 180 | if (activity_labels.find(activity) != activity_labels.end()) |
| 181 | { |
| 182 | label = activity_labels[activity]; |
| 183 | } |
| 184 | else |
| 185 | { |
| 186 | string raw_label = enum_item_key_str(static_cast<df::job_type>(activity)); |
| 187 | for (auto c = raw_label.begin(); c != raw_label.end(); c++) |
| 188 | { |
| 189 | if (label.length() > 0 && *c >= 'A' && *c <= 'Z') |
| 190 | label += ' '; |
| 191 | |
| 192 | label += *c; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | return label; |
| 197 | } |
| 198 | |
| 199 | |
| 200 | class ViewscreenDwarfStats : public dfhack_viewscreen |
no test coverage detected