Change: rearrange definitions of tree info to remove hardcoded values - #14
Open
PeterN wants to merge 48 commits into
Open
Change: rearrange definitions of tree info to remove hardcoded values#14PeterN wants to merge 48 commits into
PeterN wants to merge 48 commits into
Conversation
| @@ -1674,6 +1678,12 @@ | |||
| child_wid->current_y = ComputeMaxSize(child_wid->smallest_y, given_height - child_wid->padding.Vertical(), vert_step); | |||
| } | |||
|
|
|||
| for (const auto &child_wid : this->children) { | |||
| auto [pref_x, _] = child_wid->GetPreferredSizeForSize(child_wid->current_x, child_wid->current_y); | |||
| @@ -1848,6 +1858,12 @@ | |||
| child_wid->current_x = ComputeMaxSize(child_wid->smallest_x, given_width - child_wid->padding.Horizontal(), hor_step); | |||
| } | |||
|
|
|||
| for (const auto &child_wid : this->children) { | |||
| auto [_, pref_y] = child_wid->GetPreferredSizeForSize(child_wid->current_x, child_wid->current_y); | |||
Comment on lines
+110
to
+111
| // assert(industry != nullptr && IsValidTile(tile)); | ||
| // assert(industry->index == IndustryID::Invalid() || IsTileType(tile, TileType::Industry)); |
| uint16_t GetTreeTileCallback(CallbackID callback, uint32_t param1, uint32_t param2, TreeType treetype, TileIndex tile, std::span<int32_t> regs100 = {}); | ||
| PalSpriteID GetCustomTreeSprite(TileIndex tile, TreeType treetype); | ||
| bool GetNewTreeList(const TileInfo *ti, TreeType treetype, uint trees, std::array<TreeListEnt, 4> &te); | ||
| // bool DrawNewTrees(const TileInfo *ti, TreeType treetype); |
| @@ -104,7 +104,7 @@ | |||
| if (!ScriptEngine::IsBuildable(engine_id)) return -1; | |||
| if (!ScriptCargo::IsValidCargo(cargo)) return -1; | |||
|
|
|||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, INVALID_CLIENT_ID); | |||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, ClientID::Invalid); | |||
| @@ -104,7 +104,7 @@ | |||
| if (!ScriptEngine::IsBuildable(engine_id)) return -1; | |||
| if (!ScriptCargo::IsValidCargo(cargo)) return -1; | |||
|
|
|||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, INVALID_CLIENT_ID); | |||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, ClientID::Invalid); | |||
| @@ -104,7 +104,7 @@ | |||
| if (!ScriptEngine::IsBuildable(engine_id)) return -1; | |||
| if (!ScriptCargo::IsValidCargo(cargo)) return -1; | |||
|
|
|||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, INVALID_CLIENT_ID); | |||
| auto [res, veh_id, refit_capacity, refit_mail, cargo_capacities] = ::Command<Commands::BuildVehicle>::Do(DoCommandFlag::QueryCost, depot, engine_id, true, cargo, ClientID::Invalid); | |||
| if (treespec == nullptr) { | ||
| treespec = std::make_unique<TreeTileInfo>(GetOriginalTreeTileInfo()[subs_id]); | ||
|
|
||
| // treespec->enabled = true; |
Comment on lines
+60
to
+61
| // treespec->anim_production = INDUSTRYTILE_NOANIM; | ||
| // treespec->anim_next = INDUSTRYTILE_NOANIM; |
PeterN
force-pushed
the
working-tree
branch
3 times, most recently
from
July 28, 2026 22:58
3fd1f5b to
31caaad
Compare
chinese (traditional): 1 change by KogentaSan chinese (simplified): 154 changes by wensimehrp catalan: 1 change by J0anJosep
chinese (simplified): 98 changes by wensimehrp korean: 1 change by telk5093 afrikaans: 2 changes by chuckarrow
Allows getting a random value with less visible casting.
chinese (simplified): 160 changes by wensimehrp turkish: 6 changes by efemert124570
Bumps the actions group with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [microsoft/microsoft-store-apppublisher](https://github.com/microsoft/microsoft-store-apppublisher). Updates `github/codeql-action` from 4 to 4.37.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v4...v4.37.3) Updates `microsoft/microsoft-store-apppublisher` from 1.3 to 1.4 - [Release notes](https://github.com/microsoft/microsoft-store-apppublisher/releases) - [Commits](microsoft/microsoft-store-apppublisher@v1.3...v1.4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.37.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: microsoft/microsoft-store-apppublisher dependency-version: '1.4' dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
chinese (simplified): 1 change by wensimehrp
norwegian (bokmal): 31 changes by eriksorngard indonesian: 23 changes by q1t0
…in is driving backwards (OpenTTD#15485) Co-authored-by: Tyler Trahan <tyler@tylertrahan.com>
This adds a simplistic "Screensaver Mode" under the about menu which randomly picks between all vehicles on the map to follow, with a bias towards moving vehicles.
swedish: 1 change by joeax910
If not present the existing but bad quality linear conversion can still be used.
… regression Uses AIAccounting instead of AICompany::GetBankBalance.
indonesian: 72 changes by q1t0
norwegian (bokmal): 10 changes by eriksorngard indonesian: 275 changes by q1t0 maori (new zealand): 25 changes by Kyle-McDangersword esperanto: 20 changes by slashdevslashurandom polish: 1 change by pAter-exe
indonesian: 53 changes by q1t0
Makes it clear that these values do not change.
PeterN
force-pushed
the
working-tree
branch
2 times, most recently
from
August 11, 2026 07:25
77f7401 to
bccf688
Compare
swedish: 36 changes by Brickblock1
…ting (OpenTTD#15907) Remove code that doubles the shown capacity of dual-headed engines when sorting the purchase list, as the given capacity is already doubled
chinese (traditional): 4 changes by KogentaSan czech: 486 changes by adamek0202
…d save (OpenTTD#14481) Previous to this change, railways got automatically converted to electric railway if there was any electric locomotive, as electric railways could not be disabled until version 38
The industry tile limit was set based on the premise that action 3 ids might later be extended. They have since been extended. Limit is now the total number of industry tiles that can be used.
belarusian: 34 changes by GooseOb
Tree availability is now defined by climates, tropiczones and probabilities Tree placer GUI is modified to list currently active tree tile types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
Trees are full of magic. Magic sprite numbers, magic climate-based value and magic tropic-zone values.
De-magic them.
Description
Rearrange definitions of tree info to remove hardcoded values
Tree availability is now defined with climates and tropical zone.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.