summaryrefslogtreecommitdiff
path: root/core/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/engine.cpp')
-rw-r--r--core/engine.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/core/engine.cpp b/core/engine.cpp
index b2c34a853c..7c8024b946 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -30,6 +30,9 @@
#include "engine.h"
+#include "authors.gen.h"
+#include "donors.gen.h"
+#include "license.gen.h"
#include "version.h"
#include "version_hash.gen.h"
@@ -111,6 +114,78 @@ Dictionary Engine::get_version_info() const {
return dict;
}
+static Array array_from_info(const char *const *info_list) {
+ Array arr;
+ for (int i = 0; info_list[i] != NULL; i++) {
+ arr.push_back(info_list[i]);
+ }
+ return arr;
+}
+
+static Array array_from_info_count(const char *const *info_list, int info_count) {
+ Array arr;
+ for (int i = 0; i < info_count; i++) {
+ arr.push_back(info_list[i]);
+ }
+ return arr;
+}
+
+Dictionary Engine::get_author_info() const {
+ Dictionary dict;
+
+ dict["lead_developers"] = array_from_info(AUTHORS_LEAD_DEVELOPERS);
+ dict["project_managers"] = array_from_info(AUTHORS_PROJECT_MANAGERS);
+ dict["founders"] = array_from_info(AUTHORS_FOUNDERS);
+ dict["developers"] = array_from_info(AUTHORS_DEVELOPERS);
+
+ return dict;
+}
+
+Array Engine::get_copyright_info() const {
+ Array components;
+ for (int component_index = 0; component_index < COPYRIGHT_INFO_COUNT; component_index++) {
+ const ComponentCopyright &cp_info = COPYRIGHT_INFO[component_index];
+ Dictionary component_dict;
+ component_dict["name"] = cp_info.name;
+ Array parts;
+ for (int i = 0; i < cp_info.part_count; i++) {
+ const ComponentCopyrightPart &cp_part = cp_info.parts[i];
+ Dictionary part_dict;
+ part_dict["files"] = array_from_info_count(cp_part.files, cp_part.file_count);
+ part_dict["copyright"] = array_from_info_count(cp_part.copyright_statements, cp_part.copyright_count);
+ part_dict["license"] = cp_part.license;
+ parts.push_back(part_dict);
+ }
+ component_dict["parts"] = parts;
+
+ components.push_back(component_dict);
+ }
+ return components;
+}
+
+Dictionary Engine::get_donor_info() const {
+ Dictionary donors;
+ donors["platinum_sponsors"] = array_from_info(DONORS_SPONSOR_PLAT);
+ donors["gold_sponsors"] = array_from_info(DONORS_SPONSOR_GOLD);
+ donors["mini_sponsors"] = array_from_info(DONORS_SPONSOR_MINI);
+ donors["gold_donors"] = array_from_info(DONORS_GOLD);
+ donors["silver_donors"] = array_from_info(DONORS_SILVER);
+ donors["bronze_donors"] = array_from_info(DONORS_BRONZE);
+ return donors;
+}
+
+Dictionary Engine::get_license_info() const {
+ Dictionary licenses;
+ for (int i = 0; i < LICENSE_COUNT; i++) {
+ licenses[LICENSE_NAMES[i]] = LICENSE_BODIES[i];
+ }
+ return licenses;
+}
+
+String Engine::get_license_text() const {
+ return String(GODOT_LICENSE_TEXT);
+}
+
void Engine::add_singleton(const Singleton &p_singleton) {
singletons.push_back(p_singleton);