Commit Graph

1113 Commits (302ba934716b1de58138fb0def791ef60012dff0)

Author SHA1 Message Date
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 0ca4b4e146 Change: Allow opening multiple script debug windows by holding Ctrl. 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
Rubidium 07860e67e2 Codechange: use fmt::format_to to format the help message 1 year ago
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
Rubidium 62fda0f505 Codechange: remove manual allocation/free for SQ_instance 1 year ago
Rubidium d9e93edc8b Codechange: replace 'const char *' script API parameters with std::string 1 year ago
Rubidium ab51175db2 Codechange: use std::string for script config 1 year ago
Rubidium 552d2f71a2 Codechange: use std::string for script library category 1 year ago
Rubidium 9f2fc860ad Codechange: use std::optional<std::string> for changing the script over char * 1 year ago
Rubidium 0fd9eb0faa Codechange: use std::string for script info/library finding 1 year ago
Rubidium 9b0123ab66 Codechange: use std::string for script API versions 1 year ago
Rubidium 12085d088c Cleanup: remove obsolete string_compare_type 1 year ago
Rubidium bc389a86c9 Codechange: use std::string as std::map key, instead of stredup string 1 year ago
Rubidium 72082aa7d3 Codechange: use std::string for getting a script's name 1 year ago
Rubidium 877349c13d Codechange: use std::string for text file name resolution 1 year ago
Rubidium 86786a7af6 Codechange: introduce StrEqualsIgnoreCase/StrCompareIgnoreCase to replace strcasecmp 1 year ago
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
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
dP c73b88ddca
Fix: Don't send unused tile field over the network (#10507) 2 years 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
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 2 years ago
SamuXarick df89c34e03
Fix 7e1e275: Measure AI Collect Garbage performance (#9924) 2 years ago
Andy 3b0b572ebf
Change: Log AI/GS Squirrel crashes in white text for readability (#10375) 2 years ago
Rubidium 921c6591f9 Codechange: do not use interactive random anymore for script configuration 2 years ago
Michael Lutz 150f05dc15
Change: Heading for 14 now. (#10302) 2 years ago
Loïc Guilloux fe30f66570
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745) 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
Loïc Guilloux 2848483810
Fix #10206: Disable scripts in intro game (#10241) 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