Peter Nelson
fd6f1e844a
Codechange: Avoid emplace_back(new()) into a unique_ptr. ( #11384 )
...
This could theoretically leave an unmanaged pointer in certain circumstances, and directly using
make_unique shows intent.
2023-10-20 18:40:48 +01:00
frosch
b6c8f301be
Codechange: Silence warnings about intentionally unused parameters.
2023-09-19 22:49:59 +02:00
Peter Nelson
e8015e497d
Codechange: Use begin/end of nwidget parts of begin/length.
...
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.
And this removes 160~ instances of the lengthof() macro.
2023-09-04 10:20:45 +01:00
Tyler Trahan
f57296a033
Change: Only show platform stopping location in orders when other than default ( #11102 )
2023-07-29 17:59:02 -04:00
PeterN
f814c86389
Codechange: Reorganise hotkey initialisation. ( #10951 )
...
Hotkeys are now initialized inline, and use std::vector instead of
separate static C-arrays and std::string instead of char *. The list end
marker is no longer required.
2023-06-05 18:12:30 +01:00
Peter Nelson
2511649938
Codechange: Use window parent association for dropdowns.
...
This replaces the separate window class and number properties, and
allows the window system to close dropdowns automatically.
2023-06-03 14:17:05 +01:00
PeterN
9eb0cca93a
Fix #10823 , Fix #10811 : Order list has end marker row. ( #10825 )
2023-05-14 13:04:59 +01:00
Peter Nelson
531d1ae8bc
Codechange: Use GetScrolled(Row/Item)FromWidget in more places.
...
In many instances the clicked row position is 'manually' calculated
instead of using the GetScrolledRowFromWidget helper function, with
variations on checks. Replace with the two helpers where possible.
2023-05-12 21:45:32 +01:00
Peter Nelson
e18f688db5
Codechange: Remove various COMMA strings.
2023-05-05 07:07:54 +01:00
PeterN
f1144de509
Feature: Separate rail/road and sea/air velocity units, and add knots. ( #10594 )
...
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
2023-04-08 12:26:13 -04:00
Rubidium
a409e4b026
Add: documention to large functions that have too little documentation according to CodeQL
2023-02-25 23:57:36 +01:00
Rubidium
90f1768006
Codechange: add non-nullptr asserts in cases where it should never be nullptr
...
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
2023-01-14 21:15:23 +01:00
Bernard Teo
8a78fa7121
Feature: Contextual actions for vehicles grouped by shared orders ( #8425 )
2022-11-26 18:03:21 +01:00
Peter Nelson
890b2666d3
Change: Use scaled WidgetDimensions.
2022-11-12 18:28:39 +00:00
Peter Nelson
b6ed595176
Codechange: Prefer suggested widget padding.
2022-11-12 18:28:39 +00:00
Peter Nelson
6f95e04005
Change: Use Rect helpers for widget drawing.
...
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Nicolas Chappe
a9a21e784d
Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders
2022-10-22 14:19:08 +02:00
Michael Lutz
211c630cbe
Codechange: Un-bitstuff order commands.
2021-12-16 22:28:32 +01:00
Michael Lutz
0f64ee5ce1
Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
...
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
a38bbefe1b
Codechange: Untangle command code, flags and error string for DoCommand*.
2021-12-16 22:28:32 +01:00
Michael Lutz
549caca39c
Codechange: Move command arguments to the back of the networked command function calls.
2021-12-16 22:28:32 +01:00
glx22
5799402f7a
Codechange: Rename window related DeleteXXX to match new behaviour
2021-05-29 21:08:25 +02:00
Patric Stout
7648483364
Change: by default, make "unload all" leave stations empty ( #9301 )
2021-05-27 18:56:39 +02:00
rubidium42
b280f16316
Codechange: remove unneeded comparison and casts
...
Division by resize_y is already yielding an unsigned number, so when clicking in the WD_FRAMERECT_TOP you would already get a huge value, so sel would never be negative. So, leave sel an unsigned number and remove the <= check.
2021-05-27 18:30:56 +02:00
Charles Pigott
f1fc083f2b
Change: Make order window hotkeys toggle for load & unload variants
2021-02-13 22:14:58 +00:00
Patric Stout
9aa39d0af9
Fix #7972 : show invalid orders to stations that don't accept your vehicle ( #8516 )
...
Before it was shown as a normal order, but the vehicle was skipping
it. This was rather unclear to the user. Now it is red and contains
text with some hints what is going on.
The text is prefixed rather than post-fixed, as we have many
post-fixes already.
2021-01-08 16:04:44 +01:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
2021-01-08 11:16:18 +01:00
glx22
d8605ad18d
Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops
2020-12-27 10:28:46 +00:00
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
2019-11-10 17:59:20 +00:00
frosch
041088d317
Fix fbbbc6e193
: Crash when creating orders to stations with relocated station sign. ( #7755 )
...
Station::xy is the position of the station sign, and not necessarily a tile of the station.
2019-09-29 22:48:19 +02:00
JMcKiern
fbbbc6e193
Fix #7692 : Added industry tile to GetOrderCmdFromTile() ( #7709 )
...
Sending order command to an industry tile now checks if a neutral_station is available and sends the order to that station
2019-09-04 22:47:21 +02:00
PeterN
b9b34f676b
Change: Always report error when ordering a road vehicle to wrong type of road stop. ( #7316 )
...
This was inconsistent before, depending on road/tram and articulated/single vehicle status.
2019-04-13 12:43:49 +01:00
Henry Wilson
7c8e7c6b6e
Codechange: Use null pointer literal instead of the NULL macro
2019-04-10 23:22:20 +02:00
Michael Lutz
c7b9987d08
Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
...
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
Henry Wilson
a0f36a50e6
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
2019-03-26 20:15:57 +00:00
peter1138
317f69c152
Codechange: Use override specifier in Window-derived classes.
2019-03-24 16:10:04 +01:00
Johannes E. Krause
21ec3e5531
Cleanup: Remove questionable syntax in GetOrderCmdFromTile
2019-03-13 07:47:32 +00:00
Eddi-z
13056aedbc
Add: Conditional order for max. reliability (patch by Cirdan, #6360 ) ( #7017 )
2019-01-05 22:10:37 +01:00
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
2017-08-13 18:38:42 +00:00
frosch
44d1fc4253
(svn r27425) -Fix [FS#5842]: Crash when switching to or taking over companies, when an order window of a vehicle of the new company was opened. Now close those windows.
2015-10-30 17:23:16 +00:00
frosch
8701514172
(svn r26693) -Codechange: Simplify GetOrderCmdFromTile (Juanjo)
2014-07-16 21:06:45 +00:00
frosch
14c4b24405
(svn r26692) -Fix [FS#6059]: Ordering a vehicle to a competitor's rail waypoint displayed an error message. Ignore the click as is done for the other order types to competitor's stuff. (Juanjo)
2014-07-16 20:56:39 +00:00
fonsinchen
64e4e52c33
(svn r26550) -Change: Show measured order times in timetable GUI
2014-05-01 14:53:06 +00:00
fonsinchen
3ee31a8f89
(svn r26547) -Codechange: Collect order travel and wait times independent of timetables
2014-05-01 14:49:16 +00:00
fonsinchen
c915d9fa55
(svn r26546) -Codechange: Make order wait_time, travel_time and max_speed private
2014-05-01 14:48:44 +00:00
rubidium
0463dbdc9e
(svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
2014-04-23 20:13:33 +00:00
rubidium
83eeba28b7
(svn r26086) -Codechange: use AutoDeleteSmallVector instead std::list for dropdowns
2013-11-24 14:46:26 +00:00
rubidium
b3e93d6520
(svn r26057) -Fix: a number of possibly uninitialised variables
2013-11-23 13:12:19 +00:00
rubidium
1b924f194f
(svn r26049) -Codechange: remove some dead code as order can't be NULL there
2013-11-22 21:42:47 +00:00
planetmaker
dc10b6c167
(svn r25894) -Change: Unify behaviour when clicking on different items in the goto dropdown list when giving orders (adf88)
2013-10-20 19:45:27 +00:00
planetmaker
122158b4d8
(svn r25859) -Add [FS#5784]: Hightlight active goto item in order list dropdown (adf88)
2013-10-13 11:06:58 +00:00
planetmaker
2609693fe8
(svn r25858) -Fix [FS#5783]: Goto button in order window was not always lowered when it should (adf88)
2013-10-13 11:06:05 +00:00
planetmaker
7ed5f6edf9
(svn r25857) -Codechange [FS#5783]: Add void goto type to indicate inactivity in order window (adf88)
2013-10-13 11:05:20 +00:00
frosch
e158383118
(svn r25459) -Fix: Disable the depot-refit button in the order GUI, if the consist is not refittable.
2013-06-24 21:02:26 +00:00
frosch
58ae2d5aeb
(svn r25458) -Fix-ish: Enable the autorefit-button in the order GUI in case the vehicle is not auto-refittable but already has a autorefit-order set to allow clearing the refit.
2013-06-24 21:01:05 +00:00
frosch
bfbdbe688e
(svn r25457) -Fix: Do not test EF_AUTO_REFIT for the mail apartment or rotor of aircraft.
2013-06-24 20:58:25 +00:00
frosch
5cb174c6b8
(svn r25412) -Codechange: Make use of Window::OnHotkey
2013-06-15 15:30:44 +00:00
frosch
1b8b1f3f6c
(svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member.
2013-06-15 15:28:09 +00:00
frosch
d9e9710cb3
(svn r25408) -Codechange: Simplify hotkeys by removing unused stuff.
2013-06-15 15:27:33 +00:00
frosch
cd0a57fba3
(svn r25407) -Codechange: Use order hotkey enum instead of function pointers.
2013-06-15 15:27:08 +00:00
frosch
59b71b5666
(svn r25406) -Cleanup: There were two hotkeys to toggle between 'unload' and 'unload if possible'.
2013-06-15 15:26:49 +00:00
frosch
4e4e635916
(svn r25294) -Feature: Add another button to window title bars to resize the window to its default size.
2013-05-26 19:30:07 +00:00
frosch
8157a8afd8
(svn r25290) -Add: Assign string names to notable windows.
2013-05-26 19:25:01 +00:00
frosch
56e4a8c4d6
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
2013-05-26 19:23:42 +00:00
planetmaker
c24374f99c
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
2013-01-08 22:46:42 +00:00
michi_cc
01566d6816
(svn r24834) -Fix [FS#5396]: The autorefit dropdown in the order GUI wasn't always updated when modifying vehicle consists.
2012-12-20 19:44:06 +00:00
michi_cc
c75962e04c
(svn r24833) -Codechange: Replace magic numbers for invalidating vehicle-related windows with an enum.
2012-12-20 19:44:02 +00:00
frosch
b533523258
(svn r24801) -Codechange: Add functions to set integral DParams to suitable values for size computations.
2012-12-08 17:18:51 +00:00
frosch
03736af2ae
(svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default.
2012-11-11 16:10:43 +00:00
frosch
b998cbdff1
(svn r24697) -Codechange: Use WDF_UNCLICK_BUTTONS instead of duplicating the same functionality.
2012-11-11 16:07:46 +00:00
rubidium
6d6be50ae0
(svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files
2012-01-03 21:32:51 +00:00
planetmaker
365bf148b5
(svn r23549) -Codechange: Document and consistently name widgets of order GUI
2011-12-16 18:25:06 +00:00
truebrain
2aa774e831
(svn r23528) -Codechange: move widget enums to widgets/NNN_type.h
2011-12-15 22:22:55 +00:00
michi_cc
34ffd08a19
(svn r23505) -Add: Indication in the order list if the next destination of an order is out of range.
2011-12-13 00:43:48 +00:00
rubidium
b5a2183214
(svn r23484) -Fix [FS#4770]: in case you already have orders, ignore the vehicles when adding an extra order
2011-12-10 19:20:30 +00:00
yexo
e4011426f2
(svn r23172) -Fix (r23088) [FS#4831]: crash when looking at orders from a vehicle that's not in your company
2011-11-09 11:44:12 +00:00
michi_cc
3f853e7a56
(svn r23089) -Add: Allow specifying refits for go-to station orders.
2011-11-04 00:38:59 +00:00
michi_cc
5ee765b2b2
(svn r23088) -Change: Extend the train order GUI with space for a forth button.
2011-11-04 00:38:56 +00:00
frosch
4e5d841d66
(svn r22858) -Feature: Conditional order depending on remaining lifetime of a vehicle. (monoid)
2011-08-30 20:21:01 +00:00
frosch
55a21a940d
(svn r22620) -Change [FS#4651]: Enforce refit orders to be 'always go to depot' orders; service-only and stop-in-depot orders make no sense with refitting.
2011-07-02 16:45:54 +00:00
planetmaker
43c8cd1d5e
(svn r22473) -Codechange: Automatic orders are better called implicit orders as no real order influencing path finding is added
2011-05-18 12:19:58 +00:00
terkhen
10caf391a1
(svn r22343) -Change: Remove pixel limiter for query strings.
2011-04-17 18:42:17 +00:00
frosch
5689b3dbda
(svn r22246) -Fix: Process order window invalidations for specific orders in command-scope.
2011-03-13 21:33:57 +00:00
frosch
f051a81b4e
(svn r22244) -Codechange: Make vehicle windows handle command-/GUI-scope invalidations themself (from autoreplace and refitting).
2011-03-13 21:33:02 +00:00
frosch
ec9540a12a
(svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData().
2011-03-13 21:31:29 +00:00
frosch
2ae863463c
(svn r22236) -Fix (r21457): Disarm a bear-pit, which r22226 almost fell into.
2011-03-13 10:43:41 +00:00
frosch
9cf92e2bd2
(svn r22226) -Codechange: When autoreplace invalidates vehicle windows because the Vehicle index changed, use a better eye-catcher-'data' than 0 to identify them.
2011-03-08 19:41:58 +00:00
frosch
2679051c68
(svn r21985) -Codechange: Use VehicleOrderID where appropiate.
2011-02-05 20:26:55 +00:00
rubidium
773c6765e6
(svn r21961) -Remove: limitation that not loading and not unloading is mutual exclusive
2011-02-04 16:07:42 +00:00
rubidium
4c5ca17486
(svn r21957) -Cleanup: gotodepot and timetabling settings are more or less useless; just don't use depot orders or timetabling if you don't want to use it
2011-02-04 15:13:20 +00:00
frosch
a97d52a29a
(svn r21933) -Codechange: Split cur_order_index into cur_auto_order_index and cur_real_order_index to keep track of the current real order in an unambiguous way.
...
-Fix [FS#4440]: Automatic orders behave now stable wrt. service orders and are not added or removed depending on the need of servicing.
-Fix: Various other issues with automatic orders, e.g. vehicles getting stuck with "no orders" when there are automatic orders at the end of the order list.
2011-01-31 20:44:15 +00:00
rubidium
8017c2a3d7
(svn r21909) -Fix: some missing spaces
2011-01-26 08:14:36 +00:00
rubidium
7eba2bf4d3
(svn r21890) -Cleanup: remove some unneeded includes
2011-01-22 14:52:20 +00:00
rubidium
64f04c3a74
(svn r21642) -Feature: concept of automatic station orders; add stub orders for intermediate stations and remove them when not visiting them anymore. This allows you to see what trains visit a station without actually having to order a vehicle to stop at all stations. Based on patch by fonsinchen
2010-12-26 09:03:19 +00:00
smatz
d8b823142e
(svn r21633) -Fix (r21616): newly created skip-to order was created at wrong place
2010-12-25 12:48:23 +00:00
smatz
889c8d3022
(svn r21616) -Change: do not highlight tile when selecting a vehicle to clone or an order to skip to
2010-12-24 13:13:28 +00:00
terkhen
79e2b3153d
(svn r21516) -Codechange: Add IsGroundVehicle function to the Vehicle class.
2010-12-14 21:26:03 +00:00
rubidium
15e07279dd
(svn r21478) -Change [FS#4297]: improve some order related tooltips. Based on patch by Krille
2010-12-12 14:46:42 +00:00
planetmaker
2a62be547a
(svn r21464) -Add: Explicitly make 'shared orders' an option in the orders menu
2010-12-11 13:38:35 +00:00
rubidium
834f4f157a
(svn r21461) -Feature(tte) [FS#3711]: make it more clear that you're stopping a shared order, and make it possible retain the order list upon unsharing (sbr)
2010-12-11 10:52:45 +00:00