summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/global_constants.cpp1
-rw-r--r--core/os/keyboard.cpp2
-rw-r--r--core/os/keyboard.h1
-rw-r--r--core/os/os.h6
-rw-r--r--core/project_settings.cpp50
-rw-r--r--core/project_settings.h2
6 files changed, 37 insertions, 25 deletions
diff --git a/core/global_constants.cpp b/core/global_constants.cpp
index 4f535fb05e..18071d7748 100644
--- a/core/global_constants.cpp
+++ b/core/global_constants.cpp
@@ -106,7 +106,6 @@ static _GlobalConstant _global_constants[] = {
BIND_GLOBAL_CONSTANT(KEY_F14),
BIND_GLOBAL_CONSTANT(KEY_F15),
BIND_GLOBAL_CONSTANT(KEY_F16),
- BIND_GLOBAL_CONSTANT(KEY_KP_ENTER),
BIND_GLOBAL_CONSTANT(KEY_KP_MULTIPLY),
BIND_GLOBAL_CONSTANT(KEY_KP_DIVIDE),
BIND_GLOBAL_CONSTANT(KEY_KP_SUBTRACT),
diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp
index 2f5dc03614..e154b1934d 100644
--- a/core/os/keyboard.cpp
+++ b/core/os/keyboard.cpp
@@ -81,7 +81,6 @@ static const _KeyCodeText _keycodes[] = {
{KEY_F14 ,"F14"},
{KEY_F15 ,"F15"},
{KEY_F16 ,"F16"},
- {KEY_KP_ENTER ,"Kp Enter"},
{KEY_KP_MULTIPLY ,"Kp Multiply"},
{KEY_KP_DIVIDE ,"Kp Divide"},
{KEY_KP_SUBTRACT ,"Kp Subtract"},
@@ -334,7 +333,6 @@ bool keycode_has_unicode(uint32_t p_keycode) {
case KEY_F14:
case KEY_F15:
case KEY_F16:
- case KEY_KP_ENTER:
case KEY_SUPER_L:
case KEY_SUPER_R:
case KEY_MENU:
diff --git a/core/os/keyboard.h b/core/os/keyboard.h
index 0a72663867..c6985c887d 100644
--- a/core/os/keyboard.h
+++ b/core/os/keyboard.h
@@ -96,7 +96,6 @@ enum KeyList {
KEY_F14 = SPKEY | 0x29,
KEY_F15 = SPKEY | 0x2A,
KEY_F16 = SPKEY | 0x2B,
- KEY_KP_ENTER = SPKEY | 0x80,
KEY_KP_MULTIPLY = SPKEY | 0x81,
KEY_KP_DIVIDE = SPKEY | 0x82,
KEY_KP_SUBTRACT = SPKEY | 0x83,
diff --git a/core/os/os.h b/core/os/os.h
index 957c1d0ba7..703c6a6bcd 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -184,9 +184,9 @@ public:
virtual void set_ime_position(const Point2 &p_pos) {}
- virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; };
- virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; };
- virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) { return ERR_UNAVAILABLE; };
+ virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; }
+ virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }
+ virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false) { return ERR_UNAVAILABLE; }
virtual void set_keep_screen_on(bool p_enabled);
virtual bool is_keep_screen_on() const;
diff --git a/core/project_settings.cpp b/core/project_settings.cpp
index 0426af3fa0..b31f78ec20 100644
--- a/core/project_settings.cpp
+++ b/core/project_settings.cpp
@@ -455,8 +455,10 @@ Error ProjectSettings::_load_settings(const String p_path) {
memdelete(f);
ERR_FAIL_COND_V(config_version > FORMAT_VERSION, ERR_FILE_CANT_OPEN);
}
+ } else {
+ // config_version is checked and dropped
+ set(section + "/" + assign, value);
}
- set(section + "/" + assign, value);
} else if (next_tag.name != String()) {
section = next_tag.name;
}
@@ -600,6 +602,15 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin
ERR_FAIL_COND_V(err, err)
}
+ file->store_line("; Engine configuration file.");
+ file->store_line("; It's best edited using the editor UI and not directly,");
+ file->store_line("; since the parameters that go here are not all obvious.");
+ file->store_line("; ");
+ file->store_line("; Format: ");
+ file->store_line("; [section] ; section goes between []");
+ file->store_line("; param=value ; assign values to parameters");
+ file->store_line("");
+
file->store_string("config_version=" + itos(FORMAT_VERSION) + "\n");
if (p_custom_features != String())
file->store_string("custom_features=\"" + p_custom_features + "\"\n");
@@ -640,38 +651,43 @@ Error ProjectSettings::_save_custom_bnd(const String &p_file) { // add other par
return save_custom(p_file);
};
-Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_custom, const Vector<String> &p_custom_features) {
+Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_custom, const Vector<String> &p_custom_features, bool p_merge_with_current) {
ERR_FAIL_COND_V(p_path == "", ERR_INVALID_PARAMETER);
Set<_VCSort> vclist;
- for (Map<StringName, VariantContainer>::Element *G = props.front(); G; G = G->next()) {
+ if (p_merge_with_current) {
+ for (Map<StringName, VariantContainer>::Element *G = props.front(); G; G = G->next()) {
- const VariantContainer *v = &G->get();
+ const VariantContainer *v = &G->get();
- if (v->hide_from_editor)
- continue;
+ if (v->hide_from_editor)
+ continue;
- if (p_custom.has(G->key()))
- continue;
+ if (p_custom.has(G->key()))
+ continue;
- _VCSort vc;
- vc.name = G->key(); //*k;
- vc.order = v->order;
- vc.type = v->variant.get_type();
- vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
- if (v->variant == v->initial)
- continue;
+ _VCSort vc;
+ vc.name = G->key(); //*k;
+ vc.order = v->order;
+ vc.type = v->variant.get_type();
+ vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
+ if (v->variant == v->initial)
+ continue;
- vclist.insert(vc);
+ vclist.insert(vc);
+ }
}
for (const Map<String, Variant>::Element *E = p_custom.front(); E; E = E->next()) {
+ // Lookup global prop to store in the same order
+ Map<StringName, VariantContainer>::Element *global_prop = props.find(E->key());
+
_VCSort vc;
vc.name = E->key();
- vc.order = 0xFFFFFFF;
+ vc.order = global_prop ? global_prop->get().order : 0xFFFFFFF;
vc.type = E->get().get_type();
vc.flags = PROPERTY_USAGE_STORAGE;
vclist.insert(vc);
diff --git a/core/project_settings.h b/core/project_settings.h
index 278d4b8132..c58ac3ca49 100644
--- a/core/project_settings.h
+++ b/core/project_settings.h
@@ -138,7 +138,7 @@ public:
Error setup(const String &p_path, const String &p_main_pack);
- Error save_custom(const String &p_path = "", const CustomMap &p_custom = CustomMap(), const Vector<String> &p_custom_features = Vector<String>());
+ Error save_custom(const String &p_path = "", const CustomMap &p_custom = CustomMap(), const Vector<String> &p_custom_features = Vector<String>(), bool p_merge_with_current = true);
Error save();
void set_custom_property_info(const String &p_prop, const PropertyInfo &p_info);