Commit Graph

754 Commits (jgrpp)

Author SHA1 Message Date
Jonathan G Rennison 18a42664fc Merge branch 'master' into jgrpp
Remove 'byte' typedef
1 week ago
Jonathan G Rennison d90c540f9e Enable economy day length scaling in wallclock timekeeping mode 2 weeks ago
Jonathan G Rennison 0150f8f570 Merge branch 'master' into jgrpp
# Conflicts:
#	src/network/network_server.cpp
4 weeks ago
Rubidium 5d8e40cad4 Codechange: use int32_t instead of uint16_t for scroll bar position/size/capacity
(cherry picked from commit d09b5aaeba)

# Conflicts:
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/widget_type.h
2 months ago
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2 months ago
Peter Nelson 0058ebe472
Codechange: Check cheap station-facility-filter before expensive in-use-filter. (#12317) 2 months ago
Jonathan G Rennison fe730bce31 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/codeql.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	src/map.cpp
#	src/music/midifile.hpp
#	src/order_cmd.cpp
#	src/order_gui.cpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/pbs.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_text.cpp
#	src/ship_cmd.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_func.h
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/viewport.cpp
#	src/waypoint_cmd.cpp
2 months ago
Rubidium 27eadc13ec Codechange: rename TILE_ADD(XY) to TileAdd(XY) 2 months ago
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2 months ago
Jonathan G Rennison a816829cd1 Merge branch 'master' into jgrpp
# Conflicts:
#	src/station_gui.cpp
#	src/vehicle_cmd.cpp
#	src/vehicle_gui.cpp
3 months ago
Peter Nelson d4f0f0e2c5
Codechange: Use `GetVisibleRangeIterators()` in more places. (#12190)
This replaces more first/last index calculation, along with indexed array/vector access, with iterator access instead.
3 months ago
Jonathan G Rennison a98a56669b Merge branch 'master' into jgrpp
# Conflicts:
#	regression/regression/result.txt
#	src/autoreplace_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/network/network_content.cpp
#	src/newgrf_roadstop.cpp
#	src/pathfinder/yapf/yapf_ship.cpp
#	src/road_gui.cpp
#	src/saveload/ai_sl.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_gui.cpp
#	src/video/cocoa/cocoa_ogl.h
#	src/video/sdl2_opengl_v.h
#	src/video/video_driver.hpp
#	src/video/win32_v.h
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
#	src/window.cpp
3 months ago
Jonathan G Rennison b13b2781bd Add string codes for upstream wallclock mode, add upstream language changes 3 months ago
Jonathan G Rennison 39b4772a34 Convert speed units in station rating tooltip
See: #645
3 months ago
Peter Nelson 2c78146da5 Change: Limit cargo types in station cargo filter, with "More..." option to show all. 3 months ago
Peter Nelson e517e55620 Change: Include count of stations per cargo type in station cargo filter.
Cargo types with no stations are shaded to make the list clearer.
3 months ago
Peter Nelson 46da56b191 Change: Replace long list of cargo filter buttons with a multi-select dropdown list.
As before, hold ctrl while clicking on an item to toggle selections.
3 months ago
frosch 68c64d2511 Codechange: Remove TKM string codes by duplicating strings. 4 months ago
Jonathan G Rennison 606d7cd814 Merge branch 'master' into jgrpp
# Conflicts:
#	src/airport_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/direction_type.h
#	src/gfx_type.h
#	src/group_gui.cpp
#	src/misc_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/signs_gui.cpp
#	src/slope_func.h
#	src/smallmap_gui.cpp
#	src/terraform_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/town_type.h
#	src/vehicle_type.h
#	src/widget_type.h
4 months ago
Peter Nelson 7737aa6640 Codechange: Make all NWidgetPart arrays constexpr.
This ensures that the arrays are not created at runtime and prevents using non-constexpr values.
4 months ago
Jonathan G Rennison 3050620189 Merge branch 'master' into jgrpp
# Conflicts:
#	src/autoreplace_cmd.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.cpp
#	src/economy.cpp
#	src/engine_gui.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/newgrf.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/order_base.h
#	src/order_cmd.cpp
#	src/order_func.h
#	src/order_gui.cpp
#	src/pathfinder/pathfinder_type.h
#	src/saveload/afterload.cpp
#	src/subsidy_base.h
#	src/vehicle_cmd.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
4 months ago
Peter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
4 months ago
Jonathan G Rennison 61db988a4a Fix time since pickup values in station rating tooltips with day length
See: #625
4 months ago
Jonathan G Rennison 97e6f3062e Adding of _t to (u)int types, and WChar to char32_t
See: eaae0bb5e
4 months ago
Jonathan G Rennison f034714559 Use StringBuilder for GetString/GetStringWithArgs, as per upstream
Update dependent code as required
4 months ago
Jonathan G Rennison 42c8f50551 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	.gitignore
#	COMPILING.md
#	src/company_gui.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/engine_func.h
#	src/fileio.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/order_gui.cpp
#	src/osk_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/script/api/script_event_types.hpp
#	src/sl/oldloader_sl.cpp
#	src/smallmap_gui.cpp
#	src/station_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_func.h
#	src/widgets/dropdown_type.h
#	src/widgets/group_widget.h
#	src/widgets/vehicle_widget.h
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
5 months ago
Peter Nelson 7124b4eef1 Codechange: Use std::unique_ptr for all NWidgets. 5 months ago
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
5 months ago
Peter Nelson b86182ab84 Codechange: Use std::map to provide indexed widget access.
This removes the need to determine the biggest widget index and replaces C-style memory handling.
5 months ago
Jonathan G Rennison d5a7a67b8c Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	src/ai/ai_gui.cpp
#	src/blitter/32bpp_optimized.cpp
#	src/blitter/32bpp_simple.cpp
#	src/blitter/32bpp_sse2.cpp
#	src/blitter/8bpp_optimized.cpp
#	src/blitter/8bpp_simple.cpp
#	src/blitter/null.cpp
#	src/blitter/null.hpp
#	src/company_gui.cpp
#	src/game/game_gui.cpp
#	src/genworld_gui.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/graph_gui.cpp
#	src/industry_gui.cpp
#	src/linkgraph/linkgraphjob.cpp
#	src/network/network_gui.cpp
#	src/newgrf_debug_gui.cpp
#	src/openttd.cpp
#	src/pathfinder/npf/aystar.h
#	src/road_gui.cpp
#	src/saveload/order_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/script/api/script_log.cpp
#	src/script/api/script_town.cpp
#	src/script/script_gui.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_table.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/sortlist_type.h
#	src/spritecache.cpp
#	src/spriteloader/grf.cpp
#	src/spriteloader/grf.hpp
#	src/spriteloader/spriteloader.hpp
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/station_gui.cpp
#	src/strings.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/video/opengl.cpp
#	src/video/opengl.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
#	src/window_gui.h
5 months ago
Jonathan G Rennison 2e06374f6f Merge branch 'master' into jgrpp
# Conflicts:
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/gfx_func.h
#	src/group_gui.cpp
#	src/industry_gui.cpp
#	src/misc_gui.cpp
#	src/news_gui.cpp
#	src/settings_gui.cpp
#	src/ship_gui.cpp
#	src/smallmap_gui.cpp
#	src/station_gui.cpp
#	src/subsidy_gui.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/vehicle_gui.cpp
#	src/viewport.cpp
#	src/widget.cpp
#	src/widgets/dropdown.cpp
#	src/window.cpp
5 months ago
Peter Nelson 58c252b81a Cleanup: Remove unnecessary pressed button offset code. 5 months ago
Peter Nelson e749bbefe5
Change: Show rating in station list even with no cargo waiting. (#11540)
e745bd9 (r21144) changed the filter from cargo waiting to rating, which makes the station list display appear inconsistent with the cargo filter selection.
5 months ago
Peter Nelson 07a8bd21e4 Fix: Make station list filters use per-window state instead of global state.
Changing filters with multiple windows open would have unexpected effects leading to inconsistent state.

Now state is loaded and saved when the window is opened and closed, so state is still persistent.
5 months ago
Peter Nelson dcf730f1f6 Codechange: Optionally allow passing state to GUIList sorter function.
GUIList sorter functions can currently only use global state, which makes per-window-instance sorting difficult.
5 months ago
Peter Nelson 9122b4eb47
Codechange: SetMinimalTextLines(1, 0) is implied for widgets with text. (#11536) 6 months ago
Jonathan G Rennison 88670a230f Merge branch 'master' into jgrpp
# Conflicts:
#	src/articulated_vehicles.cpp
#	src/articulated_vehicles.h
#	src/base_media_base.h
#	src/base_media_func.h
#	src/build_vehicle_gui.cpp
#	src/dock_gui.cpp
#	src/main_gui.cpp
#	src/music_gui.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content.cpp
#	src/newgrf.cpp
#	src/newgrf_roadstop.cpp
#	src/os/windows/string_uniscribe.h
#	src/os/windows/win32.cpp
#	src/rail_gui.cpp
#	src/road.cpp
#	src/road_gui.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/smallmap_gui.cpp
#	src/strings.cpp
#	src/terraform_gui.cpp
#	src/tests/test_script_admin.cpp
#	src/tests/test_window_desc.cpp
#	src/timer/timer_game_calendar.h
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/viewport.cpp
#	src/widget_type.h
#	src/window.cpp
#	src/window_gui.h
6 months ago
Jonathan G Rennison 21b49a213e Merge branch 'master' into jgrpp
# Conflicts:
#	src/cheat_gui.cpp
#	src/main_gui.cpp
#	src/network/network_gui.cpp
#	src/saveload/saveload.h
#	src/smallmap_gui.cpp
#	src/station_cmd.cpp
#	src/timetable_cmd.cpp
#	src/toolbar_gui.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown_type.h
6 months ago
Jonathan G Rennison 2a31095118 Merge branch 'master' into jgrpp
# Conflicts:
#	regression/regression/result.txt
#	src/aircraft_cmd.cpp
#	src/airport_gui.cpp
#	src/articulated_vehicles.cpp
#	src/console_cmds.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout_fallback.cpp
#	src/group_gui.cpp
#	src/hotkeys.cpp
#	src/network/core/tcp_connect.cpp
#	src/network/core/tcp_listen.h
#	src/newgrf.cpp
#	src/newgrf.h
#	src/newgrf_engine.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_station.cpp
#	src/openttd.cpp
#	src/order_gui.cpp
#	src/os/macosx/osx_main.cpp
#	src/pathfinder/yapf/yapf_node_rail.hpp
#	src/rail_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/cargopacket_sl.cpp
#	src/saveload/linkgraph_sl.cpp
#	src/saveload/station_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_table.cpp
#	src/settingsgen/settingsgen.cpp
#	src/station.cpp
#	src/station_cmd.cpp
#	src/strings.cpp
#	src/timer/timer_game_calendar.cpp
#	src/timer/timer_game_calendar.h
#	src/timer/timer_manager.h
#	src/timer/timer_window.cpp
#	src/timetable_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/vehicle_cmd.h
#	src/vehicle_gui.cpp
#	src/viewport.cpp
#	src/widgets/dropdown.cpp
#	src/window_func.h
#	src/window_gui.h
6 months ago
Peter Nelson c18a1494b7
Codechange: Remove FONT_HEIGHT_... macros. (#11481)
These make it look like we're dealing with a constant, but actually each is a call to `GetCharacterHeight(...)`.
6 months ago
Jonathan G Rennison 0d4d4a9cac Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/CompileFlags.cmake
#	src/3rdparty/squirrel/squirrel/sqclosure.h
#	src/3rdparty/squirrel/squirrel/sqobject.h
#	src/3rdparty/squirrel/squirrel/sqvm.h
#	src/aircraft.h
#	src/airport_gui.cpp
#	src/blitter/32bpp_sse_func.hpp
#	src/blitter/null.hpp
#	src/bridge_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/cargotype.h
#	src/cheat_gui.cpp
#	src/command.cpp
#	src/command_func.h
#	src/company_gui.cpp
#	src/console_gui.cpp
#	src/date_gui.cpp
#	src/depot_gui.cpp
#	src/dock_gui.cpp
#	src/economy.cpp
#	src/error_gui.cpp
#	src/fileio.cpp
#	src/fios.cpp
#	src/fios_gui.cpp
#	src/fontcache/spritefontcache.h
#	src/framerate_gui.cpp
#	src/game/game_text.cpp
#	src/gamelog.cpp
#	src/genworld_gui.cpp
#	src/gfx_layout_fallback.cpp
#	src/group_gui.cpp
#	src/highscore_gui.cpp
#	src/hotkeys.cpp
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/main_gui.cpp
#	src/misc_cmd.cpp
#	src/misc_gui.cpp
#	src/network/core/tcp_game.cpp
#	src/network/core/udp.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_content_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf_airport.cpp
#	src/newgrf_airport.h
#	src/newgrf_airporttiles.cpp
#	src/newgrf_airporttiles.h
#	src/newgrf_animation_base.h
#	src/newgrf_canal.cpp
#	src/newgrf_commons.h
#	src/newgrf_config.cpp
#	src/newgrf_debug_gui.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_engine.h
#	src/newgrf_generic.cpp
#	src/newgrf_gui.cpp
#	src/newgrf_house.cpp
#	src/newgrf_house.h
#	src/newgrf_industries.cpp
#	src/newgrf_industries.h
#	src/newgrf_industrytiles.cpp
#	src/newgrf_industrytiles.h
#	src/newgrf_object.cpp
#	src/newgrf_object.h
#	src/newgrf_railtype.cpp
#	src/newgrf_railtype.h
#	src/newgrf_roadstop.cpp
#	src/newgrf_roadstop.h
#	src/newgrf_roadtype.cpp
#	src/newgrf_roadtype.h
#	src/newgrf_spritegroup.cpp
#	src/newgrf_spritegroup.h
#	src/newgrf_station.cpp
#	src/newgrf_station.h
#	src/newgrf_town.cpp
#	src/newgrf_town.h
#	src/news_gui.cpp
#	src/object_gui.cpp
#	src/order_gui.cpp
#	src/os/macosx/crashlog_osx.cpp
#	src/os/unix/crashlog_unix.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/os/windows/win32_main.cpp
#	src/pathfinder/npf/npf.cpp
#	src/pathfinder/npf/queue.cpp
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/roadveh.h
#	src/saveload/saveload.cpp
#	src/screenshot.cpp
#	src/script/api/script_text.hpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_table.cpp
#	src/signs_cmd.cpp
#	src/signs_gui.cpp
#	src/smallmap_gui.cpp
#	src/smallmap_gui.h
#	src/spriteloader/grf.hpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/station_map.h
#	src/statusbar_gui.cpp
#	src/stdafx.h
#	src/strgen/strgen.cpp
#	src/table/newgrf_debug_data.h
#	src/terraform_gui.cpp
#	src/timer/timer_game_calendar.cpp
#	src/timer/timer_window.cpp
#	src/town.h
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/water_cmd.cpp
#	src/waypoint_cmd.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/rail_widget.h
#	src/widgets/terraform_widget.h
#	src/window.cpp
#	src/window_gui.h
6 months ago
Jonathan G Rennison c929f7075e Merge branch 'master' into jgrpp
# Conflicts:
#	cmake/SourceList.cmake
#	src/build_vehicle_gui.cpp
#	src/company_gui.cpp
#	src/console_cmds.cpp
#	src/depot_base.h
#	src/elrail.cpp
#	src/network/core/udp.cpp
#	src/network/network_admin.cpp
#	src/network/network_chat_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf_engine.cpp
#	src/newgrf_railtype.cpp
#	src/newgrf_railtype.h
#	src/newgrf_storage.h
#	src/os/unix/crashlog_unix.cpp
#	src/rail.h
#	src/rail_cmd.cpp
#	src/rail_gui.cpp
#	src/road_cmd.cpp
#	src/road_map.h
#	src/saveload/labelmaps_sl.cpp
#	src/settings_gui.cpp
#	src/settings_type.h
#	src/sl/oldloader_sl.cpp
#	src/station_cmd.cpp
#	src/station_gui.cpp
#	src/table/settings/world_settings.ini
#	src/tests/test_script_admin.cpp
#	src/textfile_gui.cpp
#	src/toolbar_gui.cpp
#	src/train_cmd.cpp
#	src/tunnelbridge_cmd.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
6 months ago
Jonathan G Rennison c76dc937e3 Fix tooltip string parameters, change function signatures to match upstream 6 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
7 months ago
Peter Nelson 9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 7 months ago
Peter Nelson f379b31e28 Add: data parameter in Window::Close method.
This allows passing data when closing a window, e.g. to indicate how it was closed.
7 months ago
Patric Stout e5673a1756 Codechange: cleanup CargoPacket in terms of variable/function names (#11278)
Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.

(cherry picked from commit 30172fc037)
8 months ago
Peter Nelson 69ee38bd43 Codechange: Use GetAcceptanceMask() instead of duplicating it. 8 months ago
frosch b5885295f0 Codechange: Use parameters, which should be used. 8 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 8 months ago