Skip to content

Implement #13384: Expose all TileElement data to plugin API#13536

Merged
Gymnasiast merged 1 commit into
OpenRCT2:developfrom
Sadret:develop
Jan 3, 2021
Merged

Implement #13384: Expose all TileElement data to plugin API#13536
Gymnasiast merged 1 commit into
OpenRCT2:developfrom
Sadret:develop

Conversation

@Sadret

@Sadret Sadret commented Dec 6, 2020

Copy link
Copy Markdown
Contributor

Adds the following fields:

TileElement.isGhost
TileElement.baseZ (= baseHeight * 8)
TileElement.clearanceZ (= clearanceHeight * 8)
Footpath.edges
Footpath.corners
Track.mazeEntry
Track.colourScheme
Track.seatRotation
Track.brakeBoosterSpeed ( = stored value * 2)
Track.isInverted
Track.hasCableLift
Wall.slope
Wall.primaryColour
Wall.secondaryColour
Wall.tertiaryColour
Wall.bannerIndex
LargeScenery.bannerIndex
LargeScenery.sequence
Banner.bannerIndex
Banner.direction

Removes the following fields:

Footpath.edgesAndCorners (replaced by Footpath.edges and Footpath.corners)
Footpath.railings (unused)
Footpath.direction (unused)

Changes to openrct2.d.ts

  • adds/removes above fields
  • removes FootpathElement->footpathType (unused / mistake?)
  • adds nullable types where needed
  • removes type TileElement (wrongly used and superfluous / mistake?)

Other changes:

  • API returns null values for all fields that do not make sense for that element, e.g. corners for Walls.
  • Banner.position is merged into TileElement.direction, as they have the same semantic meaning. (Note that above this change only affect the plugin API and nothing else.)
  • Increased API version.

Comment thread src/openrct2/scripting/ScTile.hpp Outdated
Comment thread src/openrct2/scripting/ScTile.hpp

@Gymnasiast Gymnasiast left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would like either @IntelOrca or @duncanspumpkin to review it as well.

Comment thread src/openrct2/scripting/ScTile.hpp Outdated
Comment thread src/openrct2/scripting/ScTile.hpp
Comment thread distribution/openrct2.d.ts Outdated
Comment thread distribution/openrct2.d.ts Outdated
@Gymnasiast Gymnasiast changed the title Implement #13384: Expose all TileElement data to plugin API. Implement #13384: Expose all TileElement data to plugin API Dec 29, 2020

@duncanspumpkin duncanspumpkin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to increment the api version

@Sadret

Sadret commented Jan 3, 2021

Copy link
Copy Markdown
Contributor Author

Don't forget to increment the api version

I did, twice. Now a third time, I guess.

@Sadret

Sadret commented Jan 3, 2021

Copy link
Copy Markdown
Contributor Author

Changed
tile_element_get_banner_index(_element)
to
_element->GetBannerIndex();
after the latest rebase.

@duncanspumpkin

Copy link
Copy Markdown
Contributor

@Sadret for future what I do is wait until all of the reviews are in and no further changes are being asked and then bump the network/plugin version. Means you don't have to do it as many times. Doesn't always work out like that though :(.

@Gymnasiast Gymnasiast merged commit d22c2ed into OpenRCT2:develop Jan 3, 2021
@Gymnasiast Gymnasiast added this to the v0.3.3 milestone Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants