Skip to content

Commit 306fe95

Browse files
authored
Merge pull request #2717 from dialogic-godot/export-stripping
Striping PNGs from project exports
2 parents 0dd7da2 + 7657834 commit 306fe95

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

addons/dialogic/export_plugin.gd

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
extends EditorExportPlugin
2+
3+
4+
const IGNORED_PATHS = [
5+
"/Editor",
6+
"/Modules",
7+
"/Example Assets/portraits"
8+
]
9+
10+
11+
func _get_name() -> String:
12+
return "Dialogic Export Plugin"
13+
14+
15+
func _export_file(path: String, type: String, features: PackedStringArray) -> void:
16+
var plugin_path: String = "res://addons/dialogic"
17+
18+
for ignored_path: String in IGNORED_PATHS:
19+
if path.begins_with(plugin_path + ignored_path):
20+
if path.ends_with(".png"):
21+
skip()
22+
elif path.ends_with(".tff"):
23+
skip()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://daxhncrord5lp

addons/dialogic/plugin.gd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const PLUGIN_NAME := "Dialogic"
77
const PLUGIN_HANDLER_PATH := "res://addons/dialogic/Core/DialogicGameHandler.gd"
88
const PLUGIN_ICON_PATH := "uid://dybg3l5pwetne"
99
const PLUGIN_INSPECTOR_PATH := "uid://bok1je25mskp7"
10+
const EDITOR_EXPORT_PLUGIN := "uid://daxhncrord5lp"
1011

1112
## References used by various other scripts to quickly reference these things
1213
var editor_view: Control # the root of the dialogic editor
@@ -37,6 +38,9 @@ func _enter_tree() -> void:
3738
editor_view.plugin_reference = self
3839
EditorInterface.get_editor_main_screen().add_child(editor_view)
3940
_make_visible(false)
41+
42+
var export_plugin : EditorExportPlugin = load(EDITOR_EXPORT_PLUGIN).new()
43+
add_export_plugin(export_plugin)
4044

4145
inspector_plugin = load(PLUGIN_INSPECTOR_PATH).new()
4246
add_inspector_plugin(inspector_plugin)

0 commit comments

Comments
 (0)