Commit Graph

140 Commits (master)

Author SHA1 Message Date
Peter Nelson 5df5e3f45c Change: Use aspect ratio for file home button. 2 months ago
Peter Nelson de4e00c93f
Codechange: Pass by reference to UpdateWidgetSize. (#12457)
These parameters are always provided and not optional.
3 months ago
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 3 months ago
Rubidium 86cb184eb4 Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc 4 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.
4 months ago
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 5 months ago
Patric Stout a1487ce620
Add: list_[scenario|heightmap] and load_[scenario|height] console commands (#11867) 5 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.
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.
6 months ago
Peter Nelson feb94d233d
Codechange: Remove deferred nested_array initialization path. (#11640)
Having two ways (`FillNestedArray` and `SetupSmallestSize`) to initialize
`Window::nested_array` introduces confusion.

Instead, make `FillNestedArray` the canonical way, always call it, and remove
init_array from `SetupSmallestSize`.
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(...)`.
7 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
8 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.
9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
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.
10 months ago
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
11 months ago
Rubidium d4c2043294 Codechange: remove a number of unneeded c_str() calls 1 year ago
Rubidium 993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 1 year ago
Rubidium 324c43eeb2 Codechange: let FiosGetDiskFreeSpace only return disk space and split FiosGetCurrentPath off 1 year ago
PeterN 0cbbfd3eae
Codechange: Use display list instead of exclude list for file window. (#10845)
This simplifies retrieving the correct data for each row when data is
filtered. The background FileList is left intact so that savegame data
does not have to be rescanned when the filter is changed, and sorting
still remains the task of the background FileList.
1 year ago
Peter Nelson 91e140c722 Codechange: Use unique_ptr for fios company properties.
This is the data used to show company names in the saveload window.
1 year ago
Peter Nelson d2034d9c38 Codechange: Scrollbar methods now accept size_t.
This clears up a lot of casts from size_t to int.
1 year ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 1 year ago
Peter Nelson 00bf42353a Codechange: Place gamelog into its own class, along with internal data.
Data is now stored in vectors to avoid manual memory management and
passing lengths around.
1 year ago
Rubidium 1f3b7e2efd Codechange: use std::string instead of stredup for saveload error messages 1 year ago
Rubidium 3a822fcd01 Codechange: Make FiosItem's name and title std::string 1 year ago
Rubidium ee723f26ba Codechange: Make FileToSaveLoad's title std::string and simplify assignments 1 year ago
Rubidium f0a1ddd81c Codechange: let FiosBrowseTo return a bool 1 year ago
Peter Nelson 890b2666d3 Change: Use scaled WidgetDimensions. 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
Rubidium d5aafaee15 Codechange: rename and move some strings to make them more consistent with the rest of the strings 2 years ago
Peter Nelson e8edecf6b1 Change: Adjust layout of file windows to fix overlapping widgets. 2 years ago
PeterN 607ef09fa5
Fix: File list mouse hover behaviour. (#10040)
Hover highlight was visible even if the mouse pointer was in a different
window. Resolved by using OnMouseOver() instead of OnMouseLoop().
2 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining 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 549caca39c Codechange: Move command arguments to the back of the networked command function calls. 3 years ago
Rubidium 281a65b3e1 Cleanup: simplify some boolean expressions 3 years ago
glx22 5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 3 years ago
glx22 994bf19aef Fix f6d5c01: Delay deletion when closing windows 3 years ago
rubidium42 c73d64adf9 Codechange: move passwords in settings to std::string 3 years ago
rubidium42 6bca9e090d Codechange: add SetDParamStr that accepts std::string& 3 years ago
PeterN f018471b36
Cleanup: Remove old FiosList helper methods. (#9139) 3 years ago
Jonathan G Rennison 15fd63b1b8 Fix: Assert fail when using restart command after opening save/load GUI 4 years ago
Michael Lutz 65f65ad2ad Codechange: Convert some more FIO functions to take std::string. 4 years ago
Michael Lutz f3326d34e7 Codechange: Use std::string in FIO search path handling. 4 years ago
Michael Lutz dd138fc460 Codechange: Stringify config file paths. 4 years ago
Michael Lutz 63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 4 years ago
Niels Martin Hansen ac3bc30a30 Add: Highlight item under mouse in file browser 5 years ago
Niels Martin Hansen 838117b05e Doc: Missing member description 5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago