fix signature in docs of EditorImportPlugin._GetOptionVisibility

This commit is contained in:
dogboydog 2025-06-29 12:18:31 -04:00
parent efb40c1524
commit f72c439a40

View file

@ -163,18 +163,18 @@
Gets whether the import option specified by [param option_name] should be visible in the Import dock. The default implementation always returns [code]true[/code], making all options visible. This is mainly useful for hiding options that depend on others if one of them is disabled. Gets whether the import option specified by [param option_name] should be visible in the Import dock. The default implementation always returns [code]true[/code], making all options visible. This is mainly useful for hiding options that depend on others if one of them is disabled.
[codeblocks] [codeblocks]
[gdscript] [gdscript]
func _get_option_visibility(option, options): func _get_option_visibility(path, option_name, options):
# Only show the lossy quality setting if the compression mode is set to "Lossy". # Only show the lossy quality setting if the compression mode is set to "Lossy".
if option == "compress/lossy_quality" and options.has("compress/mode"): if option_name == "compress/lossy_quality" and options.has("compress/mode"):
return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set return int(options["compress/mode"]) == COMPRESS_LOSSY # This is a constant that you set
return true return true
[/gdscript] [/gdscript]
[csharp] [csharp]
public void _GetOptionVisibility(string option, Godot.Collections.Dictionary options) public override bool _GetOptionVisibility(string path, StringName optionName, Godot.Collections.Dictionary options)
{ {
// Only show the lossy quality setting if the compression mode is set to "Lossy". // Only show the lossy quality setting if the compression mode is set to "Lossy".
if (option == "compress/lossy_quality" && options.ContainsKey("compress/mode")) if (optionName == "compress/lossy_quality" && options.ContainsKey("compress/mode"))
{ {
return (int)options["compress/mode"] == CompressLossy; // This is a constant you set return (int)options["compress/mode"] == CompressLossy; // This is a constant you set
} }