Editor Export Settings Dialog is completed!! Now on to make some exporters..

This commit is contained in:
Juan Linietsky 2017-02-19 23:19:30 -03:00
parent 5e3fc7d069
commit f6950956bd
23 changed files with 1246 additions and 2237 deletions

View file

@ -29,7 +29,7 @@
#include "version.h"
#include "export.h"
#include "tools/editor/editor_settings.h"
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "tools/editor/editor_node.h"
#include "io/zip_io.h"
#include "io/marshalls.h"
@ -1892,9 +1892,11 @@ EditorExportPlatformAndroid::~EditorExportPlatformAndroid() {
memdelete(device_thread);
}
#endif
void register_android_exporter() {
#if 0
String exe_ext=OS::get_singleton()->get_name()=="Windows"?"exe":"";
EDITOR_DEF("export/android/adb","");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/adb",PROPERTY_HINT_GLOBAL_FILE,exe_ext));
@ -1913,6 +1915,6 @@ void register_android_exporter() {
Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>( memnew(EditorExportPlatformAndroid) );
EditorImportExport::get_singleton()->add_export_platform(exporter);
}
#endif
}

View file

@ -29,7 +29,7 @@
#include "version.h"
#include "export.h"
#include "tools/editor/editor_settings.h"
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "tools/editor/editor_node.h"
#include "io/zip_io.h"
#include "io/marshalls.h"
@ -803,9 +803,9 @@ EditorExportPlatformBB10::~EditorExportPlatformBB10() {
memdelete(device_thread);
}
#endif
void register_bb10_exporter() {
#if 0
EDITOR_DEF("export/blackberry/host_tools","");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"export/blackberry/host_tools",PROPERTY_HINT_GLOBAL_DIR));
EDITOR_DEF("export/blackberry/debug_token","");
@ -824,7 +824,7 @@ void register_bb10_exporter() {
Ref<EditorExportPlatformBB10> exporter = Ref<EditorExportPlatformBB10>( memnew(EditorExportPlatformBB10) );
EditorImportExport::get_singleton()->add_export_platform(exporter);
#endif
}
#endif

View file

@ -29,7 +29,7 @@
#include "version.h"
#include "export.h"
#include "tools/editor/editor_settings.h"
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "tools/editor/editor_node.h"
#include "io/zip_io.h"
#include "io/marshalls.h"
@ -417,14 +417,14 @@ EditorExportPlatformJavaScript::~EditorExportPlatformJavaScript() {
}
#endif
void register_javascript_exporter() {
Ref<EditorExportPlatformJavaScript> exporter = Ref<EditorExportPlatformJavaScript>( memnew(EditorExportPlatformJavaScript) );
EditorImportExport::get_singleton()->add_export_platform(exporter);
//Ref<EditorExportPlatformJavaScript> exporter = Ref<EditorExportPlatformJavaScript>( memnew(EditorExportPlatformJavaScript) );
//EditorImportExport::get_singleton()->add_export_platform(exporter);
}
#endif

View file

@ -29,7 +29,7 @@
#include "version.h"
#include "export.h"
#include "tools/editor/editor_settings.h"
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "tools/editor/editor_node.h"
#include "io/zip_io.h"
#include "io/marshalls.h"
@ -536,14 +536,14 @@ EditorExportPlatformOSX::~EditorExportPlatformOSX() {
}
#endif
void register_osx_exporter() {
#if 0
Ref<EditorExportPlatformOSX> exporter = Ref<EditorExportPlatformOSX>( memnew(EditorExportPlatformOSX) );
EditorImportExport::get_singleton()->add_export_platform(exporter);
#endif
}
#endif

View file

@ -2384,10 +2384,11 @@ EditorExportPlatformUWP::EditorExportPlatformUWP() {
EditorExportPlatformUWP::~EditorExportPlatformUWP() {}
#endif
void register_uwp_exporter() {
#if 0
Ref<EditorExportPlatformUWP> exporter = Ref<EditorExportPlatformUWP>(memnew(EditorExportPlatformUWP));
EditorImportExport::get_singleton()->add_export_platform(exporter);
}
#endif
}

View file

