Commit Graph

418 Commits

Author SHA1 Message Date
Anthony Lazar 945561ada8 Codechange: Added UI, simplified functionality 2024-04-02 20:08:41 -04:00
Anthony Lazar fb44f5a074 Fix: Bug where highlight would stay if you click multiple times on the open infrastructure button. Show owned road on level crossings 2024-02-24 00:43:59 -05:00
Anthony Lazar 804557721c Codechange: Keep track of all open infrastructure windows in a vector highlight the infrastructure of the most recently opened company. Changed code style base on comments. 2024-02-23 23:55:34 -05:00
Anthony Lazar 452f25a5dd Add: When opening the company infrastructure window highlight in white all pieces of company owned infrastructure in the viewport 2024-02-23 01:32:04 -05:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Patric Stout 05b253b33b
Fix ea8c1d85: improve smoothness of smooth-scrolling for 60+Hz screens (#11884) 2024-01-28 09:56:21 +00:00
Patric Stout ea8c1d8597 Change: make for smooth-scrolling based on actual time
This means if rendering takes a bit longer, scrolling goes a bit
quicker, making travel time always about the same time for the
same distance.
2024-01-25 10:29:48 +01:00
Patric Stout 1985e7415b
Fix: smooth-scrolling large distances didn't got smoothly in one direction (#11861) 2024-01-21 20:52:44 +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 6c5aeae01b
Fix #11577: Extra viewport opened in wrong location. (#11578)
ExtraViewportWindow calls IninitializeViewport() with focus as 0, which is ambiguous as focus should be either a TileIndex or a VehicleID.

Instead, pass the tile and let InitializeViewport() handle setting all the coordinates.
2023-12-13 02:19:16 +00:00
rubidium42 cb8612ba79 Remove: ZOOM_LVL_COUNT
This is the only enumeration with a COUNT and END. The logic of the COUNT
implied that BEGIN could be non-zero, but all but two uses of zoom level
assume that BEGIN is zero, making the separate count only confusing.
2023-11-29 21:12:28 -04:00
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(...)`.
2023-11-21 19:04:24 +00:00
Rubidium c6411168d8 Cleanup: missing spaces before continuation * in some comments 2023-11-01 22:56:11 +01:00
Rubidium 37f84b7372 Codechange: replace x.size() != 0 with !x.empty() 2023-10-20 23:05:43 +02:00
Patric Stout 0238a2b567
Codechange: use std::variant instead of using bitflags in the value (#11191) 2023-08-12 16:05:00 +00:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Richard Wheeler 3b2934c479
Change: Make terraforming point selection sprite visible at >2x zoom out (#11017) 2023-06-27 10:47:42 -04:00
Rubidium 321f01602a Codechange: reduce passing around parameters, but formatting strings earlier 2023-06-23 06:48:13 +02:00
Rubidium f48baa7d00 Codechange: move sign invisibility check out of loop 2023-06-23 06:48:13 +02:00
Rubidium 836541b41c Codechange: use SetDParam and CopyOutDParam for tooltips 2023-06-17 10:01:19 +02:00
Rubidium ac0c932ce7 Codechange: use SetDParam to set measurement tooltip parameters 2023-06-17 10:01:19 +02:00
Jonathan G Rennison d7bf6b2c07 Feature: Highlight waypoint tiles when adjacent or distant joining 2023-06-04 16:54:48 +01:00
Jonathan G Rennison 84b53213af Codechange: Refactor viewport catchment overlay change handling 2023-06-04 16:54:48 +01:00
Rubidium 63d9bb93b8 Codechange: migrate from C-style GetString to C++-style GetString 2023-05-21 21:17:12 +02:00
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 2023-05-17 10:14:41 +01:00
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
PeterN c1077212d7
Codechange: Use a shared_ptr for viewport overlay. (#10586) 2023-03-31 16:06:36 +01:00
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
Rubidium f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 2023-01-28 20:33:02 +01:00
Rubidium 04d10b3d2d Codechange: instead of global pointer to stack variable, just put variable in that global
Removes one indirection and a dangling pointer to a stack location
2023-01-28 17:23:30 +01:00
Rubidium 71b46db8d0 Cleanup: remove commented out code 2023-01-26 23:47:55 +01:00
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
PeterN c8cc61d889
Fix #10150: Force FS_SMALL for small viewport signs. (#10283)
* Fix #10150: Force FS_SMALL for small viewport signs.

This is a workaround for string widths being different with mixed
font-sizes.

* Fix: Flag small sign shadow as small text.

(This method of drawing shadows is hilarious and needs replacing, but
this is a quick fix.)
2022-12-25 13:29:38 +00:00
Peter Nelson 138198e971 Change: Separate ground sprite from foundation sprite offsets. 2022-12-23 15:43:11 +00:00
Peter Nelson 002fe67bef Add: Optionally disable child sprites drawing relative to parent sprites offsets. 2022-12-23 15:43:11 +00:00
PeterN f6e7e44169
Fix #10151: Use smaller padding for viewport signs. (#10272)
Before variable-scaling, the padding was always 1x1 pixel. This was
changed to be scaled, except using the wrong dimension of 2x1 pixels
instead of 1x1 pixel.
2022-12-21 22:21:50 +00:00
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Tyler Trahan fbbc80f79e Fix #9020: Update station coverage highlight when adding/removing tiles 2022-03-10 20:54:45 +01:00
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Patric Stout 8ab267496b
Codechange: reference a string by its name, not with "another + 1" (#9517)
It is wrong anyway, as "TINY" normally is at -1. Just weird code.
2021-08-28 17:08:01 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42 b791ffc6de Fix: do not hide parameter by local variable with the same name 2021-05-27 18:30:56 +02:00
frosch f96f113951 Codechange: use IterateFromBack/Front only if the order is important.
Use Iterate if the order does not matter.
2021-05-12 23:22:41 +02:00
frosch 22567a1f43 Codechange: use iterators instead of 'subranges' when iterating from a specific window.
Using iterators makes it easier to include or exclude the start window in the iteration.
2021-05-12 23:22:41 +02:00
glx22 14e92bd8e2 Codechange: Replace window related FOR_ALL with range-based for loops 2021-04-29 21:08:24 +02:00
Jonathan G Rennison 3ede756d23 Fix: Viewport drag tooltips not being removed when dragging over other windows 2021-04-08 19:34:45 +02:00