0x4C3576
| 773 | |
| 774 | // 0x4C3576 |
| 775 | static void onMouseUp(Ui::Window& window, WidgetIndex_t widgetIndex, [[maybe_unused]] const WidgetId id) |
| 776 | { |
| 777 | switch (widgetIndex) |
| 778 | { |
| 779 | case widx::close_button: |
| 780 | WindowManager::close(&window); |
| 781 | break; |
| 782 | |
| 783 | case widx::tab_build_new_trains: |
| 784 | case widx::tab_build_new_buses: |
| 785 | case widx::tab_build_new_trucks: |
| 786 | case widx::tab_build_new_trams: |
| 787 | case widx::tab_build_new_aircraft: |
| 788 | case widx::tab_build_new_ships: |
| 789 | { |
| 790 | |
| 791 | if (Input::hasFlag(Input::Flags::toolActive)) |
| 792 | { |
| 793 | ToolManager::toolCancel(window.type, window.number); |
| 794 | } |
| 795 | |
| 796 | auto newTab = widgetIndex - widx::tab_build_new_trains; |
| 797 | window.currentTab = newTab; |
| 798 | window.rowHeight = kScrollRowHeight[newTab]; |
| 799 | window.frameNo = 0; |
| 800 | window.currentSecondaryTab = 0; |
| 801 | if (newTab != enumValue(getGameState().lastBuildVehiclesOption)) |
| 802 | { |
| 803 | getGameState().lastBuildVehiclesOption = static_cast<VehicleType>(newTab); |
| 804 | WindowManager::invalidate(WindowType::topToolbar, 0); |
| 805 | } |
| 806 | |
| 807 | auto curViewport = window.viewports[0]; |
| 808 | window.viewports[0] = nullptr; |
| 809 | if (curViewport != nullptr) |
| 810 | { |
| 811 | curViewport->width = 0; |
| 812 | } |
| 813 | |
| 814 | window.holdableWidgets = 0; |
| 815 | window.eventHandlers = &getEvents(); |
| 816 | window.setWidgets(_widgets); |
| 817 | setDisabledTransportTabs(window); |
| 818 | window.invalidate(); |
| 819 | _buildTargetVehicle = -1; |
| 820 | setTrackTypeTabs(&window); |
| 821 | resetTrackTypeTabSelection(&window); |
| 822 | window.rowCount = 0; |
| 823 | window.rowHover = -1; |
| 824 | sub_4B92A5(&window); |
| 825 | window.callOnResize(); |
| 826 | window.callOnPeriodicUpdate(); |
| 827 | window.callPrepareDraw(); |
| 828 | window.initScrollWidgets(); |
| 829 | window.invalidate(); |
| 830 | window.moveInsideScreenEdges(); |
| 831 | break; |
| 832 | } |
nothing calls this directly
no test coverage detected