Commit Graph

363 Commits (56085be9bda8d5682c15544a058d988a6ae00b3b)

Author SHA1 Message Date
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
1 year ago
Peter Nelson 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.
1 year ago
Peter Nelson 941dbadf9e Codechange: Add and use GetScrolledItemFromWidget to get a list item.
This function returns an iterator, either to the selected item or the
container's end.

This makes handling the result more robust as indices are not used.
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
Rubidium 877349c13d Codechange: use std::string for text file name resolution 1 year ago
Peter Nelson 61407840c6 Codechange: Remove STR_BLACK_RAW_STRING. 1 year ago
Rubidium 3901ef9760 Codechange: use std::string for the GRF filenames 1 year ago
Rubidium a312a6c1b2 Codechange: make md5sumToString std::string compatible 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 a931378c52 Codechange: use std::string instead of stredup/free for ScanProgressWindow 1 year ago
Rubidium c829930440 Codechange: replace strnatcmp with C++ string capable version 1 year ago
Patric Stout 1ba4dcc924 Codechange: migrate all Window-related timers to the new framework
This means we also say goodbye to GUITimers.
1 year ago
Peter Nelson e5af5907ec Change: Make all dropdown lists extend width if necessary.
This removes the auto_width parameter from ShowDropDown(At).
1 year ago
Tyler Trahan f12498b633
Add: Show NewGRF name in NewGRF-created errors (#10457) 1 year ago
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 1 year ago
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 1 year ago
Rubidium 90f1768006 Codechange: add non-nullptr asserts in cases where it should never be nullptr
Though where similar calls are checked for nullptr as in those instances of
the use of that function it can actually return nullptr. In other words, write
down the assumption that the function never returns nullptr in an assert.
1 year ago
Peter Nelson ecb5393c55 Change: Standardize progress bar layout.
Progress bars are drawn differently depending on when it was added, with
different layouts and sizes.

This change adds a standard padding size to use, and makes all progress
bars visually similar, with scaled padding.
2 years ago
Peter Nelson 920e588334 Change: Use standard dimensions instead of custom widths. 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 dd9f6bc803 Change: Use RectPadding Horizontal()/Vertical() helpers. 2 years ago
Peter Nelson 04cbe57d2a Change: Use RectPadding for widget padding/uz_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
Peter Nelson eb4ba1991b Change: Use CenterBounds function in more places.
CenterBounds may have a 1 pixel difference so the result is not exactly
the same.
2 years ago
rubidium42 e3717ae903 Codechange: [ContentInfo] Use std::string instead of string buffers 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 6bca9e090d Codechange: add SetDParamStr that accepts std::string& 3 years ago
Peter Nelson 4791ff2862 Fix: Recalculate padding and minimum sizes when GUI or Font zoom is changed. 3 years ago
Chris a934dfe0be
Fix: [NewGRF] Errors with severity ERROR also display a pop-up window (#9119) 3 years ago
Rubidium bf4fe19a66 Codechange: merge duplicated logic to scroll in lists by key into a single function 3 years ago
Didac Perez Parera 47c0403320
Change: do not disable NewGRF window apply button if dev tools are enabled (#8975)
enabled
3 years ago
Didac Perez Parera 43c465e8f4
Change: Disable NewGRF window apply button if no change was made (#8934) 3 years ago
Patric Stout 14b61bfa6f Fix #8833: don't reload NewGRFs when we are shutting down
Otherwise that might cause calls to the video-driver, which are
already shut down by now. This causes, depending on the video-driver
crashes or weird effects.
3 years ago
Patric Stout 970fedd78c Add: make modal windows update more smooth
Basically, modal windows had their own thread-locking for what
drawing was possible. This is a bit nonsense now we have a
game-thread. And it makes much more sense to do things like
NewGRFScan and GenerateWorld in the game-thread, and not in a
thread next to the game-thread.

This commit changes that: it removes the threads for NewGRFScan
and GenerateWorld, and just runs the code in the game-thread.
On regular intervals it allows the draw-thread to do a tick,
which gives a much smoother look and feel.

It does slow down NewGRFScan and GenerateWorld ever so slightly
as it spends more time on drawing. But the slowdown is not
measureable on my machines (with 700+ NewGRFs / 4kx4k map and
a Debug build).

Running without a game-thread means NewGRFScan and GenerateWorld
are now blocking.
3 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 3 years ago
Michael Lutz a49fdb7ebb Codechange: Store base set related texts in std::strings. 4 years ago
Michael Lutz 9c2e47d03c Codechange: Use std::string for storing GRF error messages. 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
glx 2db88953e7 Codechange: use std::sort() in GUIList 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Michael Lutz e804173595 Codechange: If something is a vector of strings, use a vector of strings instead of an AutoFreeSmallVector. 5 years ago
Michael Lutz c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
Henry Wilson 2bc2de9034 Codechange: Replaced SmallVector::Find() with std::find() 5 years ago
Henry Wilson a0f36a50e6 Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back() 5 years ago
Henry Wilson a690936ed7 Codechange: Replace SmallVector::Length() with std::vector::size() 5 years ago
Henry Wilson 9cba6f7193 Codechange: Replaced SmallVector::Compact() with std::vector::shrink_to_fit() 5 years ago