Commit Graph

203 Commits (14363bfb511ac9d81beaa31783ea54c8c8c6e8c4)

Author SHA1 Message Date
Darkvater 38edab372b (svn r7450) -Codechange: Remove dead code, caption is set in the next switch block of vehicle list for all cases (Tron) 18 years ago
Darkvater 88f8d5d84d (svn r7435) -Fix (r7418): Add proper tooltips to the manage list button instead of the sort tip 18 years ago
peter1138 088f4984ab (svn r7431) -Fix (r7418): GUI glitch when viewing other player's vehicle lists: bottom panel continued behind resize button. 18 years ago
Darkvater 6774527b3a (svn r7418) -Codechange/Feature: Put back the 'New Vehicles' button in the vehicle list window. As
things won't fit now because of too many buttons, move 'send to depot' and 'autoreplace'
 to a dropdown box (and seperate 'send to depot' and 'send for servicing').
 The 'New Vehicles' button shows a list of all engines you have available for that vehicle
 type (in case of trains all railtypes). Button is only enabled for global list.
18 years ago
Darkvater a518ecbabb (svn r7410) -Codechange/Fix: Remove useless and unfollowable programmatic-resize, and implement it
in a sane way. Correctly specify resize flags for windows and only manually change the
 widgets that the resize system cannot handle (eg centering). This changes r6562, and
 probably some other commits
18 years ago
Darkvater 53f954edd3 (svn r7206) -Codechange: Remove (some of) the magic needed for windows that could be invalid after
a call to DeleteWindow() somewhere else. Also do some cleanup with AllowWindowDescFront()
18 years ago
Darkvater b3c48c0a84 (svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
structs inside their array, and possibly invalidating pointers higher up.
 Meaning that any function called within an wndproc could cause unknown/invalid pointers
 once control was returned to this function. Solved by the introduction of an extra
 abstraction layer, an array of z-window positions that is only concerned with the
 pointers.
18 years ago
Darkvater 21db9ebb8e (svn r7129) -Codechange: Get rid of a global variable that only sets a window's number. 18 years ago
Darkvater d50f6c8a8c (svn r7128) -Codechange: Replace magic numbers by magic enums (windowdesc positioning WDP_AUTO = -1) 18 years ago
Darkvater eadf788cc5 (svn r7022) -Fix [FS#292]: Properly guard against viewing company-sensitive information from
invalid players (eg spectators) which could lead to crashes.
18 years ago
peter1138 2d8708bde1 (svn r7009) - Fix (r1323, r1326): In the replace vehicle window, the left vehicle list was not drawn when an engine was not selected. 18 years ago
Darkvater d303ef94b3 (svn r6925) -Codechange: Be more strict with widget distinctions. WWT_PANEL is only plain panel,
WWT_IMGBTN must contain an image for drawing. Renamed WWT_PANEL_2 to WWT_IMGBTN_2
 because that is what it is. Added WWT_PUSHBTN that is either just a pushable button,
 or a textbutton, which text's drawn dynamically independent of widget.
18 years ago
peter1138 736e3597b5 (svn r6920) - Codechange: Ignore refit options of an engine if it has no capacity. 18 years ago
peter1138 735c636f6f (svn r6912) - Feature: Show a list of cargo types that a vehicle is refittable to in the purchase information window. (mart3p) 18 years ago
peter1138 552e6de4ce (svn r6911) - Codechange: Add extra space to all purchase windows (and the replace window) to allow room for more text. (mart3p) 18 years ago
peter1138 59f78aa2b7 (svn r6910) - Codechange: Supply width of area when drawing purchase info instead of using hardcoded values. (mart3p) 18 years ago
peter1138 74850a7712 (svn r6909) - Codechange: Base the decision to draw rail engine or wagon purchase information on the rail vehicle type, not an arbitrary value. 18 years ago
peter1138 61611711e3 (svn r6908) - Codechange: Modify DrawStringMultiLine() to return the number of pixel lines used, and use it for drawing NewGRF additional text (mart3p) 18 years ago
Darkvater ee27bb497c (svn r6884) -Codechange: Add strict bounds checking in string formatting system.
The last parameter should point to the end of the buffer (eg lastof(buf))
 Courtesy of Tron.
18 years ago
peter1138 8411b3b9fe (svn r6855) - Codechange: When displaying a "quantity of cargo" string, use the {CARGO} command and supply the cargo type and quantity, instead of manually looking up the cargo type's string. 18 years ago
peter1138 cd337672ba (svn r6789) - Codechange: Tidy up VehicleNameSorter() to use no global vars, and match the style of EngineNameSorter(). This also removes a bug where _internal_name_sorter_id was never set properly for anything other than trains. 18 years ago
Darkvater 841afe5c50 (svn r6759) -Codechange: Remove the brainheaded usage of STR_JUST_STRING to pass a StringID 18 years ago
peter1138 8411da7241 (svn r6690) - Fix (r6602): Translate global to per-climate cargo ids before... doing anything with them. (Thanks to MeusH for pointing this out...) 18 years ago
bjarni c968a1c5fc (svn r6689) -Fix: corrected vehicle type in tooltip for the list in the refit window
This was actually not a bug from unifying this window as it was incorrect even before they were merged
18 years ago
bjarni b4974b9d7d (svn r6676) -Fix: [vehicle list windows] mass start/stop now works correctly in shared orders and station lists 18 years ago
bjarni 13918e7cc9 (svn r6672) -Codechange: [depot & vehicle windows] applied SetWindowWidgetsDisabledState() and SetWindowWidgetsHiddenState() to depot and vehicle windows 18 years ago
peter1138 7fb948e1cf (svn r6667) - Codechange: The vehicle list has no horizontal scroll bar, so don't use it to store data; instead, just get the widget's width. 18 years ago
bjarni e341cc1e49 (svn r6652) -Feature: [depot window] depot lists are now sorted, so vehicle 1 is always first and so on
This should not be a big slowdown as it's only called each time the list is generated and will normally be much faster than the list generation itself (only a small % of the total number of vehicles is in the depot)
18 years ago
bjarni 55c7840710 (svn r6647) -Fix: [vehicle list windows] Lists of shared orders are now no longer closed by a window event if the list is empty
The window is now closed when the order is deleted.
   This is because removing windows from a window event is asking for problems
18 years ago
bjarni ff6f83b56c (svn r6646) -Codechange: [vehicle list window] Cleaned up the drawing code
This moved a few of the strings and sprites a few pixels. Hopefully this will work out ok.
18 years ago
bjarni ddb46fe8d8 (svn r6638) -Fix r5652: restored each vehicle list type to their type classes, so it's possible to redraw all lists of one vehicle type again (instead of all types) 18 years ago
glx e27e381d29 (svn r6635) -Fix r6634: incomplete/incorrect assignment 18 years ago
belugas 0305adeb12 (svn r6634) -Fix(r6377): Do not change a widget state after a DrawWindowWidgets, as it is a bit useless
-Fix(r6562): Use the correct widget index for enabling
18 years ago
bjarni ea63050d5f (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel
     It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again

   This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit"
   Control click "Refit" removes the refit part of the order (as the tooltip says)
   The player will still pay the normal refit costs

   Known issues:
      If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity
      Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between

   Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that
      the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well.
      This is something to look into in the future
18 years ago
belugas 753b572400 (svn r6619) -Codechange: Use accessors for disabled_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
18 years ago
peter1138 869b5d3b97 (svn r6615) - Fix (r6601): Fix bug that prevented subtypes appearing in some cases. 18 years ago
bjarni 94c3963841 (svn r6614) -Fix: added check to see if a newly opened refit window is different from NULL before assigning data to it 18 years ago
belugas 2c45339e0a (svn r6612) -Codechange: Use accessors for hidden_state.
Another step toward merging XTDwidget.
The only two files not converted (window.h and widget.c) will be done at the very last commit)
18 years ago
peter1138 c2220a9836 (svn r6608) - Fix (r6601): The scroll bar could fall out of the window... more gui-fu needed... 18 years ago
peter1138 8d5c98ee87 (svn r6607) - Fix (r6601): Fix selection of refit type when the list is scrolled. 18 years ago
peter1138 406d756c6f (svn r6602) - Feature: we now support NewGRF livery refits, as used by DBsetXL, amongst others. This requires a savegame bump to save the cargo subtype. 18 years ago
peter1138 2de71bc234 (svn r6601) - Codechange: Support cargo subtypes in the refit window. The refit window has been altered to support resizing and scrolling. Note that the cargo subtype isn't yet passed for actual refitting yet. (Based on mart3p's patch) 18 years ago
bjarni 3cfa76f0c5 (svn r6591) -Codechange: changed strings that used the word "depot" into one for each vehicle type
This is a request from translators as depot is not valid for all vehicle types in all translations
   This will cause a lot of warnings when generating the lang files. MiHaMiX will fix them in a moment (hopefully)
18 years ago
bjarni f91c43d792 (svn r6586) -Feature: [depot window] added a vehicle list window with all vehicles having a certain depot in their orders
It got one known issue though. The top bar got a plural issue so expect to see stuff like "1 trains" until we figure out why it behaves this way
  Added the button to the depot windows. Made the autoreplace button bigger while I was moving some widgets anyway
  Made road vehicle depot windows start with one more row to make room for the buttons
18 years ago
bjarni 043f72678f (svn r6582) -Codechange: changed GenerateVehicleSortList() to reuse the same allocation over and over if possible (like BuildDepotVehicleList() )
This will prevent some reallocations when sorting vehicle list windows
  It also prevents moving the whole array into a new one each time the list is generated/updated (it used to make the list in one array and then move it into another one each time)
  Also ensured that neither GenerateVehicleSortList() or BuildDepotVehicleList() will never allocate lists longer than the total number of vehicles in the game
18 years ago
bjarni 7c863e6763 (svn r6581) -Fix r6562: [vehicle list windows] fixed an off by one issue when drawing the bottom row of buttons 18 years ago
bjarni 5b60e371a6 (svn r6570) -Feature: added "start all" and "stop all" buttons to the vehicle lists 18 years ago
peter1138 902c3ef1e2 (svn r6565) - Fix (r6562): Missing newline at EOF caused a compiler warning 18 years ago
bjarni 4ccdb0686f (svn r6562) -Codechange: merged the vehicle list window widget arrays
It made no sense to maintain 8 nearly identically arrays when a single one can do the job
  Also made the two buttons always use half of the bottom width each, even when resizing
18 years ago
bjarni b49018f7b1 (svn r6559) -Codechange: [vehicle list windows] moved creation and drawing code into two new functions to make it easier to see what goes on where 18 years ago