Commit Graph

154 Commits (42c8f50551d7a7bdd33dfa68578c6ba45dce2bb9)

Author SHA1 Message Date
PeterN 09a32f2ce1
Fix #10335: Set initial scrollbar count for object GUI. (#10336)
This previously happened when the window was resized by itself which was fixed by #10196. Explicitly set the count instead.
1 year ago
Jonathan G Rennison 6a7cad1b47 Add NewGRFClass helper method for whether class ID is valid (for iteration) 1 year ago
Jonathan G Rennison 417416d19b Add NewGRFClass helper method for whether any UI classes available 1 year ago
Jonathan G Rennison 9ada7380ef Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/korean.txt
#	src/misc_gui.cpp
2 years 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
Jonathan G Rennison 5bbf1f5375 Merge branch 'master' into jgrpp
# Conflicts:
#	src/core/geometry_type.hpp
#	src/error_gui.cpp
#	src/rail_gui.cpp
#	src/tree_gui.cpp
#	src/vehicle_gui.cpp
#	src/widgets/dropdown.cpp
2 years ago
PeterN eaf1e33bd7
Fix #10021: Object GUI resized when switching between different objects. (#10196)
* Fix: Scale object gui margin by interface scale.

* Fix: Improve padding on object info text.

* Fix #10021: Resizing for 1/2/4 object views didn't account for interface scale.

