C#: Fix dictionary key lookup documentation

The method to check if a key exists in the dictionary is called `ContainsKey`.
This commit is contained in:
Raul Santos
2023-06-01 19:38:20 +02:00
parent 2e273f0e35
commit 6723b4e8c3
3 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -93,7 +93,7 @@
new Godot.Collections.Dictionary
{
{ "name", "myOption" },
{ "defaultValue", false },
{ "default_value", false },
}
};
}
@@ -157,12 +157,12 @@
return true
[/gdscript]
[csharp]
public void GetOptionVisibility(string option, Godot.Collections.Dictionary options)
public void _GetOptionVisibility(string option, Godot.Collections.Dictionary options)
{
// Only show the lossy quality setting if the compression mode is set to "Lossy".
if (option == "compress/lossyQuality" && options.Contains("compress/mode"))
if (option == "compress/lossy_quality" && options.ContainsKey("compress/mode"))
{
return (int)options["compress/mode"] == COMPRESS_LOSSY; // This is a constant you set
return (int)options["compress/mode"] == CompressLossy; // This is a constant you set
}
return true;