summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-02-21 21:30:20 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-02-21 21:30:40 -0300
commit2c88f4d4b54dd106a2a4611109ebe8896c44aa43 (patch)
tree73439b6df5026153da957cc58f0cc6668e5786c0
parentd0973e645cc82ef643153f920dba5ee2586f08cb (diff)
working on template validation
-rw-r--r--tools/editor/editor_export.cpp39
-rw-r--r--tools/editor/editor_export.h18
2 files changed, 48 insertions, 9 deletions
diff --git a/tools/editor/editor_export.cpp b/tools/editor/editor_export.cpp
index 9483fa84ac..074bc6e4e8 100644
--- a/tools/editor/editor_export.cpp
+++ b/tools/editor/editor_export.cpp
@@ -326,7 +326,7 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata,const String& p_path
String EditorExportPlatform::find_export_template(String template_file_name, String *err) const {
String user_file = EditorSettings::get_singleton()->get_settings_path()
- +"/templates/"+template_file_name;
+ +"/templates/"+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"."+_MKSTR(VERSION_STATUS)+"/"+template_file_name;
String system_file=OS::get_singleton()->get_installed_templates_path();
bool has_system_path=(system_file!="");
system_file+=template_file_name;
@@ -891,15 +891,27 @@ Ref<Texture> EditorExportPlatformPC::get_logo() const {
return logo;
}
-bool EditorExportPlatformPC::can_export(String *r_error) const {
- return true;
+bool EditorExportPlatformPC::can_export(const Ref<EditorExportPreset>& p_preset,String &r_error, bool &r_missing_templates) const {
+
+ r_missing_templates=false;
+
+ if (find_export_template(release_file_32)==String()) {
+ r_missing_templates=true;
+ } else if (find_export_template(debug_file_32)==String()) {
+ r_missing_templates=true;
+ } else if (find_export_template(release_file_64)==String()) {
+ r_missing_templates=true;
+ } else if (find_export_template(debug_file_64)==String()) {
+ r_missing_templates=true;
+ }
+ return !r_missing_templates;
}
String EditorExportPlatformPC::get_binary_extension() const {
return extension;
}
-Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset>& p_preset,const String& p_path,int p_flags) {
+Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset>& p_preset, bool p_debug, const String& p_path, int p_flags) {
return OK;
}
@@ -916,6 +928,25 @@ void EditorExportPlatformPC::set_logo(const Ref<Texture>& p_logo) {
logo=p_logo;
}
+void EditorExportPlatformPC::set_release_64(const String& p_file) {
+
+ release_file_64=p_file;
+}
+
+void EditorExportPlatformPC::set_release_32(const String& p_file){
+
+ release_file_32=p_file;
+}
+void EditorExportPlatformPC::set_debug_64(const String& p_file){
+
+ debug_file_64=p_file;
+}
+void EditorExportPlatformPC::set_debug_32(const String& p_file){
+
+ debug_file_32=p_file;
+
+}
+
EditorExportPlatformPC::EditorExportPlatformPC() {
}
diff --git a/tools/editor/editor_export.h b/tools/editor/editor_export.h
index d30ce9bd92..8a9dc965e5 100644
--- a/tools/editor/editor_export.h
+++ b/tools/editor/editor_export.h
@@ -203,10 +203,10 @@ public:
virtual Error run(int p_device,int p_debug_flags) { return OK; }
- virtual bool can_export(String *r_error=NULL) const=0;
+ virtual bool can_export(const Ref<EditorExportPreset>& p_preset,String &r_error,bool &r_missing_templates) const=0;
virtual String get_binary_extension() const=0;
- virtual Error export_project(const Ref<EditorExportPreset>& p_preset,const String& p_path,int p_flags=0)=0;
+ virtual Error export_project(const Ref<EditorExportPreset>& p_preset,bool p_debug,const String& p_path,int p_flags=0)=0;
EditorExportPlatform();
};
@@ -262,7 +262,10 @@ class EditorExportPlatformPC : public EditorExportPlatform {
String name;
String extension;
-
+ String release_file_32;
+ String release_file_64;
+ String debug_file_32;
+ String debug_file_64;
public:
@@ -273,15 +276,20 @@ public:
virtual String get_name() const;
virtual Ref<Texture> get_logo() const;
- virtual bool can_export(String *r_error=NULL) const;
+ virtual bool can_export(const Ref<EditorExportPreset>& p_preset,String &r_error,bool &r_missing_templates) const;
virtual String get_binary_extension() const;
- virtual Error export_project(const Ref<EditorExportPreset>& p_preset,const String& p_path,int p_flags=0);
+ virtual Error export_project(const Ref<EditorExportPreset>& p_preset,bool p_debug,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);
+ void set_release_64(const String& p_file);
+ void set_release_32(const String& p_file);
+ void set_debug_64(const String& p_file);
+ void set_debug_32(const String& p_file);
+
EditorExportPlatformPC();
};