As halving and doubling padding is problematic due to rounding, it is now
added on lower view counts instead of removing on higher view counts.
2 years ago
Jonathan G Rennison 728b902e9f No longer use CDECL for GUIList::FilterFunction 2 years ago
Peter Nelson f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2 years ago
Peter Nelson ed60c88b0a Change: Use power-of-2 scaling for some dimensions in GUI.
These are related to drawing sprites that are normally drawn on the
landscape, and should therefore still follow power-of-2 scaling to fit
correctly.
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
Tyler Trahan 3d45bc4abe Feature: Build objects by area 2 years ago
Jonathan G Rennison ece0a43146 Merge branch 'master' into jgrpp
# Conflicts:
#	src/newgrf_station.cpp
2 years ago
Andy 039f90d05f
Feature: add sticky pin to Object Selection UI panel (#10019) 2 years ago
Andy a06d323f03
Feature: add shade widget to Object Selection UI panel (#10020) 2 years ago
Michael Lutz c521b965bd Codechange: Don't use a global for the terrforming error tile. 3 years ago
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map 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 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 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 da282c3ecc Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/ci-build.yml
#	CMakeLists.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/korean.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/russian.txt
#	src/lang/spanish.txt
#	src/misc_gui.cpp
#	src/newgrf.cpp
3 years ago
Tyler Trahan 9d18a8869f Fix #8603: Don't give focus to text filter when opening Object GUI (#9547)
(cherry picked from commit 66620b497b)
3 years ago
Tyler Trahan 66620b497b
Fix #8603: Don't give focus to text filter when opening Object GUI (#9547) 3 years ago
Peter Nelson 7385e780ac Cleanup: nested_array should not be accessed directly.
Replace accesses with GetWidget() as documented.
3 years ago
Jonathan G Rennison edfa04286b Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/release.yml
#	bin/CMakeLists.txt
#	src/dock_gui.cpp
#	src/lang/brazilian_portuguese.txt
#	src/lang/catalan.txt
#	src/lang/czech.txt
#	src/lang/dutch.txt
#	src/lang/english.txt
#	src/lang/english_US.txt
#	src/lang/estonian.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/german.txt
#	src/lang/hungarian.txt
#	src/lang/indonesian.txt
#	src/lang/italian.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/lithuanian.txt
#	src/lang/luxembourgish.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/polish.txt
#	src/lang/portuguese.txt
#	src/lang/romanian.txt
#	src/lang/russian.txt
#	src/lang/serbian.txt
#	src/lang/simplified_chinese.txt
#	src/lang/slovak.txt
#	src/lang/spanish.txt
#	src/lang/spanish_MX.txt
#	src/lang/swedish.txt
#	src/lang/tamil.txt
#	src/lang/ukrainian.txt
#	src/lang/vietnamese.txt
#	src/newgrf.cpp
#	src/newgrf_gui.cpp
#	src/object_gui.cpp
#	src/pathfinder/yapf/yapf_costrail.hpp
#	src/pathfinder/yapf/yapf_node_rail.hpp
#	src/rail_cmd.cpp
#	src/roadveh_cmd.cpp
#	src/town_cmd.cpp
#	src/vehicle.cpp
#	src/water_cmd.cpp
3 years ago
Didac Perez Parera e760c9fbec
Fix: adjust object and rail station selection window padding to be consistent (#8929)
consistent
3 years ago
stormcone bde5396d11 Add: Hotkey to focus the build object class name filter editbox. 3 years ago
Patric Stout fece1c57ca
Codechange: Suppress warnings when asserts are disabled (#8917) 3 years ago
Didac Perez Parera 3878c4781e
Fix #8817: keep NewGRF order for object class sorting (#8818) 3 years ago
Dídac Pérez Parera 8d9aeb3d4e Fix: keep NewGRF order for object class sorting
(cherry picked from commit 83d67fe46bd24cf88272fe2774954c8dc9bb6497)
3 years ago
Jonathan G Rennison dfecdf3afb Merge branch 'master' into jgrpp
# Conflicts:
#	src/dock_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/terraform_gui.cpp
#	src/vehicle.cpp
#	src/video/allegro_v.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/dedicated_v.cpp
#	src/video/sdl2_v.cpp
#	src/video/sdl_v.cpp
#	src/video/win32_v.cpp
3 years ago
SamuXarick cb95b1d2e7 Codechange: Apply coding style 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
Didac Perez Parera 96990b2ea7
Feature: Object class selection string filtering (#8603) 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
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Jonathan G Rennison 387374f1e3 Fix crash when placing unavailable object
In case where object class has no available objects
4 years ago
Jonathan G Rennison f44d75eaf5 Allow building objects by area (1x1 objects only)
Add setting (default on)
4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 5 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
frosch fbd2786329 (svn r27438) -Fix (r27346) [FS#6387]: The build object hotkey no longer checked whether there were any objects defined. 9 years ago
alberth 4f49d636c1 (svn r27346) -Feature: Make the object placement gui an independent window. 9 years ago
alberth a62468bed6 (svn r27345) -Fix-ish: Hide selected view if no object selected. 9 years ago
frosch a8080b6256 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 10 years ago
peter1138 587ad940cc (svn r26950) -Codechange: GUI-scale dancing for NewGRF objects window. 10 years ago
frosch 1b0929a9f0 (svn r26640) -Cleanup: Remove some pointless STR_JUST_STRING detours. 10 years ago
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 10 years ago
frosch ba1779b978 (svn r26241) -Codechange: Remember the GRFFile which filled the TextRefStack in the TextRefStack. 11 years ago
frosch 3d5a91424a (svn r25830) -Fix [FS#5742] (r25540): In BuildObjectWindow, ensure the object spec matrix is always initialized. (sbr) 11 years ago
frosch 4fc6cdfbea (svn r25726) -Fix: Right side of object class string was misaligned. (sbr) 11 years ago
frosch c1bf3122ad (svn r25543) -Cleanup: Make the bridge and object picker not restore their previous size, but the previously saved size. 11 years ago
frosch 83a0174ef2 (svn r25540) -Fix: Unify selecting a new object class in the object GUI. (sbr) 11 years ago
frosch d798766f2e (svn r25539) -Codechange: Setup object GUI matrix before restoring selected object, so that the matrix state can be properly set. (sbr) 11 years ago
frosch bcb0e04bf2 (svn r25538) -Fix [FS#5567] (r25283): Use the UI index of the selected object to make it visible when re-opening the build object window. (sbr) 11 years ago
frosch 43ec0bf0c1 (svn r25537) -Codechange: Optionally make WWT_MATRIX compute the number of rows and columns from the resize step size. 11 years ago
frosch df732f2bae (svn r25534) -Codechange: FinishInitNested calls OnResize, no need to setup scrollbar capacity before that. 11 years ago
frosch 5f8f71edf0 (svn r25532) -Fix: Do not make the minimal size of matrix or panel widgets depend on their number of rows, since that changes when resizing the window. 11 years ago
frosch 98fdd20f84 (svn r25531) -Codechange: Use separate function to set data of WWT_MATRIX widgets. 11 years ago
frosch 4e4e635916 (svn r25294) -Feature: Add another button to window title bars to resize the window to its default size. 11 years ago
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 11 years ago
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 11 years ago
alberth c3a7ed5a65 (svn r25284) -Feature: When opening the object-build window, restore the object build-window to the previous state (sbr). 11 years ago
alberth 4037251c82 (svn r25283) -Add: When opening the object-build window, make the selected object visible again in the selector (sbr). 11 years ago
alberth 4bdf33a1df (svn r25282) -Add: When opening the object-build window, try to restore the last selected object (sbr). 11 years ago
alberth ca5b64a433 (svn r25281) -Add: When opening the object-build window, make the last selected class visible in the class selector (sbr). 11 years ago
rubidium 2f7d9a2851 (svn r25274) -Cleanup: remove unused class instance variables 11 years ago
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 12 years ago
frosch 3d3ab26ee6 (svn r24379) -Fix [FS#5218-ish]: Do not resize the object GUI when selecting objects. Rather clip the object name. 12 years ago
frosch 1f3227eb69 (svn r24299) -Change [FS#5057]: Center object previews in 1- and 2-view selectors based on the 4-view selector layout. 12 years ago
frosch cd50c86294 (svn r24178) -Fix [FS#5110]: The object name from property A was not displayed in the object GUI. 12 years ago
frosch 5e59c5cd7f (svn r24176) -Fix (r21772): The object GUI did not draw objects when all objects of a class are disabled. 12 years ago
frosch 6baef585cf (svn r24175) -Fix (r24171): Make sure to select a object class with visible objects when opening the object GUI. 12 years ago
frosch 971b3b5fa5 (svn r24171) -Fix [FS#4967, FS#5120]: Hide object specs/classes from the GUI, if they will never be available to the user. 12 years ago
frosch c841a78f69 (svn r24167) -Codechange: Rename NewGRFClass::GetCount() to NewGRFClass::GetClassCount() 12 years ago
frosch 0f0e7e43cf (svn r24166) -Codechange: Turn NewGRFClass::Get(Tid, uint) and GetCount(Tid) into non-static members GetSpec(uint) and GetSpecCount(). 12 years ago
frosch 6f4d2160c2 (svn r24162) -Codechange: Remove NewGRFClass::GetName() and SetName() in favour of using Get() and direct member access (which is needed anyway for GRF string resolving). 12 years ago
frosch 1b0d3e3034 (svn r24159) -Fix: If you spent hard work on finding an available object ID, you should probably also use it instead of always 0. 12 years ago
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 13 years ago
planetmaker 985d178c37 (svn r23545) -Codechange: Consistently name widgets in build object window 13 years ago
truebrain 2aa774e831 (svn r23528) -Codechange: move widget enums to widgets/NNN_type.h 13 years ago
frosch d8f8909f85 (svn r23142) -Change: [NewGRF v8] Unify the return values of callbacks returning D0xx texts. 13 years ago
frosch ba7356b520 (svn r22725) -Fix: Always draw NewGRF supplied texts with a default colour. 13 years ago
frosch f93c8ce5aa (svn r22627) -Codechange: Rename PrepareTextRefStackUsage() to StartTextRefStackUsage() to make it more obvious that you must call StopTextRefStackUsage() at some point. Also extent the documentation. 13 years ago
alberth 28092366ec (svn r22459) -Doc: Typo fixes and doxygen markup improvements. 13 years ago
frosch 5e449b8fae (svn r22429) -Add: some constants for specific palette colours used in the GUI. 13 years ago
frosch 22286bd7b6 (svn r22421) -Fix: Replace various references to Windows palette greyscale indices with the DOS palette indices. 13 years ago
frosch 4269170c9b (svn r22231) -Feature(ette): [NewGRF] Make var 0x48 available in CB 0x15C. 13 years ago
rubidium 7eba2bf4d3 (svn r21890) -Cleanup: remove some unneeded includes 14 years ago
alberth 7be31ee03e (svn r21801) -Fix (r21772): Attach scrollbar to select matrix in object gui. 14 years ago
alberth e8e535f58c (svn r21775) -Add: Allow vertical resizing of the newobject gui. 14 years ago
alberth 313654f18d (svn r21773) -Change: Remove the dropdown, and make BOW_OBJECT_LIST a list of newobject classes. 14 years ago
alberth b1546da65e (svn r21772) -Feature: Add a clickable display of the available objects in the newobject gui. 14 years ago
rubidium 77aa035e4a (svn r21455) -Feature [NewGRF]: selecting of different views of an object 14 years ago
rubidium 5d0da9492e (svn r21454) -Codechange: add support for object variable 48 14 years ago