diff options
author | bjarni <bjarni@openttd.org> | 2007-02-06 11:11:12 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2007-02-06 11:11:12 +0000 |
commit | f626458af7674e508a9ec9743a699e557d1258d8 (patch) | |
tree | e35fe2197ef3aba9cb1b1902312f0f010202376b /src/window.h | |
parent | ec301e0f8a27a3892375c46dfde4a642ce3d8169 (diff) | |
download | openttd-f626458af7674e508a9ec9743a699e557d1258d8.tar.xz |
(svn r8610) -Codechange/Feature: rewrote the list handling in the autoreplace window
-The user will notice the following changes:
All vehicle types behaves in the same way
Adding/removing an engine (new design and so on) can no longer result in the window selecting a new engine
All valid replacements will be displayed since it looks at refitting options as well (this solves the missing ships with the newships GRF)
Since you can't replace an engine into itself, the engine selected in the left list will no longer appear in the right list
-The code changes:
Instead of looping all engines all the time, each list generates a list like the build windows
This ensures consistent list generation since only one function can loop all engines
Unified code for all vehicle types
It now use the lists to call the drawing code in the build vehicle window
Works on selected EngineIDs instead of selected index in the list
Diffstat (limited to 'src/window.h')
-rw-r--r-- | src/window.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/window.h b/src/window.h index 90600ad44..aa1c3b1c0 100644 --- a/src/window.h +++ b/src/window.h @@ -334,11 +334,14 @@ typedef struct { assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(buildvehicle_d)); typedef struct { - byte vehicletype; byte sel_index[2]; EngineID sel_engine[2]; uint16 count[2]; bool wagon_btnstate; // true means engine is selected + EngineList list[2]; + bool update_left; + bool update_right; + bool init_lists; } replaceveh_d; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d)); |