diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfce0d2512..b2fc8bec59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: check-code-formatting: name: Check code formatting runs-on: ubuntu-latest - container: openrct2/openrct2-build:18-format + container: openrct2/openrct2-build:20-format defaults: run: shell: sh diff --git a/scripts/check-code-formatting b/scripts/check-code-formatting index e49439cac4..8712fbb335 100755 --- a/scripts/check-code-formatting +++ b/scripts/check-code-formatting @@ -16,4 +16,4 @@ fi basedir="$($readlink_bin -f `dirname $0`/..)" cd $basedir -scripts/run-clang-format.py --clang-format-executable /usr/lib/llvm19/bin/clang-format -r src test data/shaders --exclude src/thirdparty +scripts/run-clang-format.py --clang-format-executable /usr/lib/llvm20/bin/clang-format -r src test data/shaders --exclude src/thirdparty diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 00993ddc87..f2f4656224 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -1271,8 +1271,9 @@ public: if (widget.left == -2) return; - GfxSetDirtyBlocks({ { w.windowPos + ScreenCoordsXY{ widget.left, widget.top } }, - { w.windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } }); + GfxSetDirtyBlocks( + { { w.windowPos + ScreenCoordsXY{ widget.left, widget.top } }, + { w.windowPos + ScreenCoordsXY{ widget.right + 1, widget.bottom + 1 } } }); } /** diff --git a/src/openrct2-ui/scripting/CustomMenu.cpp b/src/openrct2-ui/scripting/CustomMenu.cpp index 4e1588f3d8..b14dafd930 100644 --- a/src/openrct2-ui/scripting/CustomMenu.cpp +++ b/src/openrct2-ui/scripting/CustomMenu.cpp @@ -68,20 +68,21 @@ namespace OpenRCT2::Scripting "volcano_down", "walk_down", "paint_down", "entrance_down", "hand_open", "hand_closed", }; - static const DukEnumMap ToolFilterMap({ - { "terrain", ViewportInteractionItem::Terrain }, - { "entity", ViewportInteractionItem::Entity }, - { "ride", ViewportInteractionItem::Ride }, - { "water", ViewportInteractionItem::Water }, - { "scenery", ViewportInteractionItem::Scenery }, - { "footpath", ViewportInteractionItem::Footpath }, - { "footpath_item", ViewportInteractionItem::PathAddition }, - { "park_entrance", ViewportInteractionItem::ParkEntrance }, - { "wall", ViewportInteractionItem::Wall }, - { "large_scenery", ViewportInteractionItem::LargeScenery }, - { "label", ViewportInteractionItem::Label }, - { "banner", ViewportInteractionItem::Banner }, - }); + static const DukEnumMap ToolFilterMap( + { + { "terrain", ViewportInteractionItem::Terrain }, + { "entity", ViewportInteractionItem::Entity }, + { "ride", ViewportInteractionItem::Ride }, + { "water", ViewportInteractionItem::Water }, + { "scenery", ViewportInteractionItem::Scenery }, + { "footpath", ViewportInteractionItem::Footpath }, + { "footpath_item", ViewportInteractionItem::PathAddition }, + { "park_entrance", ViewportInteractionItem::ParkEntrance }, + { "wall", ViewportInteractionItem::Wall }, + { "large_scenery", ViewportInteractionItem::LargeScenery }, + { "label", ViewportInteractionItem::Label }, + { "banner", ViewportInteractionItem::Banner }, + }); template<> DukValue ToDuk(duk_context* ctx, const CursorID& cursorId) diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index ec061e35df..d9782420e6 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -47,18 +47,19 @@ namespace OpenRCT2::Scripting LoadSc, }; - static const DukEnumMap TitleScriptMap({ - { OpenRCT2::Title::LoadParkCommand::ScriptingName, TitleScript::Load }, - { OpenRCT2::Title::SetLocationCommand::ScriptingName, TitleScript::Location }, - { OpenRCT2::Title::RotateViewCommand::ScriptingName, TitleScript::Rotate }, - { OpenRCT2::Title::SetZoomCommand::ScriptingName, TitleScript::Zoom }, - { OpenRCT2::Title::FollowEntityCommand::ScriptingName, TitleScript::Follow }, - { OpenRCT2::Title::SetSpeedCommand::ScriptingName, TitleScript::Speed }, - { OpenRCT2::Title::WaitCommand::ScriptingName, TitleScript::Wait }, - { OpenRCT2::Title::LoadScenarioCommand::ScriptingName, TitleScript::LoadSc }, - { OpenRCT2::Title::RestartCommand::ScriptingName, TitleScript::Restart }, - { OpenRCT2::Title::EndCommand::ScriptingName, TitleScript::End }, - }); + static const DukEnumMap TitleScriptMap( + { + { OpenRCT2::Title::LoadParkCommand::ScriptingName, TitleScript::Load }, + { OpenRCT2::Title::SetLocationCommand::ScriptingName, TitleScript::Location }, + { OpenRCT2::Title::RotateViewCommand::ScriptingName, TitleScript::Rotate }, + { OpenRCT2::Title::SetZoomCommand::ScriptingName, TitleScript::Zoom }, + { OpenRCT2::Title::FollowEntityCommand::ScriptingName, TitleScript::Follow }, + { OpenRCT2::Title::SetSpeedCommand::ScriptingName, TitleScript::Speed }, + { OpenRCT2::Title::WaitCommand::ScriptingName, TitleScript::Wait }, + { OpenRCT2::Title::LoadScenarioCommand::ScriptingName, TitleScript::LoadSc }, + { OpenRCT2::Title::RestartCommand::ScriptingName, TitleScript::Restart }, + { OpenRCT2::Title::EndCommand::ScriptingName, TitleScript::End }, + }); template<> DukValue ToDuk(duk_context* ctx, const TitleScript& value) diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 49611c99c2..965e88f3a4 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -40,28 +40,30 @@ namespace OpenRCT2::Ui::Windows namespace OpenRCT2::Scripting { - static const DukEnumMap ScenarioCategoryMap({ - { "beginner", ScenarioCategory::beginner }, - { "challenging", ScenarioCategory::challenging }, - { "expert", ScenarioCategory::expert }, - { "real", ScenarioCategory::real }, - { "other", ScenarioCategory::other }, - { "dlc", ScenarioCategory::dlc }, - { "build_your_own", ScenarioCategory::buildYourOwn }, - { "competitions", ScenarioCategory::competitions }, - }); + static const DukEnumMap ScenarioCategoryMap( + { + { "beginner", ScenarioCategory::beginner }, + { "challenging", ScenarioCategory::challenging }, + { "expert", ScenarioCategory::expert }, + { "real", ScenarioCategory::real }, + { "other", ScenarioCategory::other }, + { "dlc", ScenarioCategory::dlc }, + { "build_your_own", ScenarioCategory::buildYourOwn }, + { "competitions", ScenarioCategory::competitions }, + }); - static const DukEnumMap ScenarioSourceMap({ - { "rct1", ScenarioSource::RCT1 }, - { "rct1_aa", ScenarioSource::RCT1_AA }, - { "rct1_ll", ScenarioSource::RCT1_LL }, - { "rct2", ScenarioSource::RCT2 }, - { "rct2_ww", ScenarioSource::RCT2_WW }, - { "rct2_tt", ScenarioSource::RCT2_TT }, - { "real", ScenarioSource::Real }, - { "extras", ScenarioSource::Extras }, - { "other", ScenarioSource::Other }, - }); + static const DukEnumMap ScenarioSourceMap( + { + { "rct1", ScenarioSource::RCT1 }, + { "rct1_aa", ScenarioSource::RCT1_AA }, + { "rct1_ll", ScenarioSource::RCT1_LL }, + { "rct2", ScenarioSource::RCT2 }, + { "rct2_ww", ScenarioSource::RCT2_WW }, + { "rct2_tt", ScenarioSource::RCT2_TT }, + { "real", ScenarioSource::Real }, + { "extras", ScenarioSource::Extras }, + { "other", ScenarioSource::Other }, + }); template<> inline DukValue ToDuk(duk_context* ctx, const ScenarioCategory& value) diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index 86bc48a860..f07a362745 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -175,10 +175,12 @@ namespace OpenRCT2::Ui::Windows int32_t sideDirection = (parkEntrancePosition.direction + 1) & 3; gMapSelectionTiles.clear(); gMapSelectionTiles.push_back({ parkEntrancePosition.x, parkEntrancePosition.y }); - gMapSelectionTiles.push_back({ parkEntrancePosition.x + CoordsDirectionDelta[sideDirection].x, - parkEntrancePosition.y + CoordsDirectionDelta[sideDirection].y }); - gMapSelectionTiles.push_back({ parkEntrancePosition.x - CoordsDirectionDelta[sideDirection].x, - parkEntrancePosition.y - CoordsDirectionDelta[sideDirection].y }); + gMapSelectionTiles.push_back( + { parkEntrancePosition.x + CoordsDirectionDelta[sideDirection].x, + parkEntrancePosition.y + CoordsDirectionDelta[sideDirection].y }); + gMapSelectionTiles.push_back( + { parkEntrancePosition.x - CoordsDirectionDelta[sideDirection].x, + parkEntrancePosition.y - CoordsDirectionDelta[sideDirection].y }); gMapSelectArrowPosition = parkEntrancePosition; gMapSelectArrowDirection = parkEntrancePosition.direction; diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 71076f4fd2..3d35de07d6 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1420,8 +1420,9 @@ namespace OpenRCT2::Ui::Windows int32_t direction = _footpathConstructDirection; gMapSelectionTiles.clear(); - gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, - gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); + gMapSelectionTiles.push_back( + { gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, + gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); MapInvalidateMapSelectionTiles(); } diff --git a/src/openrct2/core/Json.cpp b/src/openrct2/core/Json.cpp index 4912797bfb..d30ba56d13 100644 --- a/src/openrct2/core/Json.cpp +++ b/src/openrct2/core/Json.cpp @@ -37,8 +37,9 @@ namespace OpenRCT2::Json } catch (const json_t::exception& e) { - throw JsonException(String::stdFormat( - "Unable to parse JSON file (%.*s)\n\t%s", static_cast(path.length()), path.data(), e.what())); + throw JsonException( + String::stdFormat( + "Unable to parse JSON file (%.*s)\n\t%s", static_cast(path.length()), path.data(), e.what())); } return json; diff --git a/src/openrct2/entity/EntityTweener.cpp b/src/openrct2/entity/EntityTweener.cpp index 8b013ff94c..460a318393 100644 --- a/src/openrct2/entity/EntityTweener.cpp +++ b/src/openrct2/entity/EntityTweener.cpp @@ -153,9 +153,10 @@ namespace OpenRCT2 if (posA == posB) continue; - ent->MoveTo({ static_cast(std::round(posB.x * alpha + posA.x * inv)), - static_cast(std::round(posB.y * alpha + posA.y * inv)), - static_cast(std::round(posB.z * alpha + posA.z * inv)) }); + ent->MoveTo( + { static_cast(std::round(posB.x * alpha + posA.x * inv)), + static_cast(std::round(posB.y * alpha + posA.y * inv)), + static_cast(std::round(posB.z * alpha + posA.z * inv)) }); } } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index b9fc095952..24f6684802 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -741,8 +741,10 @@ static void ConsoleSetVariableAction(InteractiveConsole& console, std::string va auto action = TAction(std::forward(args)...); action.SetCallback([&console, var](const GameAction*, const GameActions::Result* res) { if (res->Error != GameActions::Status::Ok) - console.WriteLineError(String::stdFormat( - "set %s command failed: %s - %s.", var.c_str(), res->GetErrorTitle().c_str(), res->GetErrorMessage().c_str())); + console.WriteLineError( + String::stdFormat( + "set %s command failed: %s - %s.", var.c_str(), res->GetErrorTitle().c_str(), + res->GetErrorMessage().c_str())); else console.Execute(String::stdFormat("get %s", var.c_str())); console.EndAsyncExecution(); @@ -1618,8 +1620,9 @@ static void ConsoleCommandAddNewsItem([[maybe_unused]] InteractiveConsole& conso console.WriteLine(" 9 (News::ItemType::graph)"); console.WriteLine(" 10 (News::ItemType::campaign)"); console.WriteLine("message is the message to display, wrapped in quotes for multiple words"); - console.WriteLine("assoc is the associated id of ride/peep/tile/etc. If the selected ItemType doesn't need an assoc " - "(Null, Money, Award, Graph), you can leave this field blank"); + console.WriteLine( + "assoc is the associated id of ride/peep/tile/etc. If the selected ItemType doesn't need an assoc " + "(Null, Money, Award, Graph), you can leave this field blank"); return; } diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp index f72386acbb..063b0ffe1a 100644 --- a/src/openrct2/network/Socket.cpp +++ b/src/openrct2/network/Socket.cpp @@ -930,8 +930,9 @@ std::vector> GetBroadcastAddresses() memcpy(&address, &ifo.iiAddress.Address, sizeof(sockaddr)); (reinterpret_cast(&address))->sin_addr.s_addr = ifo.iiAddress.AddressIn.sin_addr.s_addr | ~ifo.iiNetmask.AddressIn.sin_addr.s_addr; - baddresses.push_back(std::make_unique( - reinterpret_cast(&address), static_cast(sizeof(sockaddr)))); + baddresses.push_back( + std::make_unique( + reinterpret_cast(&address), static_cast(sizeof(sockaddr)))); } #else int sock = socket(AF_INET, SOCK_DGRAM, 0); diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index f2e7a723cd..873e8ec0c8 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -102,9 +102,10 @@ std::vector> ImageTable::ParseImages( { for (auto i : range) { - result.push_back(std::make_unique( - static_cast(SPR_CSG_BEGIN + i), - [](uint32_t idx) -> const G1Element* { return GfxGetG1Element(idx); })); + result.push_back( + std::make_unique( + static_cast(SPR_CSG_BEGIN + i), + [](uint32_t idx) -> const G1Element* { return GfxGetG1Element(idx); })); } } else @@ -129,8 +130,9 @@ std::vector> ImageTable::ParseImages( auto range = ParseRange(rangeString); for (auto i : range) { - result.push_back(std::make_unique( - static_cast(i), [](uint32_t idx) -> const G1Element* { return GfxGetG1Element(idx); })); + result.push_back( + std::make_unique( + static_cast(i), [](uint32_t idx) -> const G1Element* { return GfxGetG1Element(idx); })); } } } @@ -313,8 +315,9 @@ std::vector> ImageTable::LoadObjectIm { if (i >= 0 && i < numImages) { - result.push_back(std::make_unique( - static_cast(i), [images](uint32_t idx) -> const G1Element* { return &images[idx]; })); + result.push_back( + std::make_unique( + static_cast(i), [images](uint32_t idx) -> const G1Element* { return &images[idx]; })); } else { diff --git a/src/openrct2/object/PeepAnimationsObject.cpp b/src/openrct2/object/PeepAnimationsObject.cpp index ac2f931a21..9be8a5380d 100644 --- a/src/openrct2/object/PeepAnimationsObject.cpp +++ b/src/openrct2/object/PeepAnimationsObject.cpp @@ -20,13 +20,14 @@ using namespace OpenRCT2; -static const EnumMap animationPeepTypeMap({ - { "guest", AnimationPeepType::Guest }, - { "handyman", AnimationPeepType::Handyman }, - { "mechanic", AnimationPeepType::Mechanic }, - { "security", AnimationPeepType::Security }, - { "entertainer", AnimationPeepType::Entertainer }, -}); +static const EnumMap animationPeepTypeMap( + { + { "guest", AnimationPeepType::Guest }, + { "handyman", AnimationPeepType::Handyman }, + { "mechanic", AnimationPeepType::Mechanic }, + { "security", AnimationPeepType::Security }, + { "entertainer", AnimationPeepType::Entertainer }, + }); void PeepAnimationsObject::Load() { diff --git a/src/openrct2/paint/track/thrill/GoKarts.cpp b/src/openrct2/paint/track/thrill/GoKarts.cpp index cec48b09ee..6a8e7cc3e2 100644 --- a/src/openrct2/paint/track/thrill/GoKarts.cpp +++ b/src/openrct2/paint/track/thrill/GoKarts.cpp @@ -1568,7 +1568,7 @@ static void PaintGoKartsStation( bool hasFence; ImageId imageId; - const uint32_t(*sprites)[2] = go_karts_track_pieces_starting_grid; + const uint32_t (*sprites)[2] = go_karts_track_pieces_starting_grid; if (trackElement.GetTrackType() == TrackElemType::EndStation) { diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 8e7bc7958f..bd9f21f485 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -41,8 +41,9 @@ namespace OpenRCT2::PathFinding static constexpr uint8_t kMaxJunctionsGuestLeavingParkLost = 8; // Maximum amount of junctions. - static constexpr uint8_t kMaxJunctions = std::max({ kMaxJunctionsStaff, kMaxJunctionsGuest, kMaxJunctionsGuestWithMap, - kMaxJunctionsGuestLeavingPark, kMaxJunctionsGuestLeavingParkLost }); + static constexpr uint8_t kMaxJunctions = std::max( + { kMaxJunctionsStaff, kMaxJunctionsGuest, kMaxJunctionsGuestWithMap, kMaxJunctionsGuestLeavingPark, + kMaxJunctionsGuestLeavingParkLost }); struct PathFindingState { diff --git a/src/openrct2/peep/PeepAnimations.cpp b/src/openrct2/peep/PeepAnimations.cpp index 392eba62cd..c528925ad7 100644 --- a/src/openrct2/peep/PeepAnimations.cpp +++ b/src/openrct2/peep/PeepAnimations.cpp @@ -23,75 +23,80 @@ namespace OpenRCT2 { - static const EnumMap availableGuestAnimations({ - { "walking", PeepAnimationType::Walking }, - { "checkTime", PeepAnimationType::CheckTime }, - { "watchRide", PeepAnimationType::WatchRide }, - { "eatFood", PeepAnimationType::EatFood }, - { "shakeHead", PeepAnimationType::ShakeHead }, - { "emptyPockets", PeepAnimationType::EmptyPockets }, - { "holdMat", PeepAnimationType::HoldMat }, - { "sittingIdle", PeepAnimationType::SittingIdle }, - { "sittingEatFood", PeepAnimationType::SittingEatFood }, - { "sittingLookAroundLeft", PeepAnimationType::SittingLookAroundLeft }, - { "sittingLookAroundRight", PeepAnimationType::SittingLookAroundRight }, - { "hanging", PeepAnimationType::Hanging }, - { "wow", PeepAnimationType::Wow }, - { "throwUp", PeepAnimationType::ThrowUp }, - { "jump", PeepAnimationType::Jump }, - { "drowning", PeepAnimationType::Drowning }, - { "joy", PeepAnimationType::Joy }, - { "readMap", PeepAnimationType::ReadMap }, - { "wave", PeepAnimationType::Wave }, - { "wave2", PeepAnimationType::Wave2 }, - { "takePhoto", PeepAnimationType::TakePhoto }, - { "clap", PeepAnimationType::Clap }, - { "disgust", PeepAnimationType::Disgust }, - { "drawPicture", PeepAnimationType::DrawPicture }, - { "beingWatched", PeepAnimationType::BeingWatched }, - { "withdrawMoney", PeepAnimationType::WithdrawMoney }, - }); + static const EnumMap availableGuestAnimations( + { + { "walking", PeepAnimationType::Walking }, + { "checkTime", PeepAnimationType::CheckTime }, + { "watchRide", PeepAnimationType::WatchRide }, + { "eatFood", PeepAnimationType::EatFood }, + { "shakeHead", PeepAnimationType::ShakeHead }, + { "emptyPockets", PeepAnimationType::EmptyPockets }, + { "holdMat", PeepAnimationType::HoldMat }, + { "sittingIdle", PeepAnimationType::SittingIdle }, + { "sittingEatFood", PeepAnimationType::SittingEatFood }, + { "sittingLookAroundLeft", PeepAnimationType::SittingLookAroundLeft }, + { "sittingLookAroundRight", PeepAnimationType::SittingLookAroundRight }, + { "hanging", PeepAnimationType::Hanging }, + { "wow", PeepAnimationType::Wow }, + { "throwUp", PeepAnimationType::ThrowUp }, + { "jump", PeepAnimationType::Jump }, + { "drowning", PeepAnimationType::Drowning }, + { "joy", PeepAnimationType::Joy }, + { "readMap", PeepAnimationType::ReadMap }, + { "wave", PeepAnimationType::Wave }, + { "wave2", PeepAnimationType::Wave2 }, + { "takePhoto", PeepAnimationType::TakePhoto }, + { "clap", PeepAnimationType::Clap }, + { "disgust", PeepAnimationType::Disgust }, + { "drawPicture", PeepAnimationType::DrawPicture }, + { "beingWatched", PeepAnimationType::BeingWatched }, + { "withdrawMoney", PeepAnimationType::WithdrawMoney }, + }); - static const EnumMap availableHandymanAnimations({ - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "staffMower", PeepAnimationType::StaffMower }, - { "staffSweep", PeepAnimationType::StaffSweep }, - { "drowning", PeepAnimationType::Drowning }, - { "staffWatering", PeepAnimationType::StaffWatering }, - { "staffEmptyBin", PeepAnimationType::StaffEmptyBin }, - }); + static const EnumMap availableHandymanAnimations( + { + { "walking", PeepAnimationType::Walking }, + { "watchRide", PeepAnimationType::WatchRide }, + { "hanging", PeepAnimationType::Hanging }, + { "staffMower", PeepAnimationType::StaffMower }, + { "staffSweep", PeepAnimationType::StaffSweep }, + { "drowning", PeepAnimationType::Drowning }, + { "staffWatering", PeepAnimationType::StaffWatering }, + { "staffEmptyBin", PeepAnimationType::StaffEmptyBin }, + }); - static const EnumMap availableMechanicAnimations({ - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, - { "staffAnswerCall", PeepAnimationType::StaffAnswerCall }, - { "staffAnswerCall2", PeepAnimationType::StaffAnswerCall2 }, - { "staffCheckBoard", PeepAnimationType::StaffCheckBoard }, - { "staffFix", PeepAnimationType::StaffFix }, - { "staffFix2", PeepAnimationType::StaffFix2 }, - { "staffFixGround", PeepAnimationType::StaffFixGround }, - { "staffFix3", PeepAnimationType::StaffFix3 }, - }); + static const EnumMap availableMechanicAnimations( + { + { "walking", PeepAnimationType::Walking }, + { "watchRide", PeepAnimationType::WatchRide }, + { "hanging", PeepAnimationType::Hanging }, + { "drowning", PeepAnimationType::Drowning }, + { "staffAnswerCall", PeepAnimationType::StaffAnswerCall }, + { "staffAnswerCall2", PeepAnimationType::StaffAnswerCall2 }, + { "staffCheckBoard", PeepAnimationType::StaffCheckBoard }, + { "staffFix", PeepAnimationType::StaffFix }, + { "staffFix2", PeepAnimationType::StaffFix2 }, + { "staffFixGround", PeepAnimationType::StaffFixGround }, + { "staffFix3", PeepAnimationType::StaffFix3 }, + }); - static const EnumMap availableSecurityAnimations({ - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, - }); + static const EnumMap availableSecurityAnimations( + { + { "walking", PeepAnimationType::Walking }, + { "watchRide", PeepAnimationType::WatchRide }, + { "hanging", PeepAnimationType::Hanging }, + { "drowning", PeepAnimationType::Drowning }, + }); - static const EnumMap availableEntertainerAnimations({ - { "walking", PeepAnimationType::Walking }, - { "watchRide", PeepAnimationType::WatchRide }, - { "hanging", PeepAnimationType::Hanging }, - { "drowning", PeepAnimationType::Drowning }, - { "joy", PeepAnimationType::Joy }, - { "wave2", PeepAnimationType::Wave2 }, - }); + static const EnumMap availableEntertainerAnimations( + { + { "walking", PeepAnimationType::Walking }, + { "watchRide", PeepAnimationType::WatchRide }, + { "hanging", PeepAnimationType::Hanging }, + { "drowning", PeepAnimationType::Drowning }, + { "joy", PeepAnimationType::Joy }, + { "wave2", PeepAnimationType::Wave2 }, + }); const EnumMap& getAnimationsByPeepType(AnimationPeepType peepType) { @@ -223,12 +228,13 @@ namespace OpenRCT2 if (scriptName.empty()) continue; - groups.push_back({ - .objectId = ObjectEntryIndex(i), - .group = group, - .legacyPosition = animObj->GetLegacyPosition(group), - .scriptName = scriptName, - }); + groups.push_back( + { + .objectId = ObjectEntryIndex(i), + .group = group, + .legacyPosition = animObj->GetLegacyPosition(group), + .scriptName = scriptName, + }); } } @@ -254,12 +260,13 @@ namespace OpenRCT2 out << ' '; out << baseName; - availableCostumes.push_back({ - .index = availCostumeIndexes[i], - .object = availCostumeObjects[i], - .rawName = baseName, - .friendlyName = out.str(), - }); + availableCostumes.push_back( + { + .index = availCostumeIndexes[i], + .object = availCostumeObjects[i], + .rawName = baseName, + .friendlyName = out.str(), + }); } std::sort(availableCostumes.begin(), availableCostumes.end(), [](const auto& a, const auto& b) { diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 29dcc98d88..ddb9b2c96a 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -71,8 +71,9 @@ static bool UploadMinidump(const std::map& files, in { wprintf(L"files[%s] = %s\n", file.first.c_str(), file.second.c_str()); } - std::wstring url(L"https://openrct2.sp.backtrace.io:6098/" - L"post?format=minidump&token=" BACKTRACE_TOKEN); + std::wstring url( + L"https://openrct2.sp.backtrace.io:6098/" + L"post?format=minidump&token=" BACKTRACE_TOKEN); std::map parameters; parameters[L"product_name"] = L"openrct2"; parameters[L"version"] = String::toWideChar(gVersionInfoFull); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index f8dc1b4e48..e5c596129c 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -410,14 +410,15 @@ namespace OpenRCT2::RCT1 void AddDefaultEntries() { // Add default scenery groups - _sceneryGroupEntries.AddRange({ - "rct2.scenery_group.scgtrees", - "rct2.scenery_group.scgshrub", - "rct2.scenery_group.scggardn", - "rct2.scenery_group.scgfence", - "rct2.scenery_group.scgwalls", - "rct2.scenery_group.scgpathx", - }); + _sceneryGroupEntries.AddRange( + { + "rct2.scenery_group.scgtrees", + "rct2.scenery_group.scgshrub", + "rct2.scenery_group.scggardn", + "rct2.scenery_group.scgfence", + "rct2.scenery_group.scgwalls", + "rct2.scenery_group.scgpathx", + }); // Add default footpaths _footpathSurfaceEntries.AddRange( @@ -428,8 +429,9 @@ namespace OpenRCT2::RCT1 "rct1ll.footpath_surface.tiles_red", "rct1.footpath_surface.queue_blue", "rct1aa.footpath_surface.queue_red", "rct1aa.footpath_surface.queue_yellow", "rct1aa.footpath_surface.queue_green" }); - _footpathRailingsEntries.AddRange({ "rct2.footpath_railings.wood", "rct1ll.footpath_railings.space", - "rct1ll.footpath_railings.bamboo", "rct2.footpath_railings.concrete" }); + _footpathRailingsEntries.AddRange( + { "rct2.footpath_railings.wood", "rct1ll.footpath_railings.space", "rct1ll.footpath_railings.bamboo", + "rct2.footpath_railings.concrete" }); // Add default surfaces _terrainSurfaceEntries.AddRange( @@ -441,12 +443,12 @@ namespace OpenRCT2::RCT1 "rct1ll.terrain_surface.roof_grey", "rct1ll.terrain_surface.rust", "rct1ll.terrain_surface.wood" }); // Add default edges - _terrainEdgeEntries.AddRange({ "rct2.terrain_edge.rock", "rct2.terrain_edge.wood_red", - "rct2.terrain_edge.wood_black", "rct2.terrain_edge.ice", "rct1.terrain_edge.brick", - "rct1.terrain_edge.iron", "rct1aa.terrain_edge.grey", "rct1aa.terrain_edge.yellow", - "rct1aa.terrain_edge.red", "rct1ll.terrain_edge.purple", "rct1ll.terrain_edge.green", - "rct1ll.terrain_edge.stone_brown", "rct1ll.terrain_edge.stone_grey", - "rct1ll.terrain_edge.skyscraper_a", "rct1ll.terrain_edge.skyscraper_b" }); + _terrainEdgeEntries.AddRange( + { "rct2.terrain_edge.rock", "rct2.terrain_edge.wood_red", "rct2.terrain_edge.wood_black", + "rct2.terrain_edge.ice", "rct1.terrain_edge.brick", "rct1.terrain_edge.iron", "rct1aa.terrain_edge.grey", + "rct1aa.terrain_edge.yellow", "rct1aa.terrain_edge.red", "rct1ll.terrain_edge.purple", + "rct1ll.terrain_edge.green", "rct1ll.terrain_edge.stone_brown", "rct1ll.terrain_edge.stone_grey", + "rct1ll.terrain_edge.skyscraper_a", "rct1ll.terrain_edge.skyscraper_b" }); } void AddAvailableEntriesFromResearchList() diff --git a/src/openrct2/scripting/HookEngine.cpp b/src/openrct2/scripting/HookEngine.cpp index 169ddc3292..0a3ad83c13 100644 --- a/src/openrct2/scripting/HookEngine.cpp +++ b/src/openrct2/scripting/HookEngine.cpp @@ -18,24 +18,25 @@ using namespace OpenRCT2::Scripting; -static const EnumMap HooksLookupTable({ - { "action.query", HookType::actionQuery }, - { "action.execute", HookType::actionExecute }, - { "interval.tick", HookType::intervalTick }, - { "interval.day", HookType::intervalDay }, - { "network.chat", HookType::networkChat }, - { "network.authenticate", HookType::networkAuthenticate }, - { "network.join", HookType::networkJoin }, - { "network.leave", HookType::networkLeave }, - { "ride.ratings.calculate", HookType::rideRatingsCalculate }, - { "action.location", HookType::actionLocation }, - { "guest.generation", HookType::guestGeneration }, - { "vehicle.crash", HookType::vehicleCrash }, - { "map.change", HookType::mapChange }, - { "map.changed", HookType::mapChanged }, - { "map.save", HookType::mapSave }, - { "park.guest.softcap.calculate", HookType::parkCalculateGuestCap }, -}); +static const EnumMap HooksLookupTable( + { + { "action.query", HookType::actionQuery }, + { "action.execute", HookType::actionExecute }, + { "interval.tick", HookType::intervalTick }, + { "interval.day", HookType::intervalDay }, + { "network.chat", HookType::networkChat }, + { "network.authenticate", HookType::networkAuthenticate }, + { "network.join", HookType::networkJoin }, + { "network.leave", HookType::networkLeave }, + { "ride.ratings.calculate", HookType::rideRatingsCalculate }, + { "action.location", HookType::actionLocation }, + { "guest.generation", HookType::guestGeneration }, + { "vehicle.crash", HookType::vehicleCrash }, + { "map.change", HookType::mapChange }, + { "map.changed", HookType::mapChanged }, + { "map.save", HookType::mapSave }, + { "park.guest.softcap.calculate", HookType::parkCalculateGuestCap }, + }); HookType OpenRCT2::Scripting::GetHookType(const std::string& name) { diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index fd49d36079..cfd1aeea15 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -21,133 +21,134 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap ThoughtTypeMap({ - { "cant_afford_ride", PeepThoughtType::CantAffordRide }, - { "spent_money", PeepThoughtType::SpentMoney }, - { "sick", PeepThoughtType::Sick }, - { "very_sick", PeepThoughtType::VerySick }, - { "more_thrilling", PeepThoughtType::MoreThrilling }, - { "intense", PeepThoughtType::Intense }, - { "havent_finished", PeepThoughtType::HaventFinished }, - { "sickening", PeepThoughtType::Sickening }, - { "bad_value", PeepThoughtType::BadValue }, - { "go_home", PeepThoughtType::GoHome }, - { "good_value", PeepThoughtType::GoodValue }, - { "already_got", PeepThoughtType::AlreadyGot }, - { "cant_afford_item", PeepThoughtType::CantAffordItem }, - { "not_hungry", PeepThoughtType::NotHungry }, - { "not_thirsty", PeepThoughtType::NotThirsty }, - { "drowning", PeepThoughtType::Drowning }, - { "lost", PeepThoughtType::Lost }, - { "was_great", PeepThoughtType::WasGreat }, - { "queuing_ages", PeepThoughtType::QueuingAges }, - { "tired", PeepThoughtType::Tired }, - { "hungry", PeepThoughtType::Hungry }, - { "thirsty", PeepThoughtType::Thirsty }, - { "toilet", PeepThoughtType::Toilet }, - { "cant_find", PeepThoughtType::CantFind }, - { "not_paying", PeepThoughtType::NotPaying }, - { "not_while_raining", PeepThoughtType::NotWhileRaining }, - { "bad_litter", PeepThoughtType::BadLitter }, - { "cant_find_exit", PeepThoughtType::CantFindExit }, - { "get_off", PeepThoughtType::GetOff }, - { "get_out", PeepThoughtType::GetOut }, - { "not_safe", PeepThoughtType::NotSafe }, - { "path_disgusting", PeepThoughtType::PathDisgusting }, - { "crowded", PeepThoughtType::Crowded }, - { "vandalism", PeepThoughtType::Vandalism }, - { "scenery", PeepThoughtType::Scenery }, - { "very_clean", PeepThoughtType::VeryClean }, - { "fountains", PeepThoughtType::Fountains }, - { "music", PeepThoughtType::Music }, - { "balloon", PeepThoughtType::Balloon }, - { "toy", PeepThoughtType::Toy }, - { "map", PeepThoughtType::Map }, - { "photo", PeepThoughtType::Photo }, - { "umbrella", PeepThoughtType::Umbrella }, - { "drink", PeepThoughtType::Drink }, - { "burger", PeepThoughtType::Burger }, - { "chips", PeepThoughtType::Chips }, - { "ice_cream", PeepThoughtType::IceCream }, - { "candyfloss", PeepThoughtType::Candyfloss }, - { "pizza", PeepThoughtType::Pizza }, - { "popcorn", PeepThoughtType::Popcorn }, - { "hot_dog", PeepThoughtType::HotDog }, - { "tentacle", PeepThoughtType::Tentacle }, - { "hat", PeepThoughtType::Hat }, - { "toffee_apple", PeepThoughtType::ToffeeApple }, - { "tshirt", PeepThoughtType::Tshirt }, - { "doughnut", PeepThoughtType::Doughnut }, - { "coffee", PeepThoughtType::Coffee }, - { "chicken", PeepThoughtType::Chicken }, - { "lemonade", PeepThoughtType::Lemonade }, - { "wow", PeepThoughtType::Wow }, - { "wow2", PeepThoughtType::Wow2 }, - { "watched", PeepThoughtType::Watched }, - { "balloon_much", PeepThoughtType::BalloonMuch }, - { "toy_much", PeepThoughtType::ToyMuch }, - { "map_much", PeepThoughtType::MapMuch }, - { "photo_much", PeepThoughtType::PhotoMuch }, - { "umbrella_much", PeepThoughtType::UmbrellaMuch }, - { "drink_much", PeepThoughtType::DrinkMuch }, - { "burger_much", PeepThoughtType::BurgerMuch }, - { "chips_much", PeepThoughtType::ChipsMuch }, - { "ice_cream_much", PeepThoughtType::IceCreamMuch }, - { "candyfloss_much", PeepThoughtType::CandyflossMuch }, - { "pizza_much", PeepThoughtType::PizzaMuch }, - { "popcorn_much", PeepThoughtType::PopcornMuch }, - { "hot_dog_much", PeepThoughtType::HotDogMuch }, - { "tentacle_much", PeepThoughtType::TentacleMuch }, - { "hat_much", PeepThoughtType::HatMuch }, - { "toffee_apple_much", PeepThoughtType::ToffeeAppleMuch }, - { "tshirt_much", PeepThoughtType::TshirtMuch }, - { "doughnut_much", PeepThoughtType::DoughnutMuch }, - { "coffee_much", PeepThoughtType::CoffeeMuch }, - { "chicken_much", PeepThoughtType::ChickenMuch }, - { "lemonade_much", PeepThoughtType::LemonadeMuch }, - { "photo2", PeepThoughtType::Photo2 }, - { "photo3", PeepThoughtType::Photo3 }, - { "photo4", PeepThoughtType::Photo4 }, - { "pretzel", PeepThoughtType::Pretzel }, - { "hot_chocolate", PeepThoughtType::HotChocolate }, - { "iced_tea", PeepThoughtType::IcedTea }, - { "funnel_cake", PeepThoughtType::FunnelCake }, - { "sunglasses", PeepThoughtType::Sunglasses }, - { "beef_noodles", PeepThoughtType::BeefNoodles }, - { "fried_rice_noodles", PeepThoughtType::FriedRiceNoodles }, - { "wonton_soup", PeepThoughtType::WontonSoup }, - { "meatball_soup", PeepThoughtType::MeatballSoup }, - { "fruit_juice", PeepThoughtType::FruitJuice }, - { "soybean_milk", PeepThoughtType::SoybeanMilk }, - { "sujongkwa", PeepThoughtType::Sujongkwa }, - { "sub_sandwich", PeepThoughtType::SubSandwich }, - { "cookie", PeepThoughtType::Cookie }, - { "roast_sausage", PeepThoughtType::RoastSausage }, - { "photo2_much", PeepThoughtType::Photo2Much }, - { "photo3_much", PeepThoughtType::Photo3Much }, - { "photo4_much", PeepThoughtType::Photo4Much }, - { "pretzel_much", PeepThoughtType::PretzelMuch }, - { "hot_chocolate_much", PeepThoughtType::HotChocolateMuch }, - { "iced_tea_much", PeepThoughtType::IcedTeaMuch }, - { "funnel_cake_much", PeepThoughtType::FunnelCakeMuch }, - { "sunglasses_much", PeepThoughtType::SunglassesMuch }, - { "beef_noodles_much", PeepThoughtType::BeefNoodlesMuch }, - { "fried_rice_noodles_much", PeepThoughtType::FriedRiceNoodlesMuch }, - { "wonton_soup_much", PeepThoughtType::WontonSoupMuch }, - { "meatball_soup_much", PeepThoughtType::MeatballSoupMuch }, - { "fruit_juice_much", PeepThoughtType::FruitJuiceMuch }, - { "soybean_milk_much", PeepThoughtType::SoybeanMilkMuch }, - { "sujongkwa_much", PeepThoughtType::SujongkwaMuch }, - { "sub_sandwich_much", PeepThoughtType::SubSandwichMuch }, - { "cookie_much", PeepThoughtType::CookieMuch }, - { "roast_sausage_much", PeepThoughtType::RoastSausageMuch }, - { "help", PeepThoughtType::Help }, - { "running_out", PeepThoughtType::RunningOut }, - { "new_ride", PeepThoughtType::NewRide }, - { "nice_ride_deprecated", PeepThoughtType::NiceRideDeprecated }, - { "excited_deprecated", PeepThoughtType::ExcitedDeprecated }, - { "here_we_are", PeepThoughtType::HereWeAre }, - }); + static const DukEnumMap ThoughtTypeMap( + { + { "cant_afford_ride", PeepThoughtType::CantAffordRide }, + { "spent_money", PeepThoughtType::SpentMoney }, + { "sick", PeepThoughtType::Sick }, + { "very_sick", PeepThoughtType::VerySick }, + { "more_thrilling", PeepThoughtType::MoreThrilling }, + { "intense", PeepThoughtType::Intense }, + { "havent_finished", PeepThoughtType::HaventFinished }, + { "sickening", PeepThoughtType::Sickening }, + { "bad_value", PeepThoughtType::BadValue }, + { "go_home", PeepThoughtType::GoHome }, + { "good_value", PeepThoughtType::GoodValue }, + { "already_got", PeepThoughtType::AlreadyGot }, + { "cant_afford_item", PeepThoughtType::CantAffordItem }, + { "not_hungry", PeepThoughtType::NotHungry }, + { "not_thirsty", PeepThoughtType::NotThirsty }, + { "drowning", PeepThoughtType::Drowning }, + { "lost", PeepThoughtType::Lost }, + { "was_great", PeepThoughtType::WasGreat }, + { "queuing_ages", PeepThoughtType::QueuingAges }, + { "tired", PeepThoughtType::Tired }, + { "hungry", PeepThoughtType::Hungry }, + { "thirsty", PeepThoughtType::Thirsty }, + { "toilet", PeepThoughtType::Toilet }, + { "cant_find", PeepThoughtType::CantFind }, + { "not_paying", PeepThoughtType::NotPaying }, + { "not_while_raining", PeepThoughtType::NotWhileRaining }, + { "bad_litter", PeepThoughtType::BadLitter }, + { "cant_find_exit", PeepThoughtType::CantFindExit }, + { "get_off", PeepThoughtType::GetOff }, + { "get_out", PeepThoughtType::GetOut }, + { "not_safe", PeepThoughtType::NotSafe }, + { "path_disgusting", PeepThoughtType::PathDisgusting }, + { "crowded", PeepThoughtType::Crowded }, + { "vandalism", PeepThoughtType::Vandalism }, + { "scenery", PeepThoughtType::Scenery }, + { "very_clean", PeepThoughtType::VeryClean }, + { "fountains", PeepThoughtType::Fountains }, + { "music", PeepThoughtType::Music }, + { "balloon", PeepThoughtType::Balloon }, + { "toy", PeepThoughtType::Toy }, + { "map", PeepThoughtType::Map }, + { "photo", PeepThoughtType::Photo }, + { "umbrella", PeepThoughtType::Umbrella }, + { "drink", PeepThoughtType::Drink }, + { "burger", PeepThoughtType::Burger }, + { "chips", PeepThoughtType::Chips }, + { "ice_cream", PeepThoughtType::IceCream }, + { "candyfloss", PeepThoughtType::Candyfloss }, + { "pizza", PeepThoughtType::Pizza }, + { "popcorn", PeepThoughtType::Popcorn }, + { "hot_dog", PeepThoughtType::HotDog }, + { "tentacle", PeepThoughtType::Tentacle }, + { "hat", PeepThoughtType::Hat }, + { "toffee_apple", PeepThoughtType::ToffeeApple }, + { "tshirt", PeepThoughtType::Tshirt }, + { "doughnut", PeepThoughtType::Doughnut }, + { "coffee", PeepThoughtType::Coffee }, + { "chicken", PeepThoughtType::Chicken }, + { "lemonade", PeepThoughtType::Lemonade }, + { "wow", PeepThoughtType::Wow }, + { "wow2", PeepThoughtType::Wow2 }, + { "watched", PeepThoughtType::Watched }, + { "balloon_much", PeepThoughtType::BalloonMuch }, + { "toy_much", PeepThoughtType::ToyMuch }, + { "map_much", PeepThoughtType::MapMuch }, + { "photo_much", PeepThoughtType::PhotoMuch }, + { "umbrella_much", PeepThoughtType::UmbrellaMuch }, + { "drink_much", PeepThoughtType::DrinkMuch }, + { "burger_much", PeepThoughtType::BurgerMuch }, + { "chips_much", PeepThoughtType::ChipsMuch }, + { "ice_cream_much", PeepThoughtType::IceCreamMuch }, + { "candyfloss_much", PeepThoughtType::CandyflossMuch }, + { "pizza_much", PeepThoughtType::PizzaMuch }, + { "popcorn_much", PeepThoughtType::PopcornMuch }, + { "hot_dog_much", PeepThoughtType::HotDogMuch }, + { "tentacle_much", PeepThoughtType::TentacleMuch }, + { "hat_much", PeepThoughtType::HatMuch }, + { "toffee_apple_much", PeepThoughtType::ToffeeAppleMuch }, + { "tshirt_much", PeepThoughtType::TshirtMuch }, + { "doughnut_much", PeepThoughtType::DoughnutMuch }, + { "coffee_much", PeepThoughtType::CoffeeMuch }, + { "chicken_much", PeepThoughtType::ChickenMuch }, + { "lemonade_much", PeepThoughtType::LemonadeMuch }, + { "photo2", PeepThoughtType::Photo2 }, + { "photo3", PeepThoughtType::Photo3 }, + { "photo4", PeepThoughtType::Photo4 }, + { "pretzel", PeepThoughtType::Pretzel }, + { "hot_chocolate", PeepThoughtType::HotChocolate }, + { "iced_tea", PeepThoughtType::IcedTea }, + { "funnel_cake", PeepThoughtType::FunnelCake }, + { "sunglasses", PeepThoughtType::Sunglasses }, + { "beef_noodles", PeepThoughtType::BeefNoodles }, + { "fried_rice_noodles", PeepThoughtType::FriedRiceNoodles }, + { "wonton_soup", PeepThoughtType::WontonSoup }, + { "meatball_soup", PeepThoughtType::MeatballSoup }, + { "fruit_juice", PeepThoughtType::FruitJuice }, + { "soybean_milk", PeepThoughtType::SoybeanMilk }, + { "sujongkwa", PeepThoughtType::Sujongkwa }, + { "sub_sandwich", PeepThoughtType::SubSandwich }, + { "cookie", PeepThoughtType::Cookie }, + { "roast_sausage", PeepThoughtType::RoastSausage }, + { "photo2_much", PeepThoughtType::Photo2Much }, + { "photo3_much", PeepThoughtType::Photo3Much }, + { "photo4_much", PeepThoughtType::Photo4Much }, + { "pretzel_much", PeepThoughtType::PretzelMuch }, + { "hot_chocolate_much", PeepThoughtType::HotChocolateMuch }, + { "iced_tea_much", PeepThoughtType::IcedTeaMuch }, + { "funnel_cake_much", PeepThoughtType::FunnelCakeMuch }, + { "sunglasses_much", PeepThoughtType::SunglassesMuch }, + { "beef_noodles_much", PeepThoughtType::BeefNoodlesMuch }, + { "fried_rice_noodles_much", PeepThoughtType::FriedRiceNoodlesMuch }, + { "wonton_soup_much", PeepThoughtType::WontonSoupMuch }, + { "meatball_soup_much", PeepThoughtType::MeatballSoupMuch }, + { "fruit_juice_much", PeepThoughtType::FruitJuiceMuch }, + { "soybean_milk_much", PeepThoughtType::SoybeanMilkMuch }, + { "sujongkwa_much", PeepThoughtType::SujongkwaMuch }, + { "sub_sandwich_much", PeepThoughtType::SubSandwichMuch }, + { "cookie_much", PeepThoughtType::CookieMuch }, + { "roast_sausage_much", PeepThoughtType::RoastSausageMuch }, + { "help", PeepThoughtType::Help }, + { "running_out", PeepThoughtType::RunningOut }, + { "new_ride", PeepThoughtType::NewRide }, + { "nice_ride_deprecated", PeepThoughtType::NiceRideDeprecated }, + { "excited_deprecated", PeepThoughtType::ExcitedDeprecated }, + { "here_we_are", PeepThoughtType::HereWeAre }, + }); ScGuest::ScGuest(EntityId id) : ScPeep(id) diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.hpp b/src/openrct2/scripting/bindings/entity/ScGuest.hpp index 9ee593e220..ceb5dc78fc 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.hpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.hpp @@ -19,68 +19,70 @@ enum class PeepAnimationType : uint8_t; namespace OpenRCT2::Scripting { - static const DukEnumMap ShopItemMap({ - { "beef_noodles", ShopItem::BeefNoodles }, - { "burger", ShopItem::Burger }, - { "candyfloss", ShopItem::Candyfloss }, - { "chicken", ShopItem::Chicken }, - { "chips", ShopItem::Chips }, - { "chocolate", ShopItem::Chocolate }, - { "cookie", ShopItem::Cookie }, - { "doughnut", ShopItem::Doughnut }, - { "hot_dog", ShopItem::HotDog }, - { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, - { "funnel_cake", ShopItem::FunnelCake }, - { "ice_cream", ShopItem::IceCream }, - { "meatball_soup", ShopItem::MeatballSoup }, - { "pizza", ShopItem::Pizza }, - { "popcorn", ShopItem::Popcorn }, - { "pretzel", ShopItem::Pretzel }, - { "roast_sausage", ShopItem::RoastSausage }, - { "sub_sandwich", ShopItem::SubSandwich }, - { "tentacle", ShopItem::Tentacle }, - { "toffee_apple", ShopItem::ToffeeApple }, - { "wonton_soup", ShopItem::WontonSoup }, - { "coffee", ShopItem::Coffee }, - { "drink", ShopItem::Drink }, - { "fruit_juice", ShopItem::FruitJuice }, - { "iced_tea", ShopItem::IcedTea }, - { "lemonade", ShopItem::Lemonade }, - { "soybean_milk", ShopItem::SoybeanMilk }, - { "sujeonggwa", ShopItem::Sujeonggwa }, - { "balloon", ShopItem::Balloon }, - { "hat", ShopItem::Hat }, - { "map", ShopItem::Map }, - { "sunglasses", ShopItem::Sunglasses }, - { "toy", ShopItem::Toy }, - { "tshirt", ShopItem::TShirt }, - { "umbrella", ShopItem::Umbrella }, - { "photo1", ShopItem::Photo }, - { "photo2", ShopItem::Photo2 }, - { "photo3", ShopItem::Photo3 }, - { "photo4", ShopItem::Photo4 }, - { "voucher", ShopItem::Voucher }, - { "empty_bottle", ShopItem::EmptyBottle }, - { "empty_bowl_blue", ShopItem::EmptyBowlBlue }, - { "empty_bowl_red", ShopItem::EmptyBowlRed }, - { "empty_box", ShopItem::EmptyBox }, - { "empty_burger_box", ShopItem::EmptyBurgerBox }, - { "empty_can", ShopItem::EmptyCan }, - { "empty_cup", ShopItem::EmptyCup }, - { "empty_drink_carton", ShopItem::EmptyDrinkCarton }, - { "empty_juice_cup", ShopItem::EmptyJuiceCup }, - { "rubbish", ShopItem::Rubbish }, - }); + static const DukEnumMap ShopItemMap( + { + { "beef_noodles", ShopItem::BeefNoodles }, + { "burger", ShopItem::Burger }, + { "candyfloss", ShopItem::Candyfloss }, + { "chicken", ShopItem::Chicken }, + { "chips", ShopItem::Chips }, + { "chocolate", ShopItem::Chocolate }, + { "cookie", ShopItem::Cookie }, + { "doughnut", ShopItem::Doughnut }, + { "hot_dog", ShopItem::HotDog }, + { "fried_rice_noodles", ShopItem::FriedRiceNoodles }, + { "funnel_cake", ShopItem::FunnelCake }, + { "ice_cream", ShopItem::IceCream }, + { "meatball_soup", ShopItem::MeatballSoup }, + { "pizza", ShopItem::Pizza }, + { "popcorn", ShopItem::Popcorn }, + { "pretzel", ShopItem::Pretzel }, + { "roast_sausage", ShopItem::RoastSausage }, + { "sub_sandwich", ShopItem::SubSandwich }, + { "tentacle", ShopItem::Tentacle }, + { "toffee_apple", ShopItem::ToffeeApple }, + { "wonton_soup", ShopItem::WontonSoup }, + { "coffee", ShopItem::Coffee }, + { "drink", ShopItem::Drink }, + { "fruit_juice", ShopItem::FruitJuice }, + { "iced_tea", ShopItem::IcedTea }, + { "lemonade", ShopItem::Lemonade }, + { "soybean_milk", ShopItem::SoybeanMilk }, + { "sujeonggwa", ShopItem::Sujeonggwa }, + { "balloon", ShopItem::Balloon }, + { "hat", ShopItem::Hat }, + { "map", ShopItem::Map }, + { "sunglasses", ShopItem::Sunglasses }, + { "toy", ShopItem::Toy }, + { "tshirt", ShopItem::TShirt }, + { "umbrella", ShopItem::Umbrella }, + { "photo1", ShopItem::Photo }, + { "photo2", ShopItem::Photo2 }, + { "photo3", ShopItem::Photo3 }, + { "photo4", ShopItem::Photo4 }, + { "voucher", ShopItem::Voucher }, + { "empty_bottle", ShopItem::EmptyBottle }, + { "empty_bowl_blue", ShopItem::EmptyBowlBlue }, + { "empty_bowl_red", ShopItem::EmptyBowlRed }, + { "empty_box", ShopItem::EmptyBox }, + { "empty_burger_box", ShopItem::EmptyBurgerBox }, + { "empty_can", ShopItem::EmptyCan }, + { "empty_cup", ShopItem::EmptyCup }, + { "empty_drink_carton", ShopItem::EmptyDrinkCarton }, + { "empty_juice_cup", ShopItem::EmptyJuiceCup }, + { "rubbish", ShopItem::Rubbish }, + }); // Since the ShopItem enum is missing values and includes ShopItem::Admission (something a // guest cannot carry), 6 is subtracted from the value. static_assert((EnumValue(ShopItem::Count) - 6) == 50, "ShopItem::Count changed, update scripting binding!"); - static const DukEnumMap VoucherTypeMap({ - { "entry_free", VOUCHER_TYPE_PARK_ENTRY_FREE }, - { "entry_half_price", VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE }, - { "ride_free", VOUCHER_TYPE_RIDE_FREE }, - { "food_drink_free", VOUCHER_TYPE_FOOD_OR_DRINK_FREE }, - }); + static const DukEnumMap VoucherTypeMap( + { + { "entry_free", VOUCHER_TYPE_PARK_ENTRY_FREE }, + { "entry_half_price", VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE }, + { "ride_free", VOUCHER_TYPE_RIDE_FREE }, + { "food_drink_free", VOUCHER_TYPE_FOOD_OR_DRINK_FREE }, + }); class ScThought { diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index f602632d65..86dc36d6c6 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -15,20 +15,21 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap LitterTypeMap({ - { "vomit", Litter::Type::Vomit }, - { "vomit_alt", Litter::Type::VomitAlt }, - { "empty_can", Litter::Type::EmptyCan }, - { "rubbish", Litter::Type::Rubbish }, - { "burger_box", Litter::Type::BurgerBox }, - { "empty_cup", Litter::Type::EmptyCup }, - { "empty_box", Litter::Type::EmptyBox }, - { "empty_bottle", Litter::Type::EmptyBottle }, - { "empty_bowl_red", Litter::Type::EmptyBowlRed }, - { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, - { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, - { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, - }); + static const DukEnumMap LitterTypeMap( + { + { "vomit", Litter::Type::Vomit }, + { "vomit_alt", Litter::Type::VomitAlt }, + { "empty_can", Litter::Type::EmptyCan }, + { "rubbish", Litter::Type::Rubbish }, + { "burger_box", Litter::Type::BurgerBox }, + { "empty_cup", Litter::Type::EmptyCup }, + { "empty_box", Litter::Type::EmptyBox }, + { "empty_bottle", Litter::Type::EmptyBottle }, + { "empty_bowl_red", Litter::Type::EmptyBowlRed }, + { "empty_drink_carton", Litter::Type::EmptyDrinkCarton }, + { "empty_juice_cup", Litter::Type::EmptyJuiceCup }, + { "empty_bowl_blue", Litter::Type::EmptyBowlBlue }, + }); ScLitter::ScLitter(EntityId Id) : ScEntity(Id) diff --git a/src/openrct2/scripting/bindings/entity/ScParticle.cpp b/src/openrct2/scripting/bindings/entity/ScParticle.cpp index 4c624b378d..f4250c6e0e 100644 --- a/src/openrct2/scripting/bindings/entity/ScParticle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScParticle.cpp @@ -15,13 +15,14 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap CrashParticleTypeMap({ - { "corner", 0 }, - { "rod", 1 }, - { "wheel", 2 }, - { "panel", 3 }, - { "seat", 4 }, - }); + static const DukEnumMap CrashParticleTypeMap( + { + { "corner", 0 }, + { "rod", 1 }, + { "wheel", 2 }, + { "panel", 3 }, + { "seat", 4 }, + }); ScCrashedVehicleParticle::ScCrashedVehicleParticle(EntityId id) : ScEntity(id) diff --git a/src/openrct2/scripting/bindings/entity/ScPeep.hpp b/src/openrct2/scripting/bindings/entity/ScPeep.hpp index dc4baa8877..3ee1bbd344 100644 --- a/src/openrct2/scripting/bindings/entity/ScPeep.hpp +++ b/src/openrct2/scripting/bindings/entity/ScPeep.hpp @@ -15,35 +15,36 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap PeepFlagMap({ - { "leavingPark", PEEP_FLAGS_LEAVING_PARK }, - { "slowWalk", PEEP_FLAGS_SLOW_WALK }, - { "tracking", PEEP_FLAGS_TRACKING }, - { "waving", PEEP_FLAGS_WAVING }, - { "hasPaidForParkEntry", PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY }, - { "photo", PEEP_FLAGS_PHOTO }, - { "painting", PEEP_FLAGS_PAINTING }, - { "wow", PEEP_FLAGS_WOW }, - { "litter", PEEP_FLAGS_LITTER }, - { "lost", PEEP_FLAGS_LOST }, - { "hunger", PEEP_FLAGS_HUNGER }, - { "toilet", PEEP_FLAGS_TOILET }, - { "crowded", PEEP_FLAGS_CROWDED }, - { "happiness", PEEP_FLAGS_HAPPINESS }, - { "nausea", PEEP_FLAGS_NAUSEA }, - { "purple", PEEP_FLAGS_PURPLE }, - { "pizza", PEEP_FLAGS_PIZZA }, - { "explode", PEEP_FLAGS_EXPLODE }, - { "rideShouldBeMarkedAsFavourite", PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE }, - { "parkEntranceChosen", PEEP_FLAGS_PARK_ENTRANCE_CHOSEN }, - { "contagious", PEEP_FLAGS_CONTAGIOUS }, - { "joy", PEEP_FLAGS_JOY }, - { "angry", PEEP_FLAGS_ANGRY }, - { "iceCream", PEEP_FLAGS_ICE_CREAM }, - { "hereWeAre", PEEP_FLAGS_HERE_WE_ARE }, - { "positionFrozen", PEEP_FLAGS_POSITION_FROZEN }, - { "animationFrozen", PEEP_FLAGS_ANIMATION_FROZEN }, - }); + static const DukEnumMap PeepFlagMap( + { + { "leavingPark", PEEP_FLAGS_LEAVING_PARK }, + { "slowWalk", PEEP_FLAGS_SLOW_WALK }, + { "tracking", PEEP_FLAGS_TRACKING }, + { "waving", PEEP_FLAGS_WAVING }, + { "hasPaidForParkEntry", PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY }, + { "photo", PEEP_FLAGS_PHOTO }, + { "painting", PEEP_FLAGS_PAINTING }, + { "wow", PEEP_FLAGS_WOW }, + { "litter", PEEP_FLAGS_LITTER }, + { "lost", PEEP_FLAGS_LOST }, + { "hunger", PEEP_FLAGS_HUNGER }, + { "toilet", PEEP_FLAGS_TOILET }, + { "crowded", PEEP_FLAGS_CROWDED }, + { "happiness", PEEP_FLAGS_HAPPINESS }, + { "nausea", PEEP_FLAGS_NAUSEA }, + { "purple", PEEP_FLAGS_PURPLE }, + { "pizza", PEEP_FLAGS_PIZZA }, + { "explode", PEEP_FLAGS_EXPLODE }, + { "rideShouldBeMarkedAsFavourite", PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE }, + { "parkEntranceChosen", PEEP_FLAGS_PARK_ENTRANCE_CHOSEN }, + { "contagious", PEEP_FLAGS_CONTAGIOUS }, + { "joy", PEEP_FLAGS_JOY }, + { "angry", PEEP_FLAGS_ANGRY }, + { "iceCream", PEEP_FLAGS_ICE_CREAM }, + { "hereWeAre", PEEP_FLAGS_HERE_WE_ARE }, + { "positionFrozen", PEEP_FLAGS_POSITION_FROZEN }, + { "animationFrozen", PEEP_FLAGS_ANIMATION_FROZEN }, + }); class ScPeep : public ScEntity { diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index b0ef6eb28c..ba32b67f3d 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -20,39 +20,40 @@ using namespace OpenRCT2::TrackMetaData; namespace OpenRCT2::Scripting { - static const DukEnumMap VehicleStatusMap({ - { "moving_to_end_of_station", Vehicle::Status::MovingToEndOfStation }, - { "waiting_for_passengers", Vehicle::Status::WaitingForPassengers }, - { "waiting_to_depart", Vehicle::Status::WaitingToDepart }, - { "departing", Vehicle::Status::Departing }, - { "travelling", Vehicle::Status::Travelling }, - { "arriving", Vehicle::Status::Arriving }, - { "unloading_passengers", Vehicle::Status::UnloadingPassengers }, - { "travelling_boat", Vehicle::Status::TravellingBoat }, - { "crashing", Vehicle::Status::Crashing }, - { "crashed", Vehicle::Status::Crashed }, - { "travelling_dodgems", Vehicle::Status::TravellingDodgems }, - { "swinging", Vehicle::Status::Swinging }, - { "rotating", Vehicle::Status::Rotating }, - { "ferris_wheel_rotating", Vehicle::Status::FerrisWheelRotating }, - { "simulator_operating", Vehicle::Status::SimulatorOperating }, - { "showing_film", Vehicle::Status::ShowingFilm }, - { "space_rings_operating", Vehicle::Status::SpaceRingsOperating }, - { "top_spin_operating", Vehicle::Status::TopSpinOperating }, - { "haunted_house_operating", Vehicle::Status::HauntedHouseOperating }, - { "doing_circus_show", Vehicle::Status::DoingCircusShow }, - { "crooked_house_operating", Vehicle::Status::CrookedHouseOperating }, - { "waiting_for_cable_lift", Vehicle::Status::WaitingForCableLift }, - { "travelling_cable_lift", Vehicle::Status::TravellingCableLift }, - { "stopping", Vehicle::Status::Stopping }, - { "waiting_for_passengers_17", Vehicle::Status::WaitingForPassengers17 }, - { "waiting_to_start", Vehicle::Status::WaitingToStart }, - { "starting", Vehicle::Status::Starting }, - { "operating_1a", Vehicle::Status::Operating1A }, - { "stopping_1b", Vehicle::Status::Stopping1B }, - { "unloading_passengers_1c", Vehicle::Status::UnloadingPassengers1C }, - { "stopped_by_block_brake", Vehicle::Status::StoppedByBlockBrakes }, - }); + static const DukEnumMap VehicleStatusMap( + { + { "moving_to_end_of_station", Vehicle::Status::MovingToEndOfStation }, + { "waiting_for_passengers", Vehicle::Status::WaitingForPassengers }, + { "waiting_to_depart", Vehicle::Status::WaitingToDepart }, + { "departing", Vehicle::Status::Departing }, + { "travelling", Vehicle::Status::Travelling }, + { "arriving", Vehicle::Status::Arriving }, + { "unloading_passengers", Vehicle::Status::UnloadingPassengers }, + { "travelling_boat", Vehicle::Status::TravellingBoat }, + { "crashing", Vehicle::Status::Crashing }, + { "crashed", Vehicle::Status::Crashed }, + { "travelling_dodgems", Vehicle::Status::TravellingDodgems }, + { "swinging", Vehicle::Status::Swinging }, + { "rotating", Vehicle::Status::Rotating }, + { "ferris_wheel_rotating", Vehicle::Status::FerrisWheelRotating }, + { "simulator_operating", Vehicle::Status::SimulatorOperating }, + { "showing_film", Vehicle::Status::ShowingFilm }, + { "space_rings_operating", Vehicle::Status::SpaceRingsOperating }, + { "top_spin_operating", Vehicle::Status::TopSpinOperating }, + { "haunted_house_operating", Vehicle::Status::HauntedHouseOperating }, + { "doing_circus_show", Vehicle::Status::DoingCircusShow }, + { "crooked_house_operating", Vehicle::Status::CrookedHouseOperating }, + { "waiting_for_cable_lift", Vehicle::Status::WaitingForCableLift }, + { "travelling_cable_lift", Vehicle::Status::TravellingCableLift }, + { "stopping", Vehicle::Status::Stopping }, + { "waiting_for_passengers_17", Vehicle::Status::WaitingForPassengers17 }, + { "waiting_to_start", Vehicle::Status::WaitingToStart }, + { "starting", Vehicle::Status::Starting }, + { "operating_1a", Vehicle::Status::Operating1A }, + { "stopping_1b", Vehicle::Status::Stopping1B }, + { "unloading_passengers_1c", Vehicle::Status::UnloadingPassengers1C }, + { "stopped_by_block_brake", Vehicle::Status::StoppedByBlockBrakes }, + }); ScVehicle::ScVehicle(EntityId id) : ScEntity(id) diff --git a/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp b/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp index 27da8c20cc..afa982c48b 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp @@ -197,17 +197,18 @@ std::vector ScTrackSegment::getSubpositions(uint8_t trackSubposition, static DukValue _trackCurveToString(duk_context* ctx, TrackCurve curve) { - static const EnumMap map({ - { "straight", TrackCurve::None }, - { "left", TrackCurve::Left }, - { "right", TrackCurve::Right }, - { "left_small", TrackCurve::LeftSmall }, - { "right_small", TrackCurve::RightSmall }, - { "left_very_small", TrackCurve::LeftVerySmall }, - { "right_very_small", TrackCurve::RightVerySmall }, - { "left_large", TrackCurve::LeftLarge }, - { "right_large", TrackCurve::RightLarge }, - }); + static const EnumMap map( + { + { "straight", TrackCurve::None }, + { "left", TrackCurve::Left }, + { "right", TrackCurve::Right }, + { "left_small", TrackCurve::LeftSmall }, + { "right_small", TrackCurve::RightSmall }, + { "left_very_small", TrackCurve::LeftVerySmall }, + { "right_very_small", TrackCurve::RightVerySmall }, + { "left_large", TrackCurve::LeftLarge }, + { "right_large", TrackCurve::RightLarge }, + }); u8string text = u8string(map[curve]); return ToDuk(ctx, text); diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 5dabf66f1c..c115667795 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -28,21 +28,22 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap ParkFlagMap({ - { "open", PARK_FLAGS_PARK_OPEN }, - { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, - { "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES }, - { "forbidTreeRemoval", PARK_FLAGS_FORBID_TREE_REMOVAL }, - { "forbidHighConstruction", PARK_FLAGS_FORBID_HIGH_CONSTRUCTION }, - { "preferLessIntenseRides", PARK_FLAGS_PREF_LESS_INTENSE_RIDES }, - { "forbidMarketingCampaigns", PARK_FLAGS_FORBID_MARKETING_CAMPAIGN }, - { "preferMoreIntenseRides", PARK_FLAGS_PREF_MORE_INTENSE_RIDES }, - { "noMoney", PARK_FLAGS_NO_MONEY }, - { "difficultGuestGeneration", PARK_FLAGS_DIFFICULT_GUEST_GENERATION }, - { "freeParkEntry", PARK_FLAGS_PARK_FREE_ENTRY }, - { "difficultParkRating", PARK_FLAGS_DIFFICULT_PARK_RATING }, - { "unlockAllPrices", PARK_FLAGS_UNLOCK_ALL_PRICES }, - }); + static const DukEnumMap ParkFlagMap( + { + { "open", PARK_FLAGS_PARK_OPEN }, + { "scenarioCompleteNameInput", PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT }, + { "forbidLandscapeChanges", PARK_FLAGS_FORBID_LANDSCAPE_CHANGES }, + { "forbidTreeRemoval", PARK_FLAGS_FORBID_TREE_REMOVAL }, + { "forbidHighConstruction", PARK_FLAGS_FORBID_HIGH_CONSTRUCTION }, + { "preferLessIntenseRides", PARK_FLAGS_PREF_LESS_INTENSE_RIDES }, + { "forbidMarketingCampaigns", PARK_FLAGS_FORBID_MARKETING_CAMPAIGN }, + { "preferMoreIntenseRides", PARK_FLAGS_PREF_MORE_INTENSE_RIDES }, + { "noMoney", PARK_FLAGS_NO_MONEY }, + { "difficultGuestGeneration", PARK_FLAGS_DIFFICULT_GUEST_GENERATION }, + { "freeParkEntry", PARK_FLAGS_PARK_FREE_ENTRY }, + { "difficultParkRating", PARK_FLAGS_DIFFICULT_PARK_RATING }, + { "unlockAllPrices", PARK_FLAGS_UNLOCK_ALL_PRICES }, + }); ScPark::ScPark(duk_context* ctx) : _context(ctx) diff --git a/src/openrct2/scripting/bindings/world/ScResearch.cpp b/src/openrct2/scripting/bindings/world/ScResearch.cpp index 08b273f2a2..b6f718b5b7 100644 --- a/src/openrct2/scripting/bindings/world/ScResearch.cpp +++ b/src/openrct2/scripting/bindings/world/ScResearch.cpp @@ -24,28 +24,31 @@ using namespace OpenRCT2; namespace OpenRCT2::Scripting { - static const DukEnumMap ResearchStageMap({ - { "initial_research", RESEARCH_STAGE_INITIAL_RESEARCH }, - { "designing", RESEARCH_STAGE_DESIGNING }, - { "completing_design", RESEARCH_STAGE_COMPLETING_DESIGN }, - { "unknown", RESEARCH_STAGE_UNKNOWN }, - { "finished_all", RESEARCH_STAGE_FINISHED_ALL }, - }); + static const DukEnumMap ResearchStageMap( + { + { "initial_research", RESEARCH_STAGE_INITIAL_RESEARCH }, + { "designing", RESEARCH_STAGE_DESIGNING }, + { "completing_design", RESEARCH_STAGE_COMPLETING_DESIGN }, + { "unknown", RESEARCH_STAGE_UNKNOWN }, + { "finished_all", RESEARCH_STAGE_FINISHED_ALL }, + }); - static const DukEnumMap ResearchCategoryMap({ - { "transport", ResearchCategory::Transport }, - { "gentle", ResearchCategory::Gentle }, - { "rollercoaster", ResearchCategory::Rollercoaster }, - { "thrill", ResearchCategory::Thrill }, - { "water", ResearchCategory::Water }, - { "shop", ResearchCategory::Shop }, - { "scenery", ResearchCategory::SceneryGroup }, - }); + static const DukEnumMap ResearchCategoryMap( + { + { "transport", ResearchCategory::Transport }, + { "gentle", ResearchCategory::Gentle }, + { "rollercoaster", ResearchCategory::Rollercoaster }, + { "thrill", ResearchCategory::Thrill }, + { "water", ResearchCategory::Water }, + { "shop", ResearchCategory::Shop }, + { "scenery", ResearchCategory::SceneryGroup }, + }); - static const DukEnumMap ResearchEntryTypeMap({ - { "ride", Research::EntryType::Ride }, - { "scenery", Research::EntryType::Scenery }, - }); + static const DukEnumMap ResearchEntryTypeMap( + { + { "ride", Research::EntryType::Ride }, + { "scenery", Research::EntryType::Scenery }, + }); template<> inline DukValue ToDuk(duk_context* ctx, const ResearchItem& value) diff --git a/src/openrct2/scripting/bindings/world/ScScenario.hpp b/src/openrct2/scripting/bindings/world/ScScenario.hpp index 345faeea75..f6babef307 100644 --- a/src/openrct2/scripting/bindings/world/ScScenario.hpp +++ b/src/openrct2/scripting/bindings/world/ScScenario.hpp @@ -20,20 +20,21 @@ namespace OpenRCT2::Scripting { - static const DukEnumMap ScenarioObjectiveTypeMap({ - { "none", OBJECTIVE_NONE }, - { "guestsBy", OBJECTIVE_GUESTS_BY }, - { "parkValueBy", OBJECTIVE_PARK_VALUE_BY }, - { "haveFun", OBJECTIVE_HAVE_FUN }, - { "buildTheBest", OBJECTIVE_BUILD_THE_BEST }, - { "10Rollercoasters", OBJECTIVE_10_ROLLERCOASTERS }, - { "guestsAndRating", OBJECTIVE_GUESTS_AND_RATING }, - { "monthlyRideIncome", OBJECTIVE_MONTHLY_RIDE_INCOME }, - { "10RollercoastersLength", OBJECTIVE_10_ROLLERCOASTERS_LENGTH }, - { "finish5Rollercoasters", OBJECTIVE_FINISH_5_ROLLERCOASTERS }, - { "repayLoanAndParkValue", OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE }, - { "monthlyFoodIncome", OBJECTIVE_MONTHLY_FOOD_INCOME }, - }); + static const DukEnumMap ScenarioObjectiveTypeMap( + { + { "none", OBJECTIVE_NONE }, + { "guestsBy", OBJECTIVE_GUESTS_BY }, + { "parkValueBy", OBJECTIVE_PARK_VALUE_BY }, + { "haveFun", OBJECTIVE_HAVE_FUN }, + { "buildTheBest", OBJECTIVE_BUILD_THE_BEST }, + { "10Rollercoasters", OBJECTIVE_10_ROLLERCOASTERS }, + { "guestsAndRating", OBJECTIVE_GUESTS_AND_RATING }, + { "monthlyRideIncome", OBJECTIVE_MONTHLY_RIDE_INCOME }, + { "10RollercoastersLength", OBJECTIVE_10_ROLLERCOASTERS_LENGTH }, + { "finish5Rollercoasters", OBJECTIVE_FINISH_5_ROLLERCOASTERS }, + { "repayLoanAndParkValue", OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE }, + { "monthlyFoodIncome", OBJECTIVE_MONTHLY_FOOD_INCOME }, + }); class ScScenarioObjective {