Commit Graph

97 Commits

Author SHA1 Message Date
Peter Nelson 5b35fbd6f5
Change: Use button aspect ratio for buttons that show vehicle icons. (#12636) 2024-05-09 07:01:56 +01:00
Peter Nelson 16eb17418b Change: Use aspect ratios for some common widgets. 2024-04-19 22:11:16 +01:00
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 2024-03-10 10:14:20 +01:00
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.
2024-01-16 21:57:05 +00:00
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.
2023-12-30 00:23:57 +00:00
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
2023-11-02 22:25:01 +00:00
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.
2023-10-13 20:47:28 +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
Rubidium 74924c8186 Codechange: includes must be before 'safeguards.h' 2023-06-18 21:22:14 +02:00
Jonathan G Rennison ec7f9f63f6 Feature: Add coverage button to waypoint window 2023-06-04 16:54:48 +01:00
Bouke Haarsma 93d2d4590f Fix #9995: Adjust viewport zoom level for HiDPI displays
On HiDPI screens the zoom level is increased for detailed rendering. This causes hard-coded zoom levels to be off by this adjustment. To fix these default zoom levels, we scale the zoom level based on `_gui_zoom` to get the scaled zoom level.
2022-10-18 22:03:21 +02:00
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint 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
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 2021-05-29 21:08:25 +02:00
PeterN 330a305c99
Fix: Apply unscaled padding to Viewport inside WWT_INSET. (#9219)
Since pixel dimensions in SetPadding() are scaled by GUI size, padding for inset viewports was excessive.

Instead, automatically apply padding for WWT_INSET at widget level. This applies to all widgets inside a WWT_INSET, which in all instances is a NWID_VIEWPORT.
2021-05-08 21:01:16 +01:00
frosch 5bfcd742b8 Change: Relocate rename and location buttons in all windows. 2021-01-11 22:15:58 +01:00
TechGeekNZ a10013dd00 Codechange: Spell 'Viewport' consistently
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
2020-07-27 17:31:29 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
peter1138 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
rubidium e811fa1718 (svn r27030) -Fix: crash when having the vehicle list opened from a buoy or oil rig while the buoy/oil rig gets its final removal (i.e. the sign gets removed) 2014-10-21 19:16:47 +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
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 03736af2ae (svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default. 2012-11-11 16:10:43 +00:00
frosch 738fca37bf (svn r24576) -Fix [FS#5319] (r24260): Vehicle list at buoys did no longer work. (Juanjo) 2012-10-07 12:14:39 +00:00
rubidium b90aa80e77 (svn r23530) -Codechange: begin unify the naming of widgets and add comments to them, in this case the waypoint view widgets 2011-12-16 16:25:34 +00:00
truebrain 2aa774e831 (svn r23528) -Codechange: move widget enums to widgets/NNN_type.h 2011-12-15 22:22:55 +00:00
truebrain df0afdf0dc (svn r23525) -Codechange: make Window::flags4 WindowFlags instead of uint16, with only values known in WindowFlags (and move out 2 timers to their own variable)
-Codechange: rename Window::flags4 to Window::flags
-Codechange: move some non-inline functions from .hpp to .cpp
2011-12-15 19:54:23 +00:00
peter1138 3e1aaa1235 (svn r23321) -Fix (r23316): Extra viewports and waypoint detail opened up at wrong zoom level. 2011-11-24 18:55:56 +00:00
rubidium 5a620d1c65 (svn r22406) -Document: some more "random-ish" tidbits 2011-05-01 19:51:52 +00:00
rubidium 1a515e6344 (svn r22405) -Document: some more "random-ish" tidbits 2011-05-01 19:14:12 +00:00
terkhen 10caf391a1 (svn r22343) -Change: Remove pixel limiter for query strings. 2011-04-17 18:42:17 +00:00
frosch ec9540a12a (svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData(). 2011-03-13 21:31:29 +00:00
frosch facf400d27 (svn r22131) -Fix: Spectators had trouble closing buoy windows. (Terkhen) 2011-02-23 18:39:56 +00:00
rubidium 44d1c55347 (svn r21415) -Codechange: limit station/waypoint name by amount of characters, not bytes 2010-12-05 22:25:36 +00:00
alberth f5c6fd1a25 (svn r21331) -Codechange: Make drawing the widgets default behaviour in OnPaint(). 2010-11-26 15:22:18 +00:00
rubidium 1f5554c5c7 (svn r21035) -Fix [FS#4181] (r21020): crash when opening the buoy's viewport. Based on a patch by Krille. 2010-10-24 20:59:25 +00:00
alberth df7a32d364 (svn r21021) -Add [FS#4171]: Center industry gui and waypoint gui after resize (partly by Krille). 2010-10-23 20:51:48 +00:00
alberth 83094e5e58 (svn r21020) -Add: Use center of waypoint in waypoint gui, if available. 2010-10-23 20:39:21 +00:00
rubidium 7a88433228 (svn r20813) -Fix: make the waypoint viewport keep centered around the waypoint when resizing the window (Krille) 2010-09-16 16:14:30 +00:00
rubidium f5128695c5 (svn r20772) -Codechange: use packed VehicleListIdentifiers as window numbers 2010-09-08 21:37:13 +00:00
smatz 4cae19175e (svn r19990) -Fix: owner of the Waypoint View window wasn't properly set 2010-06-15 22:48:50 +00:00
smatz c4175b752a (svn r19957) -Codechange: remove VLW_WAYPOINT_LIST 2010-06-11 00:18:28 +00:00
smatz 8bf4a7d1ae (svn r19956) -Fix: close list of vehicles with given oil rig in orders when the oil rig is deleted
-Fix (r19952): close the list when it is not sticky
2010-06-10 23:52:09 +00:00