Commit Graph

282 Commits (c0b8e584047d5fd6e83a95f0af16c081ba03be9f)

Author SHA1 Message Date
Patric Stout fe035c306e
Codechange: prevent out-of-bound read (even if the result is never used) (#11853) 8 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.
8 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.
9 months ago
Peter Nelson f60c14a682 Add: Website button for AI settings window. 10 months ago
Peter Nelson 9a92e02fa7
Change: Add tooltips for text file buttons, and shorten Website / Readme buttons. (#11534) 10 months ago
Peter Nelson 0b1429ce14
Fix: AI window did not update button disabled state when changing values. (#11527) 10 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(...)`.
10 months ago
Peter Nelson cdb4e98a15
Change: Use sparse padding for AI/GS settings windows. (#11466) 10 months ago
Peter Nelson 18fb8e153f Codechange: Add __FILE__/__LINE__ of WindowDesc to WindowDesc.
This is to allow unit-tests to produce more useful output.
11 months ago
Peter Nelson 873f93cab1
Fix: AI config window should not have an ini_key. (#11423)
This was missed by the workflow script that enforces this constraint.
11 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 11 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.
11 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 1 year 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.
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
Rubidium 877349c13d Codechange: use std::string for text file name resolution 1 year ago
Patric Stout ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
1 year ago
Loïc Guilloux e4c511d403
Fix #10578: Allow to select any version of AI/GS from GUI (#10604) 1 year ago
glx22 b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2 years ago
glx22 78e3c93a25 Fix: caption for GS settings window opened from debug window 2 years ago
glx22 cef9931e53 Cleanup: GS don't have "start_date" 2 years ago
Andy 3b0b572ebf
Change: Log AI/GS Squirrel crashes in white text for readability (#10375) 2 years ago
Jonathan G Rennison 14c1266bbc Fix: Wrong type cast for selected AI/GS script info in AIListWindow
This resulted in technically undefined behaviour when listing GSs
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 3ff05321dc Change: Use standard padding for AI Debug window. 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
Artin Alavi 5d6cdf4385
Feature: Allow AI/GS to be fully modified in scenario editor (#10152) 2 years ago
Artin Alavi cbac243216
Feature: [UI] Split AI/Game Script configuration windows and add them to world gen window (#10058) 2 years ago
Didac Perez Parera 019dcb7b7b
Change: Let AI developers edit non-editable AI/Game Script Parameters (#8895) 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 edbf99ed17 Change: Use standard sizing for AI competitor limit buttons. 2 years ago
Michael Lutz 13528bfcd0 Codechange: Un-bitstuff all remaining commands. 3 years ago
Michael Lutz 4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 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
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
Peter Nelson 2a0365b3d9 Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget()
Line height defaults to the resize height of the relevant widget, which is
set in all cases. Therefore it is not necessary to specify this value every time.

Additionally fixes scrolled padding for the framerate window.
3 years ago
PeterN 195cf31cb9
Fix: Inconsistent button sizing on AI/GS setting window depending on scale settings. (#9044) 3 years ago
Tyler Trahan de891238d6
Change: Recolour graph windows to brown (#8700) 4 years ago
glx22 07385c3662 Fix: Use the same safety checks as 'stop_ai' for 'reload_ai' 4 years ago
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 4 years ago
SamuXarick dc5b8020cc
Fix #6452: Reset only editable and visible settings from GUI (#7890)
Also enables the Reset button while in-game for AI configs.
4 years ago
Patric Stout 8fa2a67f6b Fix f66baa44: for-loop is no longer increasing "i"
During conversion it was overlooked that the for-loop used to do
this. Oops.
4 years ago
Patric Stout e6e91a345c
Fix f66baa44: index was off by one (#8433)
i++ in the 3rd part of a for() is post, not pre. Oops.
4 years ago
Patric Stout f66baa444f
Codechange: use C++11 constructs for for-each loops (#8432) 4 years ago
Quipyowert2 4552b17691 Codechange: Avoid copying function parameters by using const references 5 years ago
Samu 3089c625e4 Fix #7088: close AI/GS textfile window when their data are invalid 5 years ago
glx 3a14cea068 Codechange: Replace FOR_ALL_COMPANIES with range-based for loops 5 years ago