You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			GDScript
		
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			GDScript
		
	
| @tool
 | |
| extends EditorPlugin
 | |
| 
 | |
| const PLUGIN_SCRIPTS: Array[GDScript] = [
 | |
|     preload("editor_import_plugins/sprite_frames.gd"),
 | |
| ]
 | |
| 
 | |
| const Common = preload("common.gd")
 | |
| const ImportPlugin = preload("editor_import_plugins/_animation_importer_base.gd")
 | |
| 
 | |
| var __import_plugins: Array[ImportPlugin]
 | |
| 
 | |
| var common_options: Array[Dictionary] = Common.create_common_animation_options()
 | |
| 
 | |
| func _enter_tree() -> void:
 | |
|     __register_project_setting(
 | |
|         Common.ASEPRITE_EXECUTABLE_PATH_SETTING_NAME, "",
 | |
|         TYPE_STRING, PROPERTY_HINT_GLOBAL_FILE, "*.exe")
 | |
| 
 | |
|     for plugin_script in PLUGIN_SCRIPTS:
 | |
|         var import_plugin = plugin_script.new(self)
 | |
|         add_import_plugin(import_plugin)
 | |
|         __import_plugins.append(import_plugin)
 | |
| 
 | |
| func _exit_tree() -> void:
 | |
|     for import_plugin in __import_plugins:
 | |
|         remove_import_plugin(import_plugin)
 | |
|     __import_plugins.clear()
 | |
| 
 | |
| func __register_project_setting(name: StringName, initial_value, type: int, hint: int, hint_string: String = "") -> void:
 | |
|     if not ProjectSettings.has_setting(name):
 | |
|         ProjectSettings.set_setting(name, initial_value)
 | |
|         ProjectSettings.set_initial_value(name, initial_value)
 | |
|         var property_info: Dictionary = { name = name, type = type, hint = hint }
 | |
|         if hint_string: property_info.hint_string = hint_string
 | |
|         ProjectSettings.add_property_info(property_info)
 |