Fixes for the GDScript styling in various pages.

This commit is contained in:
Michael Alexsander Silva Dias
2018-02-05 15:14:37 -02:00
parent 5fe2bb26d7
commit 23cb08ce0a
21 changed files with 248 additions and 260 deletions

View File

@@ -201,8 +201,10 @@ now, but we can make this method future-proof by returning the size of our
func get_preset_name(preset):
match preset:
PRESET_DEFAULT: return "Default"
_ : return "Unknown"
PRESET_DEFAULT:
return "Default"
_:
return "Unknown"
Here we have the
@@ -224,10 +226,11 @@ you do this you have to be careful when you add more presets.
match preset:
PRESET_DEFAULT:
return [{
"name": "use_red_anyway",
"default_value": false
"name": "use_red_anyway",
"default_value": false
}]
_: return []
_:
return []
This is the method which defines the available options.
:ref:`get_import_options<class_EditorImportPlugin_get_import_options>` returns
@@ -287,7 +290,7 @@ method. Our sample code is a bit long, so let's split in a few parts:
func import(source_file, save_path, options, r_platform_variants, r_gen_files):
var file = File.new()
var err = file.open(source_file, File.READ)
if (err != OK):
if err != OK:
return err
var line = file.get_line()

View File

@@ -208,13 +208,13 @@ deactivated. The code can be like this::
dock = preload("res://addons/my_custom_dock/my_dock.tscn").instance()
# Add the loaded scene to the docks:
add_control_to_dock( DOCK_SLOT_LEFT_UL, dock)
add_control_to_dock(DOCK_SLOT_LEFT_UL, dock)
# Note that LEFT_UL means the left of the editor, upper-left dock
func _exit_tree():
# Clean-up of the plugin goes here
# Remove the scene from the docks:
remove_control_from_docks( dock ) # Remove the dock
remove_control_from_docks(dock) # Remove the dock
dock.free() # Erase the control from the memory
While the dock position is chosen when adding it, the user is free to move it