0x004C243F
| 824 | |
| 825 | // 0x004C243F |
| 826 | static void onCompanyDropdown(Ui::Window& self, int16_t itemIndex) |
| 827 | { |
| 828 | if (itemIndex == -1) |
| 829 | { |
| 830 | return; |
| 831 | } |
| 832 | |
| 833 | CompanyId companyId = Dropdown::getCompanyIdFromSelection(itemIndex); |
| 834 | |
| 835 | // Try to find an open vehicle list for this company. |
| 836 | auto companyWindow = WindowManager::bringToFront(WindowType::vehicleList, enumValue(companyId)); |
| 837 | if (companyWindow != nullptr) |
| 838 | { |
| 839 | return; |
| 840 | } |
| 841 | |
| 842 | // If not, we'll turn this window into a window for the company selected. |
| 843 | auto company = CompanyManager::get(companyId); |
| 844 | if (company->name == StringIds::empty) |
| 845 | { |
| 846 | return; |
| 847 | } |
| 848 | |
| 849 | self.number = enumValue(companyId); |
| 850 | self.owner = companyId; |
| 851 | |
| 852 | disableUnavailableVehicleTypes(self); |
| 853 | |
| 854 | self.rowCount = 0; |
| 855 | populateVehicleList(self); |
| 856 | |
| 857 | self.rowHover = -1; |
| 858 | |
| 859 | self.callOnResize(); |
| 860 | self.callPrepareDraw(); |
| 861 | self.initScrollWidgets(); |
| 862 | self.invalidate(); |
| 863 | } |
| 864 | |
| 865 | static void onDropdown(Ui::Window& self, WidgetIndex_t widgetIndex, [[maybe_unused]] const WidgetId id, int16_t itemIndex) |
| 866 | { |
no test coverage detected