1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Add Park.entranceFee to the plugin API (#12840)

This commit is contained in:
Nils Caspar
2020-09-03 13:07:19 -07:00
committed by GitHub
parent 22f29bf192
commit bc33ef3d43
4 changed files with 19 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
0.3.0+ (in development)
------------------------------------------------------------------------
- Feature: [#10807] Add 2x and 4x zoom levels (currently limited to OpenGL).
- Feature: [#12840] Add Park.entranceFee to the plugin API.
- Fix: [#400] Unable to place some saved tracks flush to the ground (original bug).
- Fix: [#7037] Unable to save tracks starting with a sloped turn or helix.
- Fix: [#12691] Ride graph tooltip incorrectly used count instead of number string.

View File

@@ -1344,6 +1344,12 @@ declare global {
rating: number;
bankLoan: number;
maxBankLoan: number;
/**
* The current entrance fee for the park.
*/
entranceFee: number;
name: string;
messages: ParkMessage[];

View File

@@ -280,11 +280,20 @@ namespace OpenRCT2::Scripting
context_broadcast_intent(&intent);
}
money16 entranceFee_get() const
{
return gParkEntranceFee;
}
void entranceFee_set(money16 value)
{
ThrowIfGameStateNotMutable();
gParkEntranceFee = value;
}
std::string name_get() const
{
return GetContext()->GetGameState()->GetPark().Name;
}
void name_set(std::string value)
{
ThrowIfGameStateNotMutable();
@@ -383,6 +392,7 @@ namespace OpenRCT2::Scripting
dukglue_register_property(ctx, &ScPark::rating_get, &ScPark::rating_set, "rating");
dukglue_register_property(ctx, &ScPark::bankLoan_get, &ScPark::bankLoan_set, "bankLoan");
dukglue_register_property(ctx, &ScPark::maxBankLoan_get, &ScPark::maxBankLoan_set, "maxBankLoan");
dukglue_register_property(ctx, &ScPark::entranceFee_get, &ScPark::entranceFee_set, "entranceFee");
dukglue_register_property(ctx, &ScPark::name_get, &ScPark::name_set, "name");
dukglue_register_property(ctx, &ScPark::messages_get, &ScPark::messages_set, "messages");
dukglue_register_method(ctx, &ScPark::postMessage, "postMessage");

View File

@@ -41,7 +41,7 @@
using namespace OpenRCT2;
using namespace OpenRCT2::Scripting;
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 2;
static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 3;
struct ExpressionStringifier final
{