* Make face bits valid and update visible face variables. */
| 1219 | * Make face bits valid and update visible face variables. |
| 1220 | */ |
| 1221 | void UpdateData() |
| 1222 | { |
| 1223 | FaceVars vars = GetCompanyManagerFaceVars(this->face.style); |
| 1224 | ScaleAllCompanyManagerFaceBits(this->face, vars); |
| 1225 | |
| 1226 | uint64_t active_vars = GetActiveFaceVars(this->face, vars); |
| 1227 | /* Exclude active parts which have no string. */ |
| 1228 | for (auto var : SetBitIterator(active_vars)) { |
| 1229 | if (vars[var].name == STR_NULL) ClrBit(active_vars, var); |
| 1230 | } |
| 1231 | |
| 1232 | /* Rebuild the sorted list of face variable pointers. */ |
| 1233 | this->face_vars.clear(); |
| 1234 | for (auto var : SetBitIterator(active_vars)) { |
| 1235 | this->face_vars.emplace_back(&vars[var]); |
| 1236 | } |
| 1237 | std::ranges::sort(this->face_vars, std::less{}, &FaceVar::position); |
| 1238 | |
| 1239 | this->GetScrollbar(WID_SCMF_PARTS_SCROLLBAR)->SetCount(std::size(this->face_vars)); |
| 1240 | } |
| 1241 | |
| 1242 | public: |
| 1243 | SelectCompanyManagerFaceWindow(WindowDesc &desc, Window *parent) : Window(desc) |
no test coverage detected