Commit Graph
154 Commits
Author SHA1 Message Date
froschandfrosch b5885295f0 Codechange: Use parameters, which should be used. 2023-09-19 22:49:59 +02:00
froschandfrosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Peter NelsonandPeterN 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
Rubidiumandrubidium42 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
PeterNandGitHub 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.
2023-06-05 18:12:30 +01:00
PeterNandGitHub 8ea9c1a133 Fix #10880: Crash in object window due to incorrect parameter order. (#10881) 2023-05-26 21:29:52 +00:00
PeterNandGitHub 07473bfd2e Fix: Don't use a loop to test if classid is valid. (#10818)
Additionally the Object class test was broken.
2023-05-13 21:27:32 +00:00
Peter NelsonandPeterN 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.
2023-05-12 21:45:32 +01:00
Peter NelsonandPeterN d2034d9c38 Codechange: Scrollbar methods now accept size_t.
This clears up a lot of casts from size_t to int.
2023-05-07 20:25:44 +01:00
Peter NelsonandPeterN 0880616851 Codechange: Remove various STRING strings. 2023-05-05 07:07:54 +01:00
Tyler TrahanandGitHub ba3de0383a Codechange: Pass more std::string to StringFilter::AddLine() (#10743) 2023-04-30 10:23:05 +02:00
Peter NelsonandPeterN 06b78a7299 Fix: Don't double-pad existing size when adding widget padding.
UpdateWidgetSize's size parameter already includes padding.
2023-04-12 18:43:15 +01:00
Peter NelsonandPeterN 82c70ed3b8 Change: Expose ObjectSpec vector to simplify iteration. 2023-04-02 22:42:38 +01:00
Peter NelsonandPeterN 1f46f080f0 Codechange: Store objectspecs in std::vector instead of flat array. 2023-04-02 22:42:38 +01:00
Tyler Trahan 066ae6f3fb Codechange: Simplify some CodeQL-flagged trivial switches 2023-03-25 18:03:16 -04:00
Rubidiumandrubidium42 f001e84e5e Codechange: use RAII to automatically restore _cur_dpi after use 2023-01-28 20:33:02 +01:00
Rubidiumandrubidium42 fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
PeterNandGitHub 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.
2023-01-11 18:26:38 +00:00
PeterNandGitHub 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.
2022-11-28 00:27:57 +00:00
Peter NelsonandPeterN 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.
2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 890b2666d3 Change: Use scaled WidgetDimensions. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN b6ed595176 Codechange: Prefer suggested widget padding. 2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN 6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Peter NelsonandPeterN f5f035a22b Codechange: Make use of Rect Width/Height helpers. 2022-11-12 18:28:39 +00:00
Tyler TrahanandMichael Lutz 3d45bc4abe Feature: Build objects by area 2022-10-16 18:28:08 +02:00
AndyandGitHub 039f90d05f Feature: add sticky pin to Object Selection UI panel (#10019) 2022-09-11 22:15:02 +02:00
AndyandGitHub a06d323f03 Feature: add shade widget to Object Selection UI panel (#10020) 2022-09-11 21:22:06 +02:00
Michael Lutz c521b965bd Codechange: Don't use a global for the terrforming error tile. 2021-12-16 22:28:32 +01:00
Michael Lutz 58cff7b081 Codechange: Un-bitstuff the remaining on-map 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 123c7f99c3 Codechange: Move command callback declarations to the cmd header files. 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
Tyler TrahanandGitHub 66620b497b Fix #8603: Don't give focus to text filter when opening Object GUI (#9547) 2021-09-09 18:30:03 +02:00
Peter NelsonandPeterN 7385e780ac Cleanup: nested_array should not be accessed directly.
Replace accesses with GetWidget() as documented.
2021-06-14 17:49:01 +01:00
Didac Perez PareraandGitHub e760c9fbec Fix: adjust object and rail station selection window padding to be consistent (#8929)
consistent
2021-04-02 10:15:26 +02:00
stormconeandMichael Lutz bde5396d11 Add: Hotkey to focus the build object class name filter editbox. 2021-04-02 10:12:47 +02:00
Patric StoutandGitHub fece1c57ca Codechange: Suppress warnings when asserts are disabled (#8917) 2021-04-01 11:16:19 +02:00
Didac Perez PareraandGitHub 3878c4781e Fix #8817: keep NewGRF order for object class sorting (#8818) 2021-03-08 17:00:43 +01:00
SamuXarickandCharles Pigott cb95b1d2e7 Codechange: Apply coding style 2021-02-20 17:59:04 +00:00
Didac Perez PareraandGitHub 96990b2ea7 Feature: Object class selection string filtering (#8603) 2021-02-19 10:26:54 +01:00
Charles PigottandGitHub 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Henry WilsonandMichael Lutz 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
peter1138andMichael Lutz 317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
Charles Pigottandfrosch f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
frosch fbd2786329 (svn r27438) -Fix (r27346) [FS#6387]: The build object hotkey no longer checked whether there were any objects defined. 2015-11-07 15:07:18 +00:00
alberth 4f49d636c1 (svn r27346) -Feature: Make the object placement gui an independent window. 2015-07-28 18:20:54 +00:00
alberth a62468bed6 (svn r27345) -Fix-ish: Hide selected view if no object selected. 2015-07-28 18:18:59 +00:00
frosch a8080b6256 (svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad(). 2015-02-01 20:54:24 +00:00