From 26c22103f901dd5dd606c29a10556ea2fca2f54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Fam=C3=A0?= Date: Wed, 16 Aug 2023 22:47:52 +0200 Subject: [PATCH] Update Godot project and wwise.gd addon script This commit updates the wwise.gd addon script, wrapping up the integration of recent codebase changes by removing the ported plugins from GDScript. Currently, the only editor plugin still added to the Editor via GDScript is the EditorExportPlugin. This will resolved as soon as a related bug (https://github.com/godotengine/godot/issues/80593) is fixed. --- addons/Wwise/editor/ak_editor_plugin.gd | 63 ------------------- .../editor/waapi_picker/waapi_picker.tscn | 5 +- addons/Wwise/wwise.gd | 21 ++----- project.godot | 2 +- 4 files changed, 6 insertions(+), 85 deletions(-) delete mode 100644 addons/Wwise/editor/ak_editor_plugin.gd diff --git a/addons/Wwise/editor/ak_editor_plugin.gd b/addons/Wwise/editor/ak_editor_plugin.gd deleted file mode 100644 index 9f883a83..00000000 --- a/addons/Wwise/editor/ak_editor_plugin.gd +++ /dev/null @@ -1,63 +0,0 @@ -@tool -extends EditorPlugin - -var wwise_node_icon: Texture2D = load("res://addons/Wwise/editor/images/wwise_node.svg") -var ak_event_gizmo = load("res://addons/Wwise/editor/ak_event_gizmo.gd").new() -var inspector_browser: EditorPlugin -var waapi_picker: EditorPlugin -var build_export_plugin: EditorExportPlugin - - -func _enter_tree(): - setup_custom_nodes_icons() - add_node_3d_gizmo_plugin(ak_event_gizmo) - - inspector_browser = ( - load("res://addons/Wwise/editor/inspector_browser/inspector_browser_editor_plugin.gd").new() - ) - get_editor_interface().get_base_control().add_child(inspector_browser) - - if OS.has_feature("windows") || OS.has_feature("macos"): - waapi_picker = load("res://addons/Wwise/editor/waapi_picker/waapi_picker.gd").new() - get_editor_interface().get_base_control().add_child(waapi_picker) - - build_export_plugin = load("res://addons/Wwise/editor/ak_build_export.gd").AkBuildExport.new() - add_export_plugin(build_export_plugin) - - -func _exit_tree(): - remove_node_3d_gizmo_plugin(ak_event_gizmo) - - get_editor_interface().get_base_control().remove_child(inspector_browser) - inspector_browser.queue_free() - - if OS.has_feature("windows") || OS.has_feature("macos"): - get_editor_interface().get_base_control().remove_child(waapi_picker) - waapi_picker.queue_free() - - remove_export_plugin(build_export_plugin) - build_export_plugin.free() - - -func setup_custom_nodes_icons(): - # note(alex): Directly setting the icons on the theme slows down startup time - # considerably. We duplicate the theme to avoid this here. - var theme := get_editor_interface().get_base_control().get_theme().duplicate() - if theme: - theme.set_icon(&"Wwise", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"Waapi", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"WwiseSettings", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkListener2D", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkListener3D", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkEvent2D", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkEvent3D", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkState", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkSwitch", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkBank", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkEnvironment", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkEnvironmentData", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkGeometry", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkPortal", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkRoom", &"EditorIcons", wwise_node_icon) - theme.set_icon(&"AkEarlyReflections", &"EditorIcons", wwise_node_icon) - get_editor_interface().get_base_control().set_theme(theme) diff --git a/addons/Wwise/editor/waapi_picker/waapi_picker.tscn b/addons/Wwise/editor/waapi_picker/waapi_picker.tscn index 1e1a3fd7..404c1edf 100644 --- a/addons/Wwise/editor/waapi_picker/waapi_picker.tscn +++ b/addons/Wwise/editor/waapi_picker/waapi_picker.tscn @@ -1,6 +1,4 @@ -[gd_scene load_steps=2 format=3 uid="uid://bbq1nrovlwd1x"] - -[ext_resource type="Script" path="res://addons/Wwise/editor/waapi_picker/waapi_picker_drag.gd" id="1_71lrd"] +[gd_scene format=3 uid="uid://bomvl5s3ftk53"] [node name="WwisePickerControl" type="VBoxContainer"] anchors_preset = 15 @@ -46,4 +44,3 @@ caret_blink_interval = 0.5 layout_mode = 2 size_flags_vertical = 3 allow_reselect = true -script = ExtResource("1_71lrd") diff --git a/addons/Wwise/wwise.gd b/addons/Wwise/wwise.gd index 4ee92c5f..cc49947b 100644 --- a/addons/Wwise/wwise.gd +++ b/addons/Wwise/wwise.gd @@ -1,25 +1,12 @@ @tool extends EditorPlugin -var editor_plugin: EditorPlugin -var initialized: bool = false - +var build_export_plugin: EditorExportPlugin func _enter_tree(): - if !ProjectSettings.has_setting("autoload/WwiseRuntimeManager"): - add_autoload_singleton( - "WwiseRuntimeManager", "res://addons/Wwise/runtime/wwise_runtime_manager.gd" - ) - - if Engine.is_editor_hint() && !initialized: - editor_plugin = load("res://addons/Wwise/editor/ak_editor_plugin.gd").new() - get_editor_interface().get_base_control().add_child(editor_plugin) - initialized = true + build_export_plugin = load("res://addons/Wwise/editor/ak_build_export.gd").AkBuildExport.new() + add_export_plugin(build_export_plugin) func _exit_tree(): - remove_autoload_singleton("WwiseRuntimeManager") - - if Engine.is_editor_hint(): - get_editor_interface().get_base_control().remove_child(editor_plugin) - editor_plugin.queue_free() + remove_export_plugin(build_export_plugin) diff --git a/project.godot b/project.godot index da14ca51..9fe48cfa 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="Wwise Godot Integration Demo Project" -config/features=PackedStringArray("4.0") +config/features=PackedStringArray("4.1") run/max_fps=60 [autoload]