@ -28,10 +28,11 @@
/*************************************************************************/
#include "export.h"
#include "platform/windows/logo.h"
#include "tools/editor/editor_import_export.h"
#if 0
#include "tools/editor/editor_export.h"
void register_windows_exporter() {
#if 0
Image img(_windows_logo);
Ref<ImageTexture> logo = memnew( ImageTexture );
logo->create_from_image(img);
@ -48,6 +49,6 @@ void register_windows_exporter() {
EditorImportExport::get_singleton()->add_export_platform(exporter);
}
}
#endif
}

View file

@ -28,11 +28,27 @@
/*************************************************************************/
#include "export.h"
#include "platform/x11/logo.h"
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "scene/resources/texture.h"
#if 0
void register_x11_exporter() {
Ref<EditorExportPlatformPC> platform;
platform.instance();
Image img(_x11_logo);
Ref<ImageTexture> logo;
logo.instance();
logo->create_from_image(img);
platform->set_logo(logo);
platform->set_name("Linux/X11");
platform->set_extension("");
EditorExport::get_singleton()->add_export_platform(platform);
#if 0
Image img(_x11_logo);
Ref<ImageTexture> logo = memnew( ImageTexture );
logo->create_from_image(img);
@ -49,5 +65,6 @@ void register_x11_exporter() {
EditorImportExport::get_singleton()->add_export_platform(exporter);
}
#endif
}
#endif

View file

@ -272,7 +272,7 @@ void AcceptDialog::_update_child_rects() {
if (!c)
continue;
if (c==hbc || c==label || c==get_close_button())
if (c==hbc || c==label || c==get_close_button() || c->is_set_as_toplevel())
continue;
c->set_pos(cpos);
@ -299,7 +299,7 @@ Size2 AcceptDialog::get_minimum_size() const {
if (!c)
continue;
if (c==hbc || c==label || c==const_cast<AcceptDialog*>(this)->get_close_button())
if (c==hbc || c==label || c==const_cast<AcceptDialog*>(this)->get_close_button() || c->is_set_as_toplevel())
continue;
Size2 cminsize = c->get_combined_minimum_size();

View file

@ -1204,6 +1204,22 @@ int ItemList::get_item_at_pos(const Point2& p_pos, bool p_exact) const {
return closest;
}
bool ItemList::is_pos_at_end_of_items(const Point2& p_pos) const {
if (items.empty())
return true;
Vector2 pos=p_pos;
Ref<StyleBox> bg = get_stylebox("bg");
pos-=bg->get_offset();
pos.y+=scroll_bar->get_value();
Rect2 endrect = items[items.size()-1].rect_cache;
return (pos.y > endrect.pos.y + endrect.size.y);
}
String ItemList::get_tooltip(const Point2& p_pos) const {
int closest = get_item_at_pos(p_pos);

View file

@ -191,6 +191,7 @@ public:
virtual String get_tooltip(const Point2& p_pos) const;
int get_item_at_pos(const Point2& p_pos,bool p_exact=false) const;
bool is_pos_at_end_of_items(const Point2& p_pos) const;
void set_icon_scale(real_t p_scale);
real_t get_icon_scale() const;

View file

@ -137,7 +137,7 @@ if (env["tools"] == "yes"):
reg_exporters = 'void register_exporters() {\n'
for e in env.platform_exporters:
env.editor_sources.append("#platform/" + e + "/export/export.cpp")
reg_exporters += '\t//register_' + e + '_exporter();\n'
reg_exporters += '\tregister_' + e + '_exporter();\n'
reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n'
reg_exporters += '}\n'
f = open("register_exporters.cpp", "wb")

View file

@ -26,7 +26,7 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor_import_export.h"
#include "editor_export.h"
#include "version.h"
#include "script_language.h"
#include "globals.h"
@ -49,6 +49,7 @@ bool EditorExportPreset::_set(const StringName& p_name, const Variant& p_value)
if (values.has(p_name)) {
values[p_name]=p_value;
EditorExport::singleton->save_presets();
return true;
}
@ -72,15 +73,125 @@ void EditorExportPreset::_get_property_list( List<PropertyInfo> *p_list) const{
}
}
Vector<StringName> EditorExportPreset::get_files_to_export() const {
Ref<EditorExportPlatform> EditorExportPreset::get_platform() {
return Vector<StringName>();
return platform;
}
Vector<String> EditorExportPreset::get_files_to_export() const {
Vector<String> files;
for(Set<String>::Element *E=selected_files.front();E;E=E->next()) {
files.push_back(E->get());
}
return files;
}
void EditorExportPreset::set_name(const String& p_name) {
name=p_name;
EditorExport::singleton->save_presets();
}
String EditorExportPreset::get_name() const {
return name;
}
void EditorExportPreset::set_runnable(bool p_enable) {
runnable=p_enable;
EditorExport::singleton->save_presets();
}
bool EditorExportPreset::is_runnable() const {
return runnable;
}
void EditorExportPreset::set_export_filter(ExportFilter p_filter) {
export_filter=p_filter;
EditorExport::singleton->save_presets();
}
EditorExportPreset::ExportFilter EditorExportPreset::get_export_filter() const {
return export_filter;
}
void EditorExportPreset::set_include_filter(const String& p_include) {
include_filter=p_include;
EditorExport::singleton->save_presets();
}
String EditorExportPreset::get_include_filter() const {
return include_filter;
}
void EditorExportPreset::set_exclude_filter(const String& p_exclude) {
exclude_filter=p_exclude;
EditorExport::singleton->save_presets();
}
String EditorExportPreset::get_exclude_filter() const {
return exclude_filter;
}
void EditorExportPreset::add_export_file(const String& p_path) {
selected_files.insert(p_path);
EditorExport::singleton->save_presets();
}
void EditorExportPreset::remove_export_file(const String& p_path) {
selected_files.erase(p_path);
EditorExport::singleton->save_presets();
}
bool EditorExportPreset::has_export_file(const String& p_path) {
return selected_files.has(p_path);
}
void EditorExportPreset::add_patch(const String& p_path,int p_at_pos) {
if (p_at_pos<0)
patches.push_back(p_path);
else
patches.insert(p_at_pos,p_path);
EditorExport::singleton->save_presets();
}
void EditorExportPreset::remove_patch(int p_idx) {
patches.remove(p_idx);
EditorExport::singleton->save_presets();
}
void EditorExportPreset::set_patch(int p_index,const String& p_path) {
ERR_FAIL_INDEX(p_index,patches.size());
patches[p_index]=p_path;
EditorExport::singleton->save_presets();
}
String EditorExportPreset::get_patch(int p_index) {
ERR_FAIL_INDEX_V(p_index,patches.size(),String());
return patches[p_index];
}
Vector<String> EditorExportPreset::get_patches() const {
return patches;
}
EditorExportPreset::EditorExportPreset() {
export_filter=EXPORT_ALL_RESOURCES;
runnable=false;
}
@ -143,7 +254,7 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
Error EditorExportPlatform::_save_pack_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total) {
return OK;
}
Error EditorExportPlatform::_save_zip_file(void *p_userdata,const String& p_path, const Vector<uint8_t>& p_data,int p_file,int p_total) {
@ -205,6 +316,24 @@ String EditorExportPlatform::find_export_template(String template_file_name, Str
return "";
}
Ref<EditorExportPreset> EditorExportPlatform::create_preset() {
Ref<EditorExportPreset> preset;
preset.instance();
preset->platform=Ref<EditorExportPlatform>(this);
List<ExportOption> options;
get_export_options(&options);
for (List<ExportOption>::Element *E=options.front();E;E=E->next()) {
preset->properties.push_back(E->get().option);
preset->values[E->get().option.name]=E->get().default_value;
}
return preset;
}
Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset>& p_preset,EditorExportSaveFunction p_func, void* p_udata) {
@ -229,6 +358,76 @@ EditorExportPlatform::EditorExportPlatform() {
////
EditorExport *EditorExport::singleton=NULL;
void EditorExport::_save() {
Ref<ConfigFile> config;
config.instance();
for(int i=0;i<export_presets.size();i++) {
Ref<EditorExportPreset> preset = export_presets[i];
String section="preset."+itos(i);
config->set_value(section,"name",preset->get_name());
config->set_value(section,"platform",preset->get_platform()->get_name());
config->set_value(section,"runnable",preset->is_runnable());
bool save_files=false;
switch(preset->get_export_filter()) {
case EditorExportPreset::EXPORT_ALL_RESOURCES: {
config->set_value(section,"export_filter","all_resources");
} break;
case EditorExportPreset::EXPORT_SELECTED_SCENES: {
config->set_value(section,"export_filter","scenes");
save_files=true;
} break;
case EditorExportPreset::EXPORT_SELECTED_RESOURCES: {
config->set_value(section,"export_filter","resources");
save_files=true;
} break;
case EditorExportPreset::EXPORT_ALL_FILES: {
config->set_value(section,"export_filter","all_files");
} break;
}
if (save_files) {
Vector<String> export_files = preset->get_files_to_export();
config->set_value(section,"export_files",export_files);
}
config->set_value(section,"include_filter",preset->get_include_filter());
config->set_value(section,"exclude_filter",preset->get_exclude_filter());
config->set_value(section,"patch_list",preset->get_patches());
String option_section="preset."+itos(i)+".options";
for (const List<PropertyInfo>::Element *E=preset->get_properties().front();E;E=E->next()) {
config->set_value(option_section,E->get().name,preset->get(E->get().name));
}
}
config->save("res://export_presets.cfg");
print_line("saved ok");
}
void EditorExport::save_presets() {
print_line("save presets");
if (block_save)
return;
save_timer->start();
}
void EditorExport::_bind_methods() {
ClassDB::bind_method("_save",&EditorExport::_save);
}
void EditorExport::add_export_platform(const Ref<EditorExportPlatform>& p_platform) {
export_platforms.push_back(p_platform);
@ -273,23 +472,186 @@ void EditorExport::remove_export_preset(int p_idx) {
export_presets.remove(p_idx);
}
void EditorExport::_notification(int p_what) {
if (p_what==NOTIFICATION_ENTER_TREE) {
load_config();
}
}
void EditorExport::load_config() {
Ref<ConfigFile> config;
config.instance();
Error err = config->load("res://export_presets.cfg");
if (err!=OK)
return;
block_save=true;
int index=0;
while(true) {
String section = "preset."+itos(index);
if (!config->has_section(section))
break;
String platform=config->get_value(section,"platform");
Ref<EditorExportPreset> preset;
for(int i=0;i<export_platforms.size();i++) {
if (export_platforms[i]->get_name()==platform) {
preset = export_platforms[i]->create_preset();
break;
}
}
if (!preset.is_valid()) {
index++;
ERR_CONTINUE(!preset.is_valid());
}
preset->set_name( config->get_value(section,"name") );
preset->set_runnable( config->get_value(section,"runnable") );
String export_filter = config->get_value(section,"export_filter");
bool get_files=false;
if (export_filter=="all_resources") {
preset->set_export_filter(EditorExportPreset::EXPORT_ALL_RESOURCES);
} else if (export_filter=="scenes") {
preset->set_export_filter(EditorExportPreset::EXPORT_SELECTED_SCENES);
get_files=true;
} else if (export_filter=="resources") {
preset->set_export_filter(EditorExportPreset::EXPORT_SELECTED_RESOURCES);
get_files=true;
} else if (export_filter=="all_files") {
preset->set_export_filter(EditorExportPreset::EXPORT_ALL_FILES);
}
if (get_files) {
Vector<String> files = config->get_value(section,"export_files");
for(int i=0;i<files.size();i++) {
preset->add_export_file(files[i]);
}
}
preset->set_include_filter( config->get_value(section,"include_filter") );
preset->set_exclude_filter( config->get_value(section,"exclude_filter") );
Vector<String> patch_list = config->get_value(section,"patch_list");
for(int i=0;i<patch_list.size();i++) {
preset->add_patch(patch_list[i]);
}
String option_section="preset."+itos(index)+".options";
List<String> options;
config->get_section_keys(option_section,&options);
for (List<String>::Element *E=options.front();E;E=E->next()) {
Variant value = config->get_value(option_section,E->get());
preset->set(E->get(),value);
}
add_export_preset(preset);
index++;
}
block_save=false;
}
void EditorExport::save_config() {
}
EditorExport::EditorExport() {
save_timer = memnew( Timer );
add_child(save_timer);
save_timer->set_wait_time(0.8);
save_timer->set_one_shot(true);
save_timer->connect("timeout",this,"_save");
block_save=false;
singleton=this;
}
EditorExport::~EditorExport() {
}
//////////
void EditorExportPlatformPC::get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String>* r_features) {
if (p_preset->get("texture_format/s3tc")) {
r_features->push_back("s3tc");
}
if (p_preset->get("texture_format/etc")) {
r_features->push_back("etc");
}
if (p_preset->get("texture_format/etc2")) {
r_features->push_back("etc2");
}
}
void EditorExportPlatformPC::get_export_options(List<ExportOption> *r_options) {
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/s3tc"),true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/etc"),false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"texture_format/etc2"),false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL,"binary_format/64_bits"),true));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING,"custom_template/release",PROPERTY_HINT_GLOBAL_FILE),""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING,"custom_template/debug",PROPERTY_HINT_GLOBAL_FILE),""));
}
String EditorExportPlatformPC::get_name() const {
return name;
}
Ref<Texture> EditorExportPlatformPC::get_logo() const {
return logo;
}
bool EditorExportPlatformPC::can_export(String *r_error) const {
return true;
}
String EditorExportPlatformPC::get_binary_extension() const {
return extension;
}
Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset>& p_preset,const String& p_path,int p_flags) {
return OK;
}
void EditorExportPlatformPC::set_extension(const String& p_extension) {
extension=p_extension;
}
void EditorExportPlatformPC::set_name(const String& p_name) {
name=p_name;
}
void EditorExportPlatformPC::set_logo(const Ref<Texture>& p_logo) {
logo=p_logo;
}
EditorExportPlatformPC::EditorExportPlatformPC() {
}
////////

