Browse Source

Merge pull request #59191 from timothyqiu/keynote

Rémi Verschelde 3 years ago
parent
commit
9ddeeb8b1a
2 changed files with 17 additions and 0 deletions
  1. 15 0
      editor/project_export.cpp
  2. 2 0
      editor/project_export.h

+ 15 - 0
editor/project_export.cpp

@@ -38,6 +38,7 @@
 #include "core/os/file_access.h"
 #include "core/os/file_access.h"
 #include "core/os/os.h"
 #include "core/os/os.h"
 #include "core/project_settings.h"
 #include "core/project_settings.h"
+#include "core/version_generated.gen.h"
 #include "editor_data.h"
 #include "editor_data.h"
 #include "editor_node.h"
 #include "editor_node.h"
 #include "editor_scale.h"
 #include "editor_scale.h"
@@ -428,6 +429,10 @@ void ProjectExportDialog::_export_path_changed(const StringName &p_property, con
 	_update_presets();
 	_update_presets();
 }
 }
 
 
+void ProjectExportDialog::_open_key_help_link() {
+	OS::get_singleton()->shell_open(vformat("%s/development/compiling/compiling_with_script_encryption_key.html", VERSION_DOCS_URL));
+}
+
 void ProjectExportDialog::_script_export_mode_changed(int p_mode) {
 void ProjectExportDialog::_script_export_mode_changed(int p_mode) {
 	if (updating) {
 	if (updating) {
 		return;
 		return;
@@ -937,6 +942,7 @@ void ProjectExportDialog::_bind_methods() {
 	ClassDB::bind_method("_open_export_template_manager", &ProjectExportDialog::_open_export_template_manager);
 	ClassDB::bind_method("_open_export_template_manager", &ProjectExportDialog::_open_export_template_manager);
 	ClassDB::bind_method("_validate_export_path", &ProjectExportDialog::_validate_export_path);
 	ClassDB::bind_method("_validate_export_path", &ProjectExportDialog::_validate_export_path);
 	ClassDB::bind_method("_export_path_changed", &ProjectExportDialog::_export_path_changed);
 	ClassDB::bind_method("_export_path_changed", &ProjectExportDialog::_export_path_changed);
+	ClassDB::bind_method("_open_key_help_link", &ProjectExportDialog::_open_key_help_link);
 	ClassDB::bind_method("_script_export_mode_changed", &ProjectExportDialog::_script_export_mode_changed);
 	ClassDB::bind_method("_script_export_mode_changed", &ProjectExportDialog::_script_export_mode_changed);
 	ClassDB::bind_method("_script_encryption_key_changed", &ProjectExportDialog::_script_encryption_key_changed);
 	ClassDB::bind_method("_script_encryption_key_changed", &ProjectExportDialog::_script_encryption_key_changed);
 	ClassDB::bind_method("_export_project", &ProjectExportDialog::_export_project);
 	ClassDB::bind_method("_export_project", &ProjectExportDialog::_export_project);
@@ -1101,6 +1107,15 @@ ProjectExportDialog::ProjectExportDialog() {
 	script_vb->add_child(script_key_error);
 	script_vb->add_child(script_key_error);
 	sections->add_child(script_vb);
 	sections->add_child(script_vb);
 
 
+	Label *sec_info = memnew(Label);
+	sec_info->set_text(TTR("Note: Encryption key needs to be stored in the binary,\nyou need to build the export templates from source."));
+	script_vb->add_child(sec_info);
+
+	LinkButton *sec_more_info = memnew(LinkButton);
+	sec_more_info->set_text(TTR("More Info..."));
+	sec_more_info->connect("pressed", this, "_open_key_help_link");
+	script_vb->add_child(sec_more_info);
+
 	sections->connect("tab_changed", this, "_tab_changed");
 	sections->connect("tab_changed", this, "_tab_changed");
 
 
 	// Disable by default.
 	// Disable by default.

+ 2 - 0
editor/project_export.h

@@ -156,6 +156,8 @@ private:
 	void _script_encryption_key_changed(const String &p_key);
 	void _script_encryption_key_changed(const String &p_key);
 	bool _validate_script_encryption_key(const String &p_key);
 	bool _validate_script_encryption_key(const String &p_key);
 
 
+	void _open_key_help_link();
+
 	void _tab_changed(int);
 	void _tab_changed(int);
 
 
 protected:
 protected: