mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 20:43:04 +01:00
[Plugin] Add banner index to banner creation result
This commit is contained in:
@@ -12,10 +12,13 @@
|
||||
# include "ScriptEngine.h"
|
||||
|
||||
# include "../PlatformEnvironment.h"
|
||||
# include "../actions/BannerPlaceAction.h"
|
||||
# include "../actions/CustomAction.h"
|
||||
# include "../actions/GameAction.h"
|
||||
# include "../actions/LargeSceneryPlaceAction.h"
|
||||
# include "../actions/RideCreateAction.h"
|
||||
# include "../actions/StaffHireNewAction.h"
|
||||
# include "../actions/WallPlaceAction.h"
|
||||
# include "../config/Config.h"
|
||||
# include "../core/EnumMap.hpp"
|
||||
# include "../core/File.h"
|
||||
@@ -1222,6 +1225,26 @@ DukValue ScriptEngine::GameActionResultToDuk(const GameAction& action, const Gam
|
||||
}
|
||||
}
|
||||
}
|
||||
// BannerPlaceAction, LargeSceneryPlaceAction, WallPlaceAction
|
||||
auto bannerId = BannerIndex::GetNull();
|
||||
switch (action.GetType())
|
||||
{
|
||||
case GameCommand::PlaceBanner:
|
||||
bannerId = result.GetData<BannerPlaceActionResult>().bannerId;
|
||||
break;
|
||||
case GameCommand::PlaceLargeScenery:
|
||||
bannerId = result.GetData<LargeSceneryPlaceActionResult>().bannerId;
|
||||
break;
|
||||
case GameCommand::PlaceWall:
|
||||
bannerId = result.GetData<WallPlaceActionResult>().BannerId;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!bannerId.IsNull())
|
||||
{
|
||||
obj.Set("bannerIndex", bannerId.ToUnderlying());
|
||||
}
|
||||
|
||||
return obj.Take();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user