View file

@ -26,40 +26,51 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef EDITOR_IMPORT_EXPORT_H
#define EDITOR_IMPORT_EXPORT_H
#ifndef EDITOR_EXPORT_H
#define EDITOR_EXPORT_H
#include "resource.h"
#include "scene/main/node.h"
#include "scene/resources/texture.h"
#include "scene/main/timer.h"
class EditorProgress;
class FileAccess;
class EditorExportPlatform;
class EditorExportPreset : public Reference {
GDCLASS( EditorExportPreset,Reference )
public:
enum ExportFilter {
EXPORT_RESOURCES,
EXPORT_SELECTED,
EXPORT_ALL,
EXPORT_ALL_RESOURCES,
EXPORT_SELECTED_SCENES,
EXPORT_SELECTED_RESOURCES,
EXPORT_ALL_FILES,
};
private:
Ref<EditorExportPlatform> platform;
ExportFilter export_filter;
String include_filter;
String exclude_filter;
String exporter;
Set<String> selected_files;
bool debug;
bool runnable;
Vector<String> patches;
friend class EditorExport;
friend class EditorExportPlatform;
List<PropertyInfo> properties;
Map<StringName,Variant> values;
String name;
protected:
bool _set(const StringName& p_name, const Variant& p_value);
bool _get(const StringName& p_name,Variant &r_ret) const;
@ -67,8 +78,37 @@ protected:
public:
Vector<StringName> get_files_to_export() const;
Ref<EditorExportPlatform> get_platform();
bool has(const StringName& p_property) const { return values.has(p_property); }
Vector<String> get_files_to_export() const;
void add_export_file(const String& p_path);
void remove_export_file(const String& p_path);
bool has_export_file(const String& p_path);
void set_name(const String& p_name);
String get_name() const;
void set_runnable(bool p_enable);
bool is_runnable() const;
void set_export_filter(ExportFilter p_filter);
ExportFilter get_export_filter() const;
void set_include_filter(const String& p_include);
String get_include_filter() const;
void set_exclude_filter(const String& p_exclude);
String get_exclude_filter() const;
void add_patch(const String& p_path,int p_at_pos=-1);
void set_patch(int p_index,const String& p_path);
String get_patch(int p_index);
void remove_patch(int p_idx);
Vector<String> get_patches() const;
const List<PropertyInfo>& get_properties() const { return properties; }
EditorExportPreset();
};
@ -113,7 +153,7 @@ private:
protected:
virtual void get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String*> r_features)=0;
virtual void get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String> *r_features)=0;
String find_export_template(String template_file_name, String *err=NULL) const;
public:
@ -127,8 +167,9 @@ public:
ExportOption() {}
};
virtual void get_export_options(ExportOption *r_options)=0;
virtual Ref<EditorExportPreset> create_preset()=0;
virtual Ref<EditorExportPreset> create_preset();
virtual void get_export_options(List<ExportOption> *r_options)=0;
virtual String get_name() const =0;
virtual Ref<Texture> get_logo() const =0;
@ -169,14 +210,23 @@ class EditorExport : public Node {
Vector<Ref<EditorExportPlatform> > export_platforms;
Vector<Ref<EditorExportPreset> > export_presets;
Timer *save_timer;
bool block_save;
static EditorExport *singleton;
void _save();
protected:
friend class EditorExportPreset;
void save_presets();
void _notification(int p_what);
static void _bind_methods();
public:
static EditorExport * get_singleton() { return singleton; }
void add_export_platform(const Ref<EditorExportPlatform>& p_platform);
int get_export_platform_count();
Ref<EditorExportPlatform> get_export_platform(int p_idx);
@ -188,7 +238,6 @@ public:
void remove_export_preset(int p_idx);
void load_config();
void save_config();
EditorExport();
~EditorExport();
@ -196,4 +245,37 @@ public:
class EditorExportPlatformPC : public EditorExportPlatform {
GDCLASS( EditorExportPlatformPC,EditorExportPlatform )
Ref<ImageTexture> logo;
String name;
String extension;
public:
virtual void get_preset_features(const Ref<EditorExportPreset>& p_preset,List<String>* r_features);
virtual void get_export_options(List<ExportOption> *r_options);
virtual String get_name() const;
virtual Ref<Texture> get_logo() const;
virtual bool can_export(String *r_error=NULL) const;
virtual String get_binary_extension() const;
virtual Error export_project(const Ref<EditorExportPreset>& p_preset,const String& p_path,int p_flags=0);
void set_extension(const String& p_extension);
void set_name(const String& p_name);
void set_logo(const Ref<Texture>& p_loco);
EditorExportPlatformPC();
};
#endif // EDITOR_IMPORT_EXPORT_H

View file

@ -2209,25 +2209,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
case FILE_EXPORT_PROJECT: {
//project_export_settings->popup_export();
/*
String target = export_db->get_current_platform();
Ref<EditorExporter> exporter = export_db->get_exporter(target);
if (exporter.is_null()) {
accept->set_text("No exporter for platform '"+target+"' yet.");
accept->popup_centered(Size2(300,70));
return;
}
String extension = exporter->get_binary_extension();
print_line("for target: "+target+" extension: "+extension);
file_export_password->set_editable( exporter->requieres_password(file_export_check->is_pressed()));
file_export->clear_filters();
if (extension!="") {
file_export->add_filter("*."+extension);
}
file_export->popup_centered_ratio();*/
project_export->popup_export();
} break;
case FILE_EXPORT_MESH_LIBRARY: {
@ -5236,6 +5218,9 @@ EditorNode::EditorNode() {
EditorFileDialog::register_func=_editor_file_dialog_register;
EditorFileDialog::unregister_func=_editor_file_dialog_unregister;
editor_export = memnew( EditorExport );
add_child(editor_export);
register_exporters();
@ -6156,8 +6141,8 @@ EditorNode::EditorNode() {
//gui_base->add_child(optimized_save);
//optimized_save->connect("confirmed",this,"_save_optimized");
//project_export = memnew( ProjectExport(&editor_data) );
//gui_base->add_child(project_export);
project_export = memnew( ProjectExportDialog );
gui_base->add_child(project_export);
//project_export_settings = memnew( ProjectExportDialog(this) );
//gui_base->add_child(project_export_settings);
@ -6302,6 +6287,7 @@ EditorNode::EditorNode() {
add_editor_plugin( memnew( AnimationPlayerEditorPlugin(this) ) );
add_editor_plugin( memnew( CanvasItemEditorPlugin(this) ) );
add_editor_plugin( memnew( SpatialEditorPlugin(this) ) );

View file

@ -73,7 +73,7 @@
#include "tools/editor/quick_open.h"
#include "tools/editor/project_export.h"
#include "tools/editor/editor_sub_scene.h"
#include "editor_import_export.h"
#include "editor_export.h"
#include "editor_reimport_dialog.h"
#include "tools/editor/editor_plugin.h"
#include "tools/editor/editor_name_dialog.h"
@ -365,7 +365,7 @@ private:
String _tmp_import_path;
EditorImportExport *editor_import_export;
EditorExport *editor_export;
Object *current;
@ -395,7 +395,7 @@ private:
EditorRun editor_run;
EditorSelection *editor_selection;
// ProjectExport *project_export;
// ProjectExportDialog *project_export_settings;
ProjectExportDialog *project_export;
EditorResourcePreview *resource_preview;
EditorFileServer *file_server;

View file

@ -43,7 +43,7 @@ class EditorNode;
class Spatial;
class Camera;
class EditorSelection;
class EditorImportExport;
class EditorExport;
class EditorSettings;
class SpatialEditorGizmo;
class EditorImportPlugin;

View file

@ -28,7 +28,7 @@
/*************************************************************************/
#include "editor_run_native.h"
#include "editor_import_export.h"
#include "editor_export.h"
void EditorRunNative::_notification(int p_what) {

View file

@ -29,7 +29,7 @@
#ifndef EDITOR_EXPORT_SCENE_H
#define EDITOR_EXPORT_SCENE_H
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#if 0
class EditorSceneExportPlugin : public EditorExportPlugin {

View file

@ -29,7 +29,7 @@
#ifndef EDITOR_FONT_IMPORT_PLUGIN_H
#define EDITOR_FONT_IMPORT_PLUGIN_H
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "scene/resources/font.h"
#if 0
class EditorNode;

View file

@ -29,7 +29,7 @@
#ifndef EDITOR_TRANSLATION_IMPORT_PLUGIN_H
#define EDITOR_TRANSLATION_IMPORT_PLUGIN_H
#include "tools/editor/editor_import_export.h"
#include "tools/editor/editor_export.h"
#include "scene/resources/font.h"
#if 0
class EditorNode;

File diff suppressed because it is too large Load diff

View file

@ -35,6 +35,7 @@
#include "scene/gui/label.h"
#include "tools/editor/editor_file_dialog.h"
#include "scene/gui/button.h"
#include "scene/gui/file_dialog.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/tab_container.h"
#include "os/dir_access.h"
@ -44,167 +45,77 @@
#include "scene/gui/slider.h"
#include "tools/editor/editor_file_system.h"
#include "property_editor.h"
#include "editor_import_export.h"
#include "editor_export.h"
#if 0
class EditorNode;
class ProjectExportDialog : public ConfirmationDialog {
GDCLASS( ProjectExportDialog, ConfirmationDialog );
public:
enum ExportAction {
ACTION_NONE,
ACTION_COPY,
ACTION_BUNDLE,
ACTION_MAX
};
static const char *da_string[ACTION_MAX];
private:
EditorNode *editor;
String expopt;
TabContainer *sections;
bool updating_tree;
bool pending_update_tree;
AcceptDialog *error;
ConfirmationDialog *confirm;
ConfirmationDialog *confirm_keystore;
Button *button_reload;
LineEdit *filters, *filters_exclude;
HBoxContainer *plat_errors;
Label *platform_error_string;
MenuButton *add_preset;
Button *delete_preset;
ItemList *presets;
StringName ei;
StringName ot;
LineEdit *name;
PropertyEditor *parameters;
CheckButton *runnable;
Tree * tree;
EditorFileDialog *pck_export;
EditorFileDialog *file_export;
LineEdit *file_export_password;
Button *button_export;
String _delete_attempt;
bool updating;
ConfirmationDialog *delete_confirm;
OptionButton *export_filter;
LineEdit *include_filters;
LineEdit *exclude_filters;
Tree *include_files;
Label* include_label;
MarginContainer *include_margin;
StringName editor_icons;
Tree *patches;
Button *patch_export;
int patch_index;
FileDialog *patch_dialog;
ConfirmationDialog *patch_erase;
void _patch_selected(const String& p_path);
void _patch_deleted();
void _runnable_pressed();
void _name_changed(const String& p_string);
void _add_preset(int p_platform);
void _edit_preset(int p_index);
void _delete_preset();
void _delete_preset_confirm();
void _update_presets();
void _export_type_changed(int p_which);
void _filter_changed(const String& p_filter);
void _fill_resource_tree();
bool _fill_tree(EditorFileSystemDirectory *p_dir,TreeItem *p_item,Ref<EditorExportPreset> &current,bool p_only_scenes);
void _tree_changed();
void _update_tree();
bool _create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir);
void _rescan();
//void _confirmed();
void _scan_finished();
void _validate_platform();
///////////////////
Tree * platforms;
PropertyEditor *platform_options;
OptionButton *export_mode;
CheckButton *convert_text_scenes;
VBoxContainer *tree_vb;
VBoxContainer *image_vb;
OptionButton *image_action;
HSlider *image_quality;
SpinBox *image_shrink;
Tree *image_formats;
Vector<TreeItem*> formats;
LineEdit *group_new_name;
HSlider *group_lossy_quality;
Label *group_new_name_error;
VBoxContainer *group_options;
Tree *groups;
SpinBox *group_shrink;
CheckButton *group_atlas;
OptionButton *group_image_action;
Button *group_add;
Tree *group_images;
LineEdit *group_images_filter;
Button *atlas_preview;
void _patch_button_pressed(Object* p_item,int p_column,int p_id);
void _patch_edited();
AcceptDialog *atlas_preview_dialog;
TextureRect *atlas_preview_frame;
VBoxContainer *script_vbox;
OptionButton *script_mode;
LineEdit *script_key;
VBoxContainer *sample_vbox;
OptionButton *sample_mode;
SpinBox *sample_max_hz;
CheckButton *sample_trim;
ConfirmationDialog* keystore_create_dialog;
EditorFileDialog* keystore_file_dialog;
void _export_mode_changed(int p_idx);
void _prop_edited(String what);
void _update_platform();
void _update_exporter();
void _platform_selected();
void _filters_edited(String what);
void _filters_exclude_edited(String what);
void _update_group_tree();
void _image_filter_changed(String);
bool _update_group_treef(TreeItem *p_parent,EditorFileSystemDirectory *p_dir,const Set<String>& p_extensions,const String& p_groups,const Map<StringName,int>& p_group_index);
void _group_item_edited();
void _group_atlas_preview();
void _quality_edited(float what);
void _image_export_edited(int what);
void _shrink_edited(float what);
void _sample_convert_edited(int what);
void _update_group_list();
void _select_group(const String& p_by_name);
String _get_selected_group();
void _update_group();
void _group_changed(Variant v);
void _group_selected();
void _group_add();
void _group_select_all();
void _group_select_none();
void _group_del(Object *item,int p_column, int p_button);
bool updating_script;
void _update_script();
void _script_edited(Variant v);
void _export_action(const String& p_file);
void _export_action_pck(const String& p_file);
void ok_pressed();
void custom_action(const String&);
LineEdit* _create_keystore_input(Control* container, const String& p_label, const String& name);
void _create_android_keystore_window();
void _create_android_keystore();
bool _check_android_setting(const Ref<EditorExportPlatform>& exporter);
void _check_keystore_path(const String& path);
void _keystore_dir_selected(const String& path);
void _keystore_created();
void _save_export_cfg();
void _format_toggled();
Variant get_drag_data_fw(const Point2& p_point,Control* p_from);
bool can_drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from) const;
void drop_data_fw(const Point2& p_point,const Variant& p_data,Control* p_from);
protected:
@ -212,35 +123,14 @@ protected:
static void _bind_methods();
public:
String get_selected_path() const;
Error export_platform(const String& p_platform, const String& p_path, bool p_debug,const String& p_password,bool p_quit_after=false);
void popup_export();
ProjectExportDialog(EditorNode *p_editor);
ProjectExportDialog();
~ProjectExportDialog();
};
class EditorData;
class ProjectExport : public ConfirmationDialog {
GDCLASS( ProjectExport, ConfirmationDialog );
EditorData *editor_data;
AcceptDialog *error;
Label *label;
OptionButton *export_preset;
public:
Error export_project(const String& p_preset);
void popup_export();
ProjectExport(EditorData* p_data);
};
#endif // PROJECT_EXPORT_SETTINGS_H
#endif

View file

@ -38,7 +38,7 @@
#include "pair.h"
#include "scene/scene_string_names.h"
#include "editor_settings.h"
#include "editor_import_export.h"
#include "editor_export.h"
#include "editor_node.h"
#include "multi_node_edit.h"
#include "array_property_edit.h"