Commit Graph

329 Commits

Author SHA1 Message Date
Michael Lutz b0990fcff7 Codechange: Make TileIndex a "strong" typedef to give it a distinct type.
This is accomplished by changing it to a single member struct with the
appropriate operator overloads to make it all work with not too much
source modifications.
2021-12-16 22:28:32 +01:00
Michael Lutz 4fc055d6e9 Codechange: Align parameter order of command callbacks to command handlers. 2021-12-16 22:28:32 +01:00
Michael Lutz 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 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
Bernard Teo 0533b666b7
Fix #9702: Display order window for vehicle group on ctrl-click only when using shared orders (#9704) 2021-11-19 00:03:52 +00:00
Bernard Teo 6a6dbbaad2 Feature: Ctrl-Clicking GB_SHARED_ORDERS vehicle list opens order window 2021-09-18 11:17:49 +02:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
peter1138 c56fce70b4 Codechange: Replace CMD_SET_GROUP_REPLACE_PROTECTION with generic CMD_SET_GROUP_FLAG. 2021-04-22 22:57:00 +02:00
peter1138 27a956ba62 Codechange: Replace Group::replace_protection with Group::flags 2021-04-22 22:57:00 +02:00
Peter Nelson 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
2021-04-21 23:12:10 +02:00
PeterN 8e539ce293
Change: Improve layout and spacing of vehicle group widgets. (#9041)
Existing layout included a blank widget above the group list to align with the vehicle list, however since then an additional sort-by row was added.
Group list size tweaks to match normal row size (at least with normal gui and text size.)
Removed reduction of 2 rows in the group list <- main culprit of odd sizing.
Removed fill attribute on buttons which gave strange sizes, and put it on the group info widget instead.
Tweaked various soft-padding values to line up (centreing text with a 1px offset does not make centred text.)
2021-04-17 19:19:06 +01:00
Bernard Teo f0a24e98f5
Fix #8922: Show vehicle window for single vehicle in shared order grouping (#8926) 2021-04-06 19:30:35 +01:00
SamuXarick a4035af337
Codechange: Apply coding style (#8640)
* Fix: Missing or needed spaces

* Codechange: Remove space

* Codechange: Remove space

* Codechange: More missing spaces

* Codechange: Missing spaces

* Codechange: Remove space

* Codechange: Remove space
2021-02-05 11:00:36 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric Stout c988b4d62b
Fix #8332: aborting group drag&drop could cause crashes with vehicle drag&drop (#8511)
The selected group was not reset when drag&drop was aborted. When
after that vehicle drag&drop was successful, group drag&drop code
was still executed, causing weird behaviour or even crashes.
2021-01-07 10:32:24 +01:00
Bernard Teo 4af1acfe92 Feature: Drag-and-drop vehicles in group GUI for shared order groups 2020-12-21 23:15:53 +01:00
Bernard Teo a5047b7566 Cleanup: Use range-based for-loop in group_gui.cpp 2020-12-21 23:15:53 +01:00
Bernard Teo e59c400ca6 Feature: Option to group vehicle lists by shared orders
This applies to all kinds of vehicle lists, as well as the "vehicle groups" window.
2020-12-21 23:15:53 +01:00
Bernard Teo 584df548f1 Codechange: Make vehicle lists internally support grouping of vehicles
This is in preparation for the new UI feature that allows grouping by shared orders.
2020-12-21 23:15:53 +01:00
Jonathan G Rennison c167648d75 Fix: Violation of strict weak ordering in group name sorters
This could be caused by a group being renamed, and the old
name being cached from a previous sort.

See: #7838
2020-06-18 12:38:43 +02:00
stormcone 492d2704f1 Fix #7974: Crash when CTRL+click to show a vehicle group that is collapsed 2020-02-06 16:10:46 +00:00
Samu 8b0e4bb101 Codechange: Use const instead of magic number for vehicle profit threshold 2020-01-09 13:51:58 +00:00
stormcone cc1d72c3a3 Feature: Control + click on the vehicle details button in the vehicle view window opens the vehicle group window, then selects and scrolls to the vehicle's group. 2019-12-23 18:04:10 +00:00
stormcone a363933d08 Feature: Control + click on a vehicle in the vehicle group window selects and scrolls to the vehicle's group. 2019-12-23 18:04:10 +00:00
stormcone 551bde77a4 Add: A function which selects and scrolls to a particular group in the vehicle group window. 2019-12-23 18:04:10 +00:00
glx 4ae829cb27 Codechange: Replace FOR_ALL_GROUPS with range-based for loops 2019-12-21 20:13:03 +01:00
stormcone 40ebf3c765 Fix: Do not refer to a function in the documentation that was removed years ago (#7844)
The 'DoDrawString' was removed with this commit: f11300d
2019-11-25 22:59:03 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
glx22 b3fd787959 Fix #7188: check the validity of command callback for scripts (#7701) 2019-09-07 17:37:01 +01:00
glx 2db88953e7 Codechange: use std::sort() in GUIList 2019-04-13 12:49:18 +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
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 2019-03-28 00:09:33 +01:00
Charles Pigott 49f7332b75 Feature #6053: Collapsible vehicle groups (3298) 2019-03-27 06:58:48 +00:00
Charles Pigott 8890436af1 Add #6189: Groups now count the total number of vehicles in subgroups (3298) 2019-03-27 06:58:48 +00:00
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 2019-03-26 20:15:57 +00:00
Henry Wilson ab711e6942 Codechange: Replaced SmallVector::[Begin|End]() with std alternatives 2019-03-26 20:15:57 +00:00
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 2019-03-26 20:15:57 +00:00
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 2019-03-26 20:15:57 +00:00
Henry Wilson 9cba6f7193 Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit() 2019-03-26 20:15:57 +00:00
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 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
PeterN 3a4b6b476b
Change: Use selected group as parent when creating a new group. (#7224) 2019-02-15 18:43:33 +00:00
PeterN 23960d0f2c Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection.

This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired.

* Feature: Add vehicle group liveries.
2019-01-31 14:57:44 +01:00
Peter Nelson 310fa1af88 Codechange: Rename function to match what it does and reduce code indenting. 2019-01-28 20:29:43 +01:00
Peter Nelson fe37b40385 Fix: Group hierarchy not visible in RTL languages. 2019-01-28 20:29:43 +01:00
Peter Nelson 15320a37b9 Change: OnGameTick() is only called when not paused. 2019-01-11 11:56:21 +00:00
Peter Nelson 2a8fa5fef9 Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks. 2019-01-11 11:56:21 +00:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
peter1138 19d56a33e8 (svn r27822) -Feature: Vehicle Group Info: Add profits and occupancy display to group vehicle list (mtm, JGR) 2017-03-24 07:33:31 +00:00
frosch ddc9205212 (svn r27630) -Codechange: Deduplicate code to attach vehicle to cursor. 2016-08-15 18:33:52 +00:00
frosch 235b7946fc (svn r27300) -Fix [FS#6306]: Silence GCC warning (Cif) 2015-06-20 11:05:11 +00:00
peter1138 0877f892c5 (svn r26960) -Codechange: Draw sort button symbols as sprites, and pad sort buttons with non-static width. 2014-10-05 11:20:02 +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
peter1138 fc0646c229 (svn r26455) -Change: Prompt for confirmation when deleting a vehicle group. 2014-04-11 18:14:44 +00:00
peter1138 567d0ff3a7 (svn r26450) -Feature: Hierarchical vehicle subgroups. 2014-04-08 21:09:06 +00:00
frosch 43ec0bf0c1 (svn r25537) -Codechange: Optionally make WWT_MATRIX compute the number of rows and columns from the resize step size. 2013-06-30 14:36:31 +00:00
frosch e184b9799c (svn r25533) -Codechange: Use SetCapacityFromWidget more often. 2013-06-30 14:33:32 +00:00
frosch 98fdd20f84 (svn r25531) -Codechange: Use separate function to set data of WWT_MATRIX widgets. 2013-06-30 14:32:31 +00:00
frosch ce110eed32 (svn r25313) -Fix: Do not assume '8' to be the broadest digit, but test all of them. 2013-06-01 14:33:48 +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
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
terkhen 9b5ff794c7 (svn r24626) -Fix [FS#5432]: MSVC 2010 warnings. 2012-10-25 17:38:12 +00:00
frosch 1ffa7d4488 (svn r24595) -Change [FS#5168]: Make the group GUI drag&drop highlighting behave more intelligible. (based on work by Juanjo) 2012-10-14 19:15:00 +00:00
alberth d00dfaff4c (svn r24550) -Codechange: Remove unused panel widget in the group gui (Juanjo). 2012-09-22 19:16:04 +00:00
alberth adae8b161e (svn r24549) -Codechange: Remove the hard-coded sprite button sizes in the group gui (Juanjo). 2012-09-22 19:15:16 +00:00
alberth 224babe8c4 (svn r24548) -Add: Extra group line in the group gui, if possible (Juanjo). 2012-09-22 19:14:06 +00:00
alberth 4b59344b0d (svn r24547) -Add [FS#5263]: Separate the 'available vehicles' from the other buttons in the group gui (Juanjo). 2012-09-22 19:12:22 +00:00
michi_cc 37e321044a (svn r24139) -Add: Creating a new vehicle group by drag and drop. (Based on patch by Juanjo) 2012-04-17 19:44:16 +00:00
michi_cc 0daf350922 (svn r24138) -Feature(ette): Ctrl+drag to add all vehicles with a shared order list to a group. (Juanjo) 2012-04-17 19:44:12 +00:00
michi_cc 4e5da5760a (svn r24125) -Add [FS#3705]: Drag destination highlighting to the group GUI. (sbr) 2012-04-17 19:43:09 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain f578edd3bc (svn r23533) -Codechange: document and rename widgets to be consistent and understandable 2011-12-16 16:32:48 +00:00
truebrain 2aa774e831 (svn r23528) -Codechange: move widget enums to widgets/NNN_type.h 2011-12-15 22:22:55 +00:00
frosch 107f67bfa4 (svn r23282) -Fix [FS#4844] (r23212): CmdRemoveAllVehiclesGroup() was not passed the vehicle type in all cases, but the type is actually not needed. 2011-11-20 14:39:12 +00:00
frosch bbc3409942 (svn r23080) -Feature: [NewGRF] Use variable 10 to enable vehicle GRFs to draw different sprites on the map and in various GUIs. 2011-11-01 16:51:47 +00:00
peter1138 50d1541270 (svn r23017) -Codechange: Add support for resized scrollbars. 2011-10-11 08:07:47 +00:00
frosch d071eefc54 (svn r22985) -Feature: Display autoreplace status in group GUI. 2011-10-03 17:26:37 +00:00
frosch 23a2f23eb3 (svn r22984) -Feature: Display profit icons for groups in the group GUI. 2011-10-03 17:25:44 +00:00
frosch d6e6e8a9d4 (svn r22983) -Feature: Display the number of vehicles in the group GUI also for the ALL and DEFAULT groups. 2011-10-03 17:25:03 +00:00
frosch b6766c2ed5 (svn r22976) -Codechange: Split group statistics into separate struct. 2011-10-03 17:20:26 +00:00
rubidium fb5ecb9499 (svn r22411) -Document: another bunch of bits 2011-05-02 17:42:12 +00:00
rubidium 46c242b1dc (svn r22385) -Fix [FS#4603]: strnatcmp is in string.cpp, so it ought to be declared in string_func.h. 2011-04-30 14:24:23 +00:00
terkhen 10caf391a1 (svn r22343) -Change: Remove pixel limiter for query strings. 2011-04-17 18:42:17 +00:00
frosch 652c9cb663 (svn r22247) -Codechange: Update comments wrt. ForceRebuild() in command-scope. 2011-03-13 21:34:21 +00:00
frosch ec9540a12a (svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData(). 2011-03-13 21:31:29 +00:00
frosch 77d1dcb926 (svn r22228) -Fix (r22135)[FS#4546]: Do not resort town, industry and signs list directly in OnInvalidateData(). There might be a scheduled rebuild which needs execution first. So, only set a trigger for resorting. 2011-03-08 20:52:59 +00:00
rubidium 7eba2bf4d3 (svn r21890) -Cleanup: remove some unneeded includes 2011-01-22 14:52:20 +00:00
rubidium 768da4b48f (svn r21411) -Codechange: limit group name by amount of characters, not bytes 2010-12-05 22:24:34 +00:00
terkhen 75f86a7a21 (svn r21344) -Feature [FS#4214]: Natural sorting of strings using ICU. 2010-11-27 22:52:12 +00:00
terkhen f31485a2f9 (svn r21241) -Fix: Display dragged vehicles in the correct orientation while using RTL languages. 2010-11-18 17:49:42 +00:00
planetmaker c2a7b82a9f (svn r20997) -Fix: Size of sort buttons for order and vehicle list gui could be too small 2010-10-19 21:48:20 +00:00
rubidium 2e8e148262 (svn r20894) -Fix [FS#4148] (r20772): use correct company name for group window title (sbr) 2010-10-03 19:17:53 +00:00
frosch aeaa8b3f72 (svn r20845) -Fix (r20835): Group GUI was no longer horizontally resizeable. 2010-09-25 17:46:54 +00:00
yexo 2b4870324d (svn r20835) -Fix: the group gui had a small unused area with bigger gui buttons 2010-09-21 20:33:49 +00:00
yexo 95a2d1f907 (svn r20781) -Fix (r20780): FinishInitNested reset this->owner, so set it afterwards 2010-09-10 13:50:47 +00:00