forked from rosebudai/OpenRCT2-Web
Rename members of ScConfigurationKind
This commit is contained in:
2 files changed
+14
-14
No files matched your search
@@ -23,9 +23,9 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
enum class ScConfigurationKind
|
||||
{
|
||||
User,
|
||||
Shared,
|
||||
Park
|
||||
user,
|
||||
shared,
|
||||
park
|
||||
};
|
||||
|
||||
class ScConfiguration final : public ScBase
|
||||
@@ -58,16 +58,16 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
switch (data->_kind)
|
||||
{
|
||||
case ScConfigurationKind::Park:
|
||||
case ScConfigurationKind::park:
|
||||
{
|
||||
return GetParkStorageForPlugin(ctx, data->_pluginName);
|
||||
}
|
||||
case ScConfigurationKind::Shared:
|
||||
case ScConfigurationKind::shared:
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
return JS_DupValue(ctx, scriptEngine.GetSharedStorage());
|
||||
}
|
||||
case ScConfigurationKind::User:
|
||||
case ScConfigurationKind::user:
|
||||
default:
|
||||
Guard::Fail("Invalid ScConfigurationKind");
|
||||
return JS_UNDEFINED;
|
||||
@@ -151,7 +151,7 @@ namespace OpenRCT2::Scripting
|
||||
return false;
|
||||
}
|
||||
|
||||
if (kind != ScConfigurationKind::Park)
|
||||
if (kind != ScConfigurationKind::park)
|
||||
{
|
||||
if (ns.empty())
|
||||
{
|
||||
@@ -192,7 +192,7 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
if (IsValidNamespace(ns, data->_kind))
|
||||
{
|
||||
if (data->_kind == ScConfigurationKind::User)
|
||||
if (data->_kind == ScConfigurationKind::user)
|
||||
{
|
||||
JSValue obj = JS_NewObject(ctx);
|
||||
if (ns == "general")
|
||||
@@ -228,7 +228,7 @@ namespace OpenRCT2::Scripting
|
||||
JSValue defaultValue = argv[1];
|
||||
ConfigurationData* data = gScConfiguration.GetOpaque<ConfigurationData*>(thisVal);
|
||||
|
||||
if (data->_kind == ScConfigurationKind::User)
|
||||
if (data->_kind == ScConfigurationKind::user)
|
||||
{
|
||||
if (key == "general.language")
|
||||
{
|
||||
@@ -281,7 +281,7 @@ namespace OpenRCT2::Scripting
|
||||
JSValue value = argv[1];
|
||||
ConfigurationData* data = gScConfiguration.GetOpaque<ConfigurationData*>(thisVal);
|
||||
|
||||
if (data->_kind == ScConfigurationKind::User)
|
||||
if (data->_kind == ScConfigurationKind::user)
|
||||
{
|
||||
if (key == "general.showFps")
|
||||
{
|
||||
@@ -345,7 +345,7 @@ namespace OpenRCT2::Scripting
|
||||
// context.configuration
|
||||
JSValue New(JSContext* ctx)
|
||||
{
|
||||
return MakeWithOpaque(ctx, new ConfigurationData{ ScConfigurationKind::User, {} });
|
||||
return MakeWithOpaque(ctx, new ConfigurationData{ ScConfigurationKind::user, {} });
|
||||
}
|
||||
|
||||
// context.sharedStorage / context.getParkStorage
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
static JSValue sharedStorage_get(JSContext* ctx, JSValue thisVal)
|
||||
{
|
||||
return gScConfiguration.New(ctx, ScConfigurationKind::Shared);
|
||||
return gScConfiguration.New(ctx, ScConfigurationKind::shared);
|
||||
}
|
||||
|
||||
static JSValue getParkStorage(JSContext* ctx, JSValue thisVal, int argc, JSValue* argv)
|
||||
@@ -66,7 +66,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
return JS_ThrowPlainError(ctx, "Plugin name is empty");
|
||||
}
|
||||
result = gScConfiguration.New(ctx, ScConfigurationKind::Park, pluginName);
|
||||
result = gScConfiguration.New(ctx, ScConfigurationKind::park, pluginName);
|
||||
}
|
||||
else if (JS_IsUndefined(jsPluginName))
|
||||
{
|
||||
@@ -75,7 +75,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
return JS_ThrowPlainError(ctx, "Plugin name must be specified when used from console.");
|
||||
}
|
||||
result = gScConfiguration.New(ctx, ScConfigurationKind::Park, plugin->GetMetadata().Name);
|
||||
result = gScConfiguration.New(ctx, ScConfigurationKind::park, plugin->GetMetadata().Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user