-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port EditorExportPlugin from GDScript to C++
- Loading branch information
1 parent
bbd1d75
commit 6a638c1
Showing
2 changed files
with
78 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,2 @@ | ||
class AkBuildExport: | ||
extends EditorExportPlugin | ||
|
||
func _get_name() -> String: | ||
return "AkBuildExport" | ||
|
||
func _export_file(path: String, type: String, features: PackedStringArray): | ||
var base_path: String = ProjectSettings.get_setting("wwise/common_user_settings/base_path") | ||
if !base_path.is_empty(): | ||
for i in features.size(): | ||
if path.findn(base_path) != -1: | ||
if features[i] == "windows": | ||
if ( | ||
path.findn("Linux") != -1 | ||
|| path.findn("Mac") != -1 | ||
|| path.findn("Android") != -1 | ||
|| path.findn("iOS") != -1 | ||
): | ||
skip() | ||
if features[i] == "macos": | ||
if ( | ||
path.findn("Windows") != -1 | ||
|| path.findn("Linux") != -1 | ||
|| path.findn("Android") != -1 | ||
|| path.findn("iOS") != -1 | ||
): | ||
skip() | ||
if features[i] == "linux": | ||
if ( | ||
path.findn("Windows") != -1 | ||
|| path.findn("Mac") != -1 | ||
|| path.findn("Android") != -1 | ||
|| path.findn("iOS") != -1 | ||
): | ||
skip() | ||
if features[i] == "android": | ||
if ( | ||
path.findn("Windows") != -1 | ||
|| path.findn("Mac") != -1 | ||
|| path.findn("Linux") != -1 | ||
|| path.findn("iOS") != -1 | ||
): | ||
skip() | ||
if features[i] == "ios": | ||
if ( | ||
path.findn("Windows") != -1 | ||
|| path.findn("Mac") != -1 | ||
|| path.findn("Linux") != -1 | ||
|| path.findn("Android") != -1 | ||
): | ||
skip() | ||
extends AkEditorExportPlugin |
77 changes: 77 additions & 0 deletions
77
addons/Wwise/native/src/editor/export_plugin/ak_editor_export_plugin.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#ifndef AK_EDITOR_EXPORT_PLUGIN | ||
#define AK_EDITOR_EXPORT_PLUGIN | ||
|
||
#include <godot_cpp/classes/editor_export_plugin.hpp> | ||
#include <godot_cpp/classes/project_settings.hpp> | ||
|
||
namespace godot | ||
{ | ||
class AkEditorExportPlugin : public EditorExportPlugin | ||
{ | ||
GDCLASS(AkEditorExportPlugin, EditorExportPlugin); | ||
|
||
protected: | ||
static void _bind_methods() {} | ||
|
||
private: | ||
public: | ||
virtual String _get_name() const override { return "AkEditorExportPlugin"; } | ||
virtual void _export_file(const String& path, const String& type, const PackedStringArray& features) override | ||
{ | ||
String base_path = ProjectSettings::get_singleton()->get_setting("wwise/common_user_settings/base_path"); | ||
|
||
if (!base_path.is_empty()) | ||
{ | ||
for (int i = 0; i < features.size(); ++i) | ||
{ | ||
if (path.findn(base_path) != -1) | ||
{ | ||
if (features[i] == "windows") | ||
{ | ||
if (path.findn("Linux") != -1 || path.findn("Mac") != -1 || path.findn("Android") != -1 || | ||
path.findn("iOS") != -1) | ||
{ | ||
skip(); | ||
} | ||
} | ||
else if (features[i] == "macos") | ||
{ | ||
if (path.findn("Windows") != -1 || path.findn("Linux") != -1 || path.findn("Android") != -1 || | ||
path.findn("iOS") != -1) | ||
{ | ||
skip(); | ||
} | ||
} | ||
else if (features[i] == "linux") | ||
{ | ||
if (path.findn("Windows") != -1 || path.findn("Mac") != -1 || path.findn("Android") != -1 || | ||
path.findn("iOS") != -1) | ||
{ | ||
skip(); | ||
} | ||
} | ||
else if (features[i] == "android") | ||
{ | ||
if (path.findn("Windows") != -1 || path.findn("Mac") != -1 || path.findn("Linux") != -1 || | ||
path.findn("iOS") != -1) | ||
{ | ||
skip(); | ||
} | ||
} | ||
else if (features[i] == "ios") | ||
{ | ||
if (path.findn("Windows") != -1 || path.findn("Mac") != -1 || path.findn("Linux") != -1 || | ||
path.findn("Android") != -1) | ||
{ | ||
skip(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
} //namespace godot | ||
|
||
#endif |