Commit Graph

814 Commits (c7e95d5b03bf7498c00596ed38f88d102d26b30f)

Author SHA1 Message Date
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.
10 months ago
Jonathan G Rennison 02aecca5ae Conditional order: Replace "next station" with manually set station 10 months ago
Jonathan G Rennison 8dc635b516 Order window: Fix misalignment of shared order vehicles button 10 months ago
Jonathan G Rennison 668a0f774a Window: Add accessors for cached NWidgetLeaf dimensions 10 months ago
Tyler Trahan f57296a033
Change: Only show platform stopping location in orders when other than default (#11102) 11 months ago
Jonathan G Rennison d09b504bc5 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-source.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	COMPILING.md
#	src/ai/ai_core.cpp
#	src/ai/ai_gui.cpp
#	src/bridge_gui.cpp
#	src/company_gui.cpp
#	src/console_cmds.cpp
#	src/core/CMakeLists.txt
#	src/core/smallmap_type.hpp
#	src/disaster_vehicle.h
#	src/effectvehicle_base.h
#	src/fontcache.cpp
#	src/game/game_core.cpp
#	src/game/game_gui.cpp
#	src/gamelog.cpp
#	src/gamelog_internal.h
#	src/group_gui.cpp
#	src/linkgraph/linkgraph.h
#	src/misc.cpp
#	src/network/core/config.h
#	src/network/core/udp.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content_gui.cpp
#	src/network/network_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_profiling.cpp
#	src/newgrf_profiling.h
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/openttd.h
#	src/order_gui.cpp
#	src/os/windows/font_win32.cpp
#	src/rail_gui.cpp
#	src/road.cpp
#	src/road_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/script/api/script_controller.cpp
#	src/script/api/script_roadtypelist.cpp
#	src/script/script_config.cpp
#	src/script/script_config.hpp
#	src/script/script_instance.cpp
#	src/script/script_scanner.cpp
#	src/script/squirrel.cpp
#	src/script/squirrel_helper.hpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/table/settings/network_private_settings.ini
#	src/timetable_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/window_gui.h
1 year ago
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.
1 year ago
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.
1 year ago
Jonathan G Rennison 326d0c329c Remove some unnecessary colour strings 1 year ago
Jonathan G Rennison 2ed248a61d Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	src/aircraft_cmd.cpp
#	src/airport_gui.cpp
#	src/articulated_vehicles.cpp
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout.cpp
#	src/misc_gui.cpp
#	src/newgrf.cpp
#	src/newgrf_config.h
#	src/newgrf_engine.cpp
#	src/news_gui.cpp
#	src/order_gui.cpp
#	src/roadveh_cmd.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/ship_cmd.cpp
#	src/statusbar_gui.cpp
#	src/table/settings/network_private_settings.ini
#	src/table/settings/network_settings.ini
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle_gui.cpp
1 year ago
Jonathan G Rennison 23ab1cb3d0 Show ctrl-click function of shared orders button in tooltip 1 year ago
Jonathan G Rennison 3cbd1a5a76 Add conditional order test for whether slot is empty/not empty 1 year ago
PeterN 9eb0cca93a
Fix #10823, Fix #10811: Order list has end marker row. (#10825) 1 year ago
Jonathan G Rennison c4fc71339a Update orders window when renaming/removing dispatch schedule 1 year ago
Jonathan G Rennison 2abdd27d02 Fix crash when selecting conditional orders in order window 1 year ago
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.
1 year ago
Jonathan G Rennison 54221de0f5 Allow entering decimal day/minute timetable values 1 year ago
Jonathan G Rennison e7f7cd06bd Simplify timetable time/duration string management 1 year ago
Jonathan G Rennison 4c2244cc21 Viewport: Refactor handling of vehicle route overlays 1 year ago
Jonathan G Rennison b089b561a5 Add departure board via order subtype to remove via for prior terminus 1 year ago
Jonathan G Rennison 284390cf6a Order window: Fix resizing of release slot and label button rows 1 year ago
Peter Nelson e18f688db5 Codechange: Remove various COMMA strings. 1 year ago
Jonathan G Rennison 211c1ba61d Allow naming scheduled dispatch schedules 1 year ago
Jonathan G Rennison 6445d688ed Fix crash due to missing case in order window goto dropdown 1 year ago
Jonathan G Rennison 698253c56f Fix auto-close of order management button dropdown in order mode 1 year ago
Jonathan G Rennison 7da25820ea Merge branch 'master' into jgrpp
# Conflicts:
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
1 year ago
Jonathan G Rennison 82803b98e0 Merge branch 'master' into jgrpp
# Conflicts:
#	src/game/game_gui.cpp
#	src/graph_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf.cpp
#	src/order_gui.cpp
#	src/saveload/engine_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_text.cpp
#	src/script/script_gui.cpp
#	src/settings_table.cpp
#	src/strings.cpp
#	src/table/settings/economy_settings.ini
#	src/table/settings/locale_settings.ini
#	src/timetable_gui.cpp
1 year ago
Jonathan G Rennison 359fe89d2f Don't use occupancy of unload and leave empty orders for occupancy average 1 year ago
Jonathan G Rennison 17e289015e Adjust string names for label orders 1 year ago
Jonathan G Rennison 06e0f39aff Add text label and departure board via orders 1 year ago
Jonathan G Rennison 3b6f7c09ad Allow changing colour of orders in order list and timetable windows 1 year ago
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.
1 year ago
Jonathan G Rennison 211fdd62b2 Initial support for multi-part (pseudo-articulated) ships 1 year ago
Jonathan G Rennison 2ea1766677 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/league_sl.cpp
#	src/saveload/saveload.h
#	src/script/api/script_object.hpp
#	src/script/squirrel_helper.hpp
#	src/settings_table.cpp
#	src/station_cmd.cpp
#	src/table/settings.h.preamble
#	src/tree_cmd.cpp
#	src/tree_map.h
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
1 year ago
Rubidium a409e4b026 Add: documention to large functions that have too little documentation according to CodeQL 1 year ago
Jonathan G Rennison fef39b5797 Use backup/restore wrappers for various _cur_dpi changes 1 year ago
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.
1 year ago
Jonathan G Rennison 6d4474b84e Merge tag '13.0-beta2' into jgrpp
# Conflicts:
#	src/cheat_gui.cpp
#	src/company_gui.cpp
#	src/console_gui.cpp
#	src/depot_gui.cpp
#	src/error_gui.cpp
#	src/gfx.cpp
#	src/graph_gui.cpp
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/lang/korean.txt
#	src/lang/polish.txt
#	src/misc_gui.cpp
#	src/network/network_content_gui.h
#	src/newgrf_debug_gui.cpp
#	src/order_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/station_gui.cpp
#	src/subsidy_gui.cpp
#	src/table/settings/gui_settings.ini
#	src/timetable_gui.cpp
#	src/town_gui.cpp
#	src/train_cmd.cpp
#	src/vehicle_gui.cpp
#	src/viewport.cpp
#	src/water_cmd.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
2 years ago
Jonathan G Rennison 02e19521bc Merge branch 'master' into jgrpp
# Conflicts:
#	src/build_vehicle_gui.cpp
#	src/cheat_gui.cpp
#	src/company_gui.cpp
#	src/error_gui.cpp
#	src/fios_gui.cpp
#	src/gfx_func.h
#	src/graph_gui.cpp
#	src/group_gui.cpp
#	src/misc_gui.cpp
#	src/newgrf_debug_gui.cpp
#	src/order_gui.cpp
#	src/road_gui.cpp
#	src/roadveh_gui.cpp
#	src/settings_gui.cpp
#	src/ship_gui.cpp
#	src/station_gui.cpp
#	src/statusbar_gui.cpp
#	src/subsidy_gui.cpp
#	src/timetable_gui.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/widgets/dropdown.cpp
#	src/window_gui.h
2 years ago
Bernard Teo 8a78fa7121
Feature: Contextual actions for vehicles grouped by shared orders (#8425) 2 years ago
Jonathan G Rennison 03a9912a2b Vehicle list commands now take into account cargo type filter
Start/stop
Send to depot type commands
Add to new group
Change order target
2 years ago
Jonathan G Rennison cb9c657f59 Fix selected state of dispatch is/not first/last dropdown in order window 2 years ago
Jonathan G Rennison cbf41a6343 Fix crash when clicking counter or schedule non-train conditional order 2 years ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2 years ago
Peter Nelson b6ed595176 Codechange: Prefer suggested widget padding. 2 years ago
Peter Nelson 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2 years ago
Jonathan G Rennison 1518c2fa1e Merge branch 'master' into jgrpp
# Conflicts:
#	src/depot_type.h
#	src/lang/german.txt
#	src/order_gui.cpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/script/api/script_window.hpp.in
#	src/settings_table.cpp
#	src/train_cmd.cpp
2 years ago
Jonathan G Rennison 5135e03539 Order window: Add button to toggle order management button 2 years ago
Nicolas Chappe a9a21e784d Codechange: Always set the ODATFB_NEAREST_DEPOT flag for 'any depot' orders 2 years ago
Jonathan G Rennison 38c2fa3b66 Add a change counter value special order type 2 years ago
Jonathan G Rennison 91af0c82d3 Adjust CmdModifyOrder p2 bit allocation 2 years ago
Jonathan G Rennison d61fbb977e Add order management dropdown, add duplicate order and move jump target
Add setting to control if order management button shown

Move order list management to order management dropdown if enabled

See: #439
2 years ago
Jonathan G Rennison abe49c0b83 Fix release slot order buttons in ship/aircraft orders window
See: #438
2 years ago
Jonathan G Rennison 432717b21d Enabled shared orders and occupancy buttons for competitor order windows 2 years ago
Jonathan G Rennison 4e8a8a5e0a Add conditional order to test if last/next dispatch slot is first/last 2 years ago
Melvin Vermeeren d48234c81b
Add GUI setting to show order occupancy by default 2 years ago
Jonathan G Rennison 4897fded95 Add hotkey to toggle via state of order
See: #398
2 years ago
Jonathan G Rennison 5f511f8a65 Fix incorrect check preventing ordering road vehicles to incompatible depots 2 years ago
Jonathan G Rennison e5a421b65a Merge branch 'master' into jgrpp
# Conflicts:
#	src/economy.cpp
#	src/linkgraph/refresh.cpp
#	src/order_cmd.cpp
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_base.h
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_cmd.cpp
2 years ago
Jonathan G Rennison c69ed1711d Allow road vehicle go to station/waypoint orders to have a direction 2 years ago
Jonathan G Rennison b4fc0b4dc5 Initial implementation of road waypoints 2 years ago
Jonathan G Rennison 904ff6757d Add slot support to road vehicles, ships and aircraft 2 years ago
Jonathan G Rennison ce61f6439c Allow non-train vehicles to test counter values in conditional orders 2 years ago
Jonathan G Rennison 91ed26415e Fix manual setting of conditional order jump taken travel times 2 years ago
Jonathan G Rennison ff3473fe6a Add support for multiple scheduled dispatch schedules per order list 2 years ago
Michael Lutz 211c630cbe Codechange: Un-bitstuff order commands. 3 years ago
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.
3 years ago
Michael Lutz a38bbefe1b Codechange: Untangle command code, flags and error string for DoCommand*. 3 years ago
Michael Lutz 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Jonathan G Rennison f54d69a60a Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/economy.cpp
#	src/elrail.cpp
#	src/graph_gui.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/network/core/game_info.cpp
#	src/newgrf_station.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/strings_func.h
#	src/table/settings/network_settings.ini
#	src/table/settings/settings.ini
3 years ago
Jonathan G Rennison aff6dbec2d Show timetabled 0 wait times for stations/depots in timetable window 3 years ago
Jonathan G Rennison 53139c2405 Add current day/month to tracerestrict and conditional order conditionals 3 years ago
Patric Stout ab74800b8e Change: by default, make "unload all" leave stations empty (#9301)
(cherry picked from commit 7648483364)
3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
Patric Stout 7648483364
Change: by default, make "unload all" leave stations empty (#9301) 3 years ago
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.
3 years ago
Jonathan G Rennison 912c62d749 Add timetable lateness/earliness conditional order 3 years ago
Jonathan G Rennison 7e62af94ee Remove OVEERIDE macro 3 years ago
Jonathan G Rennison e95216b59d Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/core/geometry_func.cpp
#	src/date.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/object_gui.cpp
#	src/openttd.cpp
#	src/settings_type.h
#	src/video/allegro_v.cpp
#	src/video/dedicated_v.cpp
#	src/video/null_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
Jonathan G Rennison aa85ebe51e Show warning icon in order window if there are timetable warnings 3 years ago
Charles Pigott f1fc083f2b Change: Make order window hotkeys toggle for load & unload variants 3 years ago
Jonathan G Rennison 8a814bbfe3 Add release slot train order 3 years ago
Jonathan G Rennison d42ad99688 Add conditional order for current time/date 3 years ago
Jonathan G Rennison b7ddd486cf Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/aircraft_cmd.cpp
#	src/blitter/32bpp_anim.cpp
#	src/cargopacket.cpp
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/core/pool_func.hpp
#	src/date.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/ground_vehicle.cpp
#	src/ground_vehicle.hpp
#	src/group_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/linkgraph/linkgraph_gui.cpp
#	src/linkgraph/mcf.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_station.cpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_common.hpp
#	src/saveload/saveload.cpp
#	src/settings_gui.cpp
#	src/station_cmd.cpp
#	src/station_kdtree.h
#	src/string_func.h
#	src/table/settings.ini
#	src/tgp.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/train_cmd.cpp
#	src/train_gui.cpp
#	src/tree_gui.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
#	src/viewport.cpp
#	src/viewport_sprite_sorter_sse4.cpp
#	src/window.cpp
3 years ago
Jonathan G Rennison 6c3e5642f8 Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/crashlog.cpp
#	src/fileio.cpp
#	src/fileio_func.h
#	src/fios_gui.cpp
#	src/ini_load.cpp
#	src/ini_type.h
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/network/network_client.cpp
#	src/order_base.h
#	src/order_cmd.cpp
#	src/os/windows/win32.cpp
#	src/road_cmd.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/settings.cpp
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/settings.ini
#	src/tree_cmd.cpp
#	src/tree_gui.cpp
#	src/vehicle_base.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/cocoa/event.mm
#	src/video/cocoa/wnd_quartz.mm
#	src/viewport.cpp
#	src/widgets/tree_widget.h
3 years ago
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.
4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
glx22 d8605ad18d Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops 4 years ago
Jonathan G Rennison b20df78b49 Add feature to append the reverse of an order list 4 years ago
Jonathan G Rennison 9984f39c96 Add feature to reverse the order of an order list
See: #120
4 years ago
Jonathan G Rennison 5556ef38b0 Fix GUI limit for cargo waiting amount conditional order 4 years ago
Jonathan G Rennison c0c0c9c340 Fix updating selected order when changing order list 4 years ago
Jonathan G Rennison e1aca1ab34 Extend Order::flags to 16 bits, fixes conditional order target field size
Adjust order packing and CmdInsertOrder

See: #198
4 years ago
Jonathan G Rennison 6e17f9bf5d Use p3 for order indices which don't fit into p1
Fix insert/modify order overflowing p1
Don't use text field for change timetable
4 years ago
Jonathan G Rennison 9ee8091ecc Add conditional order which tests counter value 4 years ago
Jonathan G Rennison 2b9c633d50 Add leave early if any/all cargoes fully loaded timetable modes 4 years ago
Jonathan G Rennison 37683d8f50 Cargo type orders window: Use single command to change all cargoes at once 4 years ago
Jonathan G Rennison 3a9b38bb10 Cargo type orders window: Use two columns when more than 32 cargos 4 years ago
Jonathan G Rennison 05dc785f13 Split STR_ORDER_CONDITIONAL_CARGO string into two, adjust format
See: #172
4 years ago
Jonathan G Rennison 0202211514 Conditional orders: Add slot acquire modes to train in slot conditional 4 years ago