OpenTTD

Tasklist

FS#6599 - Can still click on buy button in vehicle selection window even if no vehicle is selected

Attached to Project: OpenTTD
Opened by James (james1101) - Thursday, 10 August 2017, 20:40 GMT
Type Bug
Category Core
Status New
Assigned To No-one
Operating System Windows
Severity Medium
Priority Normal
Reported Version 1.7.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

To Reproduce:
1. Open a depot window and click the 'New Vehicles' button.
2. Deselect the vehicle by doing the following:
3. Select a vehicle. (Example: a locomotive without any capacity)
4. Filter the list such that the selected vehicle disappears. (Example: Show only vehicles that can carry <cargo name>.)
5. Click the 'Buy Vehicle' button in the vehicle selection window.
-> Nothing happens. The button is not greyed out, but it does nothing. Please fix this.
This task depends upon

Comment by andythenorth (andythenorth) - Saturday, 12 August 2017, 15:00 GMT
Confirmed - can reproduce this using steps described.
Comment by adf88 (adf88) - Saturday, 19 August 2017, 10:13 GMT
I have something for this, and more.

0-disable-build-button-if-no-engine-selected.diff
Fixes the issue (disables/enables the button when needed).

1-select-first-available-rail-engine-to-buy.diff
Enable auto-selecting first available engine also in train lists (currently, when the selected train is being filtered out, nothing gets selected). Also remove some duplicated code.

2-use-gui-sorlists-for-buildvehgui-engines-sorting.diff
Remove duplicated code and use GUIList class for sorting engine lists.

3-use-gui-sorlists-for-buildvehgui-engines-filtering.diff
Remove duplicated code and use GUIList class for filtering engine lists.

4-uncache-buildvehgui-listviewmode.diff
Remove useless caching of "list-view mode" in BuildVehicleWindow class.

5-uncache-buildvehgui-cargofilterarray.diff
Remove useless caching of cargoes and cargo names in BuildVehicleWindow class.
Comment by adf88 (adf88) - Saturday, 19 August 2017, 12:42 GMT
Sorry, a mistake got in. I'm uploading a fixed patch #3. Now I tried harder at testing ;)

Loading...