summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-05 10:16:52 +0200
committerGitHub <noreply@github.com>2017-07-05 10:16:52 +0200
commit444354b51f8f9a3be9805d137f890302c02de0db (patch)
tree278af1a9bfed12d6b40ed803f5a86787479999b3 /editor
parent9e460020de66932f7fe4b62560a718b190ecb062 (diff)
parent272cfdc0c8eedd58f8cd422b4b0573135e9a10de (diff)
Merge pull request #9498 from Noshyaar/pr-license
About: Add License info
Diffstat (limited to 'editor')
-rw-r--r--editor/SCsub22
-rw-r--r--editor/editor_node.cpp10
2 files changed, 32 insertions, 0 deletions
diff --git a/editor/SCsub b/editor/SCsub
index a26f6bba77..47bdec2e0d 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -185,6 +185,24 @@ def make_authors_header(target, source, env):
g.write("#endif\n")
+def make_license_header(target, source, env):
+
+ src = source[0].srcnode().abspath
+ dst = target[0].srcnode().abspath
+ f = open(src, "rb")
+ g = open(dst, "wb")
+
+ g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
+ g.write("#ifndef _EDITOR_LICENSE_H\n")
+ g.write("#define _EDITOR_LICENSE_H\n")
+ g.write("static const char *about_license =")
+
+ for line in f:
+ g.write("\n\t\"" + line.strip().replace("\"", "\\\"") + "\\n\"")
+
+ g.write(";\n")
+ g.write("#endif\n")
+
if (env["tools"] == "yes"):
# Register exporters
@@ -235,6 +253,10 @@ if (env["tools"] == "yes"):
env.Depends('#editor/authors.gen.h', "../AUTHORS.md")
env.Command('#editor/authors.gen.h', "../AUTHORS.md", make_authors_header)
+ # License
+ env.Depends('#editor/license.gen.h', "../LICENSE.txt")
+ env.Command('#editor/license.gen.h', "../LICENSE.txt", make_license_header)
+
env.add_source_files(env.editor_sources, "*.cpp")
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 4525c8f8e5..c52a133e78 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -43,6 +43,7 @@
#include "io/config_file.h"
#include "io/stream_peer_ssl.h"
#include "io/zip_io.h"
+#include "license.gen.h"
#include "main/input_default.h"
#include "message_queue.h"
#include "os/file_access.h"
@@ -6109,6 +6110,15 @@ EditorNode::EditorNode() {
dev_base->set_v_size_flags(Control::SIZE_EXPAND);
tc->add_child(dev_base);
+ TextEdit *license = memnew(TextEdit);
+ license->set_name(TTR("License"));
+ license->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ license->set_v_size_flags(Control::SIZE_EXPAND_FILL);
+ license->set_wrap(true);
+ license->set_readonly(true);
+ license->set_text(String::utf8(about_license));
+ tc->add_child(license);
+
VBoxContainer *dev_vbc = memnew(VBoxContainer);
dev_vbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
dev_base->add_child(dev_vbc);