1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 20:43:04 +01:00

Add plugin API to get registered plugin metadata (#20709)

* Added API for getAllPlugins

Added functionality to the Scripting API to allow Contexts to return a list of all registered plugins.

* Fixed naming conventions, returning list of authors

Changed function names to follow get/set convention. Removed unnecessary copies of shared pointers, now using auto instead. Changed the functionality to return an array of authors instead of a string.

* Added changelog entry

Also added myself to list of contributors

* Moved all functionality to ScPlugin

Created a ScPlugin class and moved the current getPlugins functionality there.

* Changed from method to property

Function names now match the get/set convention for properties. Also did some code cleanup.

* Update copyright

* Bump plugin version

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
Alex Parisi
2024-02-16 03:53:48 -05:00
committed by GitHub
parent 04603f5213
commit efb6d48c4c
7 changed files with 104 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
# include "bindings/game/ScConsole.hpp"
# include "bindings/game/ScContext.hpp"
# include "bindings/game/ScDisposable.hpp"
# include "bindings/game/ScPlugin.hpp"
# include "bindings/game/ScProfiler.hpp"
# include "bindings/network/ScNetwork.hpp"
# include "bindings/network/ScPlayer.hpp"
@@ -443,6 +444,7 @@ void ScriptEngine::Initialise()
ScScenarioObjective::Register(ctx);
ScPatrolArea::Register(ctx);
ScStaff::Register(ctx);
ScPlugin::Register(ctx);
dukglue_register_global(ctx, std::make_shared<ScCheats>(), "cheats");
dukglue_register_global(ctx, std::make_shared<ScClimate>(), "climate");
@@ -452,6 +454,7 @@ void ScriptEngine::Initialise()
dukglue_register_global(ctx, std::make_shared<ScMap>(ctx), "map");
dukglue_register_global(ctx, std::make_shared<ScNetwork>(ctx), "network");
dukglue_register_global(ctx, std::make_shared<ScPark>(ctx), "park");
dukglue_register_global(ctx, std::make_shared<ScPlugin>(), "pluginManager");
dukglue_register_global(ctx, std::make_shared<ScProfiler>(ctx), "profiler");
dukglue_register_global(ctx, std::make_shared<ScScenario>(), "scenario");
dukglue_register_global(ctx, std::make_shared<ScObjectManager>(), "objectManager");