From 8cdd376e00adccc2e2b39aea5597580e7c95fadc Mon Sep 17 00:00:00 2001 From: Robin Gustafsson Date: Sat, 4 Jul 2020 15:59:43 +0200 Subject: [PATCH] Update enum usage in "Import plugins" The examples using the `Presets` enum don't work as-is. The enum key must be referenced with the enum name prefixed. According to [GDScript basics](https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html) this was changed in 3.1. --- tutorials/plugins/editor/import_plugins.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/plugins/editor/import_plugins.rst b/tutorials/plugins/editor/import_plugins.rst index fffc4b543..ae047c716 100644 --- a/tutorials/plugins/editor/import_plugins.rst +++ b/tutorials/plugins/editor/import_plugins.rst @@ -178,7 +178,7 @@ good practice to use an enum so you can refer to them using names. tool extends EditorImportPlugin - enum Presets { PRESET_DEFAULT } + enum Presets { DEFAULT } ... @@ -199,7 +199,7 @@ now, but we can make this method future-proof by returning the size of our func get_preset_name(preset): match preset: - PRESET_DEFAULT: + Presets.DEFAULT: return "Default" _: return "Unknown" @@ -222,7 +222,7 @@ you do this you have to be careful when you add more presets. func get_import_options(preset): match preset: - PRESET_DEFAULT: + Presets.DEFAULT: return [{ "name": "use_red_anyway", "default_value": false