Rename members of PluginType

This commit is contained in:
Gymnasiast committed 2026-08-02 20:08:35 +02:00
1 parent 46dbc1cf20
commit e1f2c365c1
6 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -402,7 +402,7 @@ namespace OpenRCT2::Scripting
auto& execInfo = scriptEngine->GetExecInfo();
auto owner = execInfo.GetCurrentPlugin();
if (owner->GetMetadata().Type == PluginType::Intransient)
if (owner->GetMetadata().Type == PluginType::intransient)
{
CustomMenuItems.emplace_back(
owner, CustomToolbarMenuItemKind::Toolbox, JSToStdString(ctx, argv[0]), JSCallback(ctx, argv[1]));
+1 -1
View File
@@ -102,7 +102,7 @@ bool HookEngine::HasSubscriptions(HookType type) const
bool HookEngine::IsValidHookForPlugin(HookType type, Plugin& plugin) const
{
if (type == HookType::mapChanged && plugin.GetMetadata().Type != PluginType::Intransient)
if (type == HookType::mapChanged && plugin.GetMetadata().Type != PluginType::intransient)
{
return false;
}
+4 -4
View File
@@ -216,11 +216,11 @@ void Plugin::SetMetadata(const JSValue obj)
PluginType Plugin::ParsePluginType(std::string_view type)
{
if (type == "local")
return PluginType::Local;
return PluginType::local;
if (type == "remote")
return PluginType::Remote;
return PluginType::remote;
if (type == "intransient")
return PluginType::Intransient;
return PluginType::intransient;
throw std::invalid_argument("Unknown plugin type.");
}
@@ -235,7 +235,7 @@ int32_t Plugin::GetTargetAPIVersion() const
bool Plugin::IsTransient() const
{
return _metadata.Type != PluginType::Intransient;
return _metadata.Type != PluginType::intransient;
}
#endif
+3 -3
View File
@@ -27,19 +27,19 @@ namespace OpenRCT2::Scripting
* Scripts that can run on servers or clients with no impact on the game state and will not
* be uploaded to clients.
*/
Local,
local,
/**
* Scripts that can run on servers and will be uploaded to clients with ability to
* modify game state in certain contexts.
*/
Remote,
remote,
/**
* Scripts that run when the game starts and only unload explicitly rather than when the
* park changes.
*/
Intransient,
intransient,
};
struct PluginMetadata
+1 -1
View File
@@ -1134,7 +1134,7 @@ bool ScriptEngine::ShouldStartPlugin(const std::shared_ptr<Plugin>& plugin)
{
// Only client plugins and plugins downloaded from server should be started
const auto& metadata = plugin->GetMetadata();
if (metadata.Type == PluginType::Remote && plugin->HasPath())
if (metadata.Type == PluginType::remote && plugin->HasPath())
{
LogPluginInfo(plugin, "Remote plugin not started");
return false;
+1 -1
View File
@@ -211,7 +211,7 @@ namespace OpenRCT2::Scripting
for (const auto& plugin : _plugins)
{
const auto& metadata = plugin->GetMetadata();
if (metadata.Type == PluginType::Remote)
if (metadata.Type == PluginType::remote)
{
res.push_back(plugin);
}