summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/light.cpp2
-rw-r--r--scene/3d/portal.cpp2
-rw-r--r--scene/3d/room_instance.cpp2
-rw-r--r--scene/3d/skeleton.cpp2
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--scene/gui/item_list.cpp6
-rw-r--r--scene/gui/label.cpp2
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/tree.cpp44
-rw-r--r--scene/gui/tree.h9
-rw-r--r--scene/io/resource_format_image.cpp4
-rwxr-xr-xscene/main/node.cpp8
-rw-r--r--scene/main/node.h2
-rw-r--r--scene/main/scene_tree.cpp16
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/register_scene_types.cpp8
-rw-r--r--scene/resources/audio_stream_resampled.cpp2
-rw-r--r--scene/resources/environment.cpp2
-rw-r--r--scene/resources/packed_scene.cpp2
-rw-r--r--scene/resources/scene_format_text.cpp26
-rw-r--r--scene/resources/style_box.cpp2
-rw-r--r--scene/resources/world_2d.cpp2
-rw-r--r--scene/resources/world_2d.h2
23 files changed, 87 insertions, 64 deletions
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 9c87acec6e..977f1f81a7 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "light.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
bool Light::_can_gizmo_scale() const {
diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp
index 64a9dc14ab..d77dde1dd8 100644
--- a/scene/3d/portal.cpp
+++ b/scene/3d/portal.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "portal.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
#include "servers/visual_server.h"
diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp
index 85713cf43a..7827768c09 100644
--- a/scene/3d/room_instance.cpp
+++ b/scene/3d/room_instance.cpp
@@ -32,7 +32,7 @@
#include "servers/visual_server.h"
#include "geometry.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/resources/surface_tool.h"
void Room::_notification(int p_what) {
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index d498947a41..71af77c027 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -31,7 +31,7 @@
#include "message_queue.h"
-#include "core/global_config.h"
+#include "core/project_settings.h"
#include "scene/resources/surface_tool.h"
bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 819ac633a7..ee908428d9 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "control.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/viewport.h"
#include "servers/visual_server.h"
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 2c6db7d0bf..eff9d801b6 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "item_list.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/os.h"
void ItemList::add_item(const String &p_item, const Ref<Texture> &p_texture, bool p_selectable) {
@@ -534,7 +534,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current - 1; i >= 0; i--) {
@@ -569,7 +569,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current + 1; i < items.size(); i++) {
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index f02e01d85a..159d81eb09 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "label.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "print_string.h"
#include "translation.h"
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index ffa23ce771..c32dafc809 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -33,7 +33,7 @@
#include "os/keyboard.h"
#include "os/os.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "message_queue.h"
#include "scene/main/viewport.h"
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 44f71a2c4e..8527ead01f 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "tree.h"
-#include "global_config.h"
#include "os/input.h"
#include "os/keyboard.h"
#include "os/os.h"
#include "print_string.h"
+#include "project_settings.h"
#include "scene/main/viewport.h"
void TreeItem::move_to_top() {
@@ -70,7 +70,7 @@ Size2 TreeItem::Cell::get_icon_size() const {
return icon_region.size;
}
-void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size) const {
+void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size, const Color &p_color) const {
if (icon.is_null())
return;
@@ -79,10 +79,10 @@ void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Si
if (icon_region == Rect2i()) {
- icon->draw_rect_region(p_where, Rect2(p_pos, dsize), Rect2(Point2(), icon->get_size()));
+ icon->draw_rect_region(p_where, Rect2(p_pos, dsize), Rect2(Point2(), icon->get_size()), p_color);
} else {
- icon->draw_rect_region(p_where, Rect2(p_pos, dsize), icon_region);
+ icon->draw_rect_region(p_where, Rect2(p_pos, dsize), icon_region, p_color);
}
}
@@ -203,6 +203,19 @@ Rect2 TreeItem::get_icon_region(int p_column) const {
return cells[p_column].icon_region;
}
+void TreeItem::set_icon_color(int p_column, const Color &p_icon_color) {
+
+ ERR_FAIL_INDEX(p_column, cells.size());
+ cells[p_column].icon_color = p_icon_color;
+ _changed_notify(p_column);
+}
+
+Color TreeItem::get_icon_color(int p_column) const {
+
+ ERR_FAIL_INDEX_V(p_column, cells.size(), Color());
+ return cells[p_column].icon_color;
+}
+
void TreeItem::set_icon_max_width(int p_column, int p_max) {
ERR_FAIL_INDEX(p_column, cells.size());
@@ -933,7 +946,7 @@ int Tree::get_item_height(TreeItem *p_item) const {
return height;
}
-void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color) {
+void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color) {
Rect2i rect = p_rect;
Ref<Font> font = cache.font;
@@ -972,7 +985,7 @@ void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, co
bmsize.width = p_cell.icon_max_w;
}
- p_cell.draw_icon(ci, rect.position + Size2i(0, Math::floor((real_t)(rect.size.y - bmsize.y) / 2)), bmsize);
+ p_cell.draw_icon(ci, rect.position + Size2i(0, Math::floor((real_t)(rect.size.y - bmsize.y) / 2)), bmsize, p_icon_color);
rect.position.x += bmsize.x + cache.hseparation;
rect.size.x -= bmsize.x + cache.hseparation;
}
@@ -1176,6 +1189,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
Color col = p_item->cells[i].custom_color ? p_item->cells[i].color : get_color(p_item->cells[i].selected ? "font_color_selected" : "font_color");
+ Color icon_col = p_item->cells[i].icon_color;
Point2i text_pos = item_rect.position;
text_pos.y += Math::floor((item_rect.size.y - font->get_height()) / 2) + font_ascent;
@@ -1184,7 +1198,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
case TreeItem::CELL_MODE_STRING: {
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
} break;
case TreeItem::CELL_MODE_CHECK: {
@@ -1195,9 +1209,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (p_item->cells[i].checked) {
- checked->draw(ci, check_ofs);
+ checked->draw(ci, check_ofs, icon_col);
} else {
- unchecked->draw(ci, check_ofs);
+ unchecked->draw(ci, check_ofs, icon_col);
}
int check_w = checked->get_width() + cache.hseparation;
@@ -1207,7 +1221,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
item_rect.size.x -= check_w;
item_rect.position.x += check_w;
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
//font->draw( ci, text_pos, p_item->cells[i].text, col,item_rect.size.x-check_w );
@@ -1237,7 +1251,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
arrow_pos.x += item_rect.size.x - downarrow->get_width();
arrow_pos.y += Math::floor(((item_rect.size.y - downarrow->get_height())) / 2.0);
- downarrow->draw(ci, arrow_pos);
+ downarrow->draw(ci, arrow_pos, icon_col);
} else {
Ref<Texture> updown = cache.updown;
@@ -1257,7 +1271,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
updown_pos.x += item_rect.size.x - updown->get_width();
updown_pos.y += Math::floor(((item_rect.size.y - updown->get_height())) / 2.0);
- updown->draw(ci, updown_pos);
+ updown->draw(ci, updown_pos, icon_col);
}
} break;
@@ -1274,7 +1288,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
Point2i icon_ofs = (item_rect.size - icon_size) / 2;
icon_ofs += item_rect.position;
- draw_texture_rect(p_item->cells[i].icon, Rect2(icon_ofs, icon_size));
+ draw_texture_rect(p_item->cells[i].icon, Rect2(icon_ofs, icon_size), false, icon_col);
//p_item->cells[i].icon->draw(ci, icon_ofs);
} break;
@@ -1291,7 +1305,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
if (!p_item->cells[i].editable) {
- draw_item_rect(p_item->cells[i], item_rect, col);
+ draw_item_rect(p_item->cells[i], item_rect, col, icon_col);
break;
}
@@ -1319,7 +1333,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
ir.position += cache.custom_button->get_offset();
}
- draw_item_rect(p_item->cells[i], ir, col);
+ draw_item_rect(p_item->cells[i], ir, col, icon_col);
downarrow->draw(ci, arrow_pos);
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 59e35bb230..694f91f9a6 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -89,6 +89,7 @@ private:
Color bg_color;
bool custom_button;
bool expand_right;
+ Color icon_color;
TextAlign text_align;
@@ -133,10 +134,11 @@ private:
icon_max_w = 0;
text_align = ALIGN_LEFT;
expand_right = false;
+ icon_color = Color(1, 1, 1);
}
Size2 get_icon_size() const;
- void draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size = Size2()) const;
+ void draw_icon(const RID &p_where, const Point2 &p_pos, const Size2 &p_size = Size2(), const Color &p_color = Color()) const;
};
Vector<Cell> cells;
@@ -193,6 +195,9 @@ public:
void set_icon_region(int p_column, const Rect2 &p_icon_region);
Rect2 get_icon_region(int p_column) const;
+ void set_icon_color(int p_column, const Color &p_icon_color);
+ Color get_icon_color(int p_column) const;
+
void set_icon_max_width(int p_column, int p_max);
int get_icon_max_width(int p_column) const;
@@ -361,7 +366,7 @@ private:
int compute_item_height(TreeItem *p_item) const;
int get_item_height(TreeItem *p_item) const;
//void draw_item_text(String p_text,const Ref<Texture>& p_icon,int p_icon_max_w,bool p_tool,Rect2i p_rect,const Color& p_color);
- void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color);
+ void draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_color, const Color &p_icon_color);
int draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2 &p_draw_size, TreeItem *p_item);
void select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_col, TreeItem *p_prev = NULL, bool *r_in_range = NULL, bool p_force_deselect = false);
int propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool p_doubleclick, TreeItem *p_item, int p_button, const Ref<InputEventWithModifiers> &p_mod);
diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp
index 6c0a6128d2..8b3f939f1a 100644
--- a/scene/io/resource_format_image.cpp
+++ b/scene/io/resource_format_image.cpp
@@ -30,7 +30,7 @@
#include "resource_format_image.h"
#if 0
-#include "global_config.h"
+#include "project_settings.h"
#include "io/image_loader.h"
#include "os/os.h"
#include "scene/resources/texture.h"
@@ -128,7 +128,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_origin
if (max_texture_size && (image.get_width() > max_texture_size || image.get_height() > max_texture_size)) {
- if (bool(GlobalConfig::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) {
+ if (bool(ProjectSettings::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) {
OS::get_singleton()->alert("Texture is too large: '"+p_path+"', at "+itos(image.get_width())+"x"+itos(image.get_height())+". Max allowed size is: "+itos(max_texture_size)+"x"+itos(max_texture_size)+".","BAD ARTIST, NO COOKIE!");
}
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index c5d466eed1..26d1deadf9 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1258,7 +1258,7 @@ String Node::_generate_serial_child_name(Node *p_child) {
name = p_child->get_class();
// Adjust casing according to project setting. The current type name is expected to be in PascalCase.
- switch (GlobalConfig::get_singleton()->get("node/name_casing").operator int()) {
+ switch (ProjectSettings::get_singleton()->get("node/name_casing").operator int()) {
case NAME_CASING_PASCAL_CASE:
break;
case NAME_CASING_CAMEL_CASE:
@@ -2712,9 +2712,9 @@ void Node::request_ready() {
void Node::_bind_methods() {
GLOBAL_DEF("node/name_num_separator", 0);
- GlobalConfig::get_singleton()->set_custom_property_info("node/name_num_separator", PropertyInfo(Variant::INT, "node/name_num_separator", PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"));
+ ProjectSettings::get_singleton()->set_custom_property_info("node/name_num_separator", PropertyInfo(Variant::INT, "node/name_num_separator", PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash"));
GLOBAL_DEF("node/name_casing", NAME_CASING_PASCAL_CASE);
- GlobalConfig::get_singleton()->set_custom_property_info("node/name_casing", PropertyInfo(Variant::INT, "node/name_casing", PROPERTY_HINT_ENUM, "PascalCase,camelCase,snake_case"));
+ ProjectSettings::get_singleton()->set_custom_property_info("node/name_casing", PropertyInfo(Variant::INT, "node/name_casing", PROPERTY_HINT_ENUM, "PascalCase,camelCase,snake_case"));
ClassDB::bind_method(D_METHOD("_add_child_below_node", "node:Node", "child_node:Node", "legible_unique_name"), &Node::add_child_below_node, DEFVAL(false));
@@ -2890,7 +2890,7 @@ void Node::_bind_methods() {
}
String Node::_get_name_num_separator() {
- switch (GlobalConfig::get_singleton()->get("node/name_num_separator").operator int()) {
+ switch (ProjectSettings::get_singleton()->get("node/name_num_separator").operator int()) {
case 0: return "";
case 1: return " ";
case 2: return "_";
diff --git a/scene/main/node.h b/scene/main/node.h
index 7baa65c022..cfd5c07921 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -31,7 +31,7 @@
#define NODE_H
#include "class_db.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "map.h"
#include "object.h"
#include "path_db.h"
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 65c7c1a36f..c5278b8595 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -29,12 +29,12 @@
/*************************************************************************/
#include "scene_tree.h"
-#include "global_config.h"
#include "message_queue.h"
#include "node.h"
#include "os/keyboard.h"
#include "os/os.h"
#include "print_string.h"
+#include "project_settings.h"
#include <stdio.h>
//#include "servers/spatial_sound_2d_server.h"
@@ -614,7 +614,7 @@ bool SceneTree::idle(float p_time) {
if (is_editor_hint()) {
//simple hack to reload fallback environment if it changed from editor
- String env_path = GlobalConfig::get_singleton()->get("rendering/environment/default_environment");
+ String env_path = ProjectSettings::get_singleton()->get("rendering/environment/default_environment");
env_path = env_path.strip_edges(); //user may have added a space or two
String cpath;
Ref<Environment> fallback = get_root()->get_world()->get_fallback_environment();
@@ -2351,9 +2351,13 @@ SceneTree::SceneTree() {
int ref_atlas_size = GLOBAL_DEF("rendering/quality/reflections/atlas_size", 2048);
int ref_atlas_subdiv = GLOBAL_DEF("rendering/quality/reflections/atlas_subdiv", 8);
int msaa_mode = GLOBAL_DEF("rendering/quality/filters/msaa", 0);
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"));
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"));
root->set_msaa(Viewport::MSAA(msaa_mode));
- bool hdr = GLOBAL_DEF("rendering/quality/depth/hdr", true);
+
+ GLOBAL_DEF("rendering/quality/depth/hdr", true);
+ GLOBAL_DEF("rendering/quality/depth/hdr.mobile", false);
+
+ bool hdr = GLOBAL_GET("rendering/quality/depth/hdr");
root->set_hdr(hdr);
VS::get_singleton()->scenario_set_reflection_atlas_size(root->get_world()->get_scenario(), ref_atlas_size, ref_atlas_subdiv);
@@ -2371,7 +2375,7 @@ SceneTree::SceneTree() {
//get path
String env_path = GLOBAL_DEF("rendering/environment/default_environment", "");
//setup property
- GlobalConfig::get_singleton()->set_custom_property_info("rendering/environment/default_environment", PropertyInfo(Variant::STRING, "rendering/viewport/default_environment", PROPERTY_HINT_FILE, ext_hint));
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/environment/default_environment", PropertyInfo(Variant::STRING, "rendering/viewport/default_environment", PROPERTY_HINT_FILE, ext_hint));
env_path = env_path.strip_edges();
if (env_path != String()) {
Ref<Environment> env = ResourceLoader::load(env_path);
@@ -2380,7 +2384,7 @@ SceneTree::SceneTree() {
} else {
if (is_editor_hint()) {
//file was erased, clear the field.
- GlobalConfig::get_singleton()->set("rendering/environment/default_environment", "");
+ ProjectSettings::get_singleton()->set("rendering/environment/default_environment", "");
} else {
//file was erased, notify user.
ERR_PRINTS(RTR("Default Environment as specified in Project Setings (Rendering -> Viewport -> Default Environment) could not be loaded."));
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 824f968c49..ce7950285d 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -48,7 +48,7 @@
#include "scene/main/timer.h"
#include "scene/scene_string_names.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/3d/scenario_fx.h"
void ViewportTexture::setup_local_to_scene() {
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index c6d26f4d4c..74c556931c 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "register_scene_types.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/os.h"
#include "scene/io/resource_format_image.h"
#include "scene/io/resource_format_wav.h"
@@ -271,11 +271,11 @@ void register_scene_types() {
ResourceLoader::add_resource_format_loader(resource_loader_theme);
bool default_theme_hidpi = GLOBAL_DEF("gui/theme/use_hidpi", false);
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/use_hidpi", PropertyInfo(Variant::BOOL, "gui/theme/use_hidpi", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/use_hidpi", PropertyInfo(Variant::BOOL, "gui/theme/use_hidpi", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
String theme_path = GLOBAL_DEF("gui/theme/custom", "");
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
String font_path = GLOBAL_DEF("gui/theme/custom_font", "");
- GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
+ ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED));
if (theme_path != String()) {
Ref<Theme> theme = ResourceLoader::load(theme_path);
diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp
index 213ac4400b..1b1d6f8587 100644
--- a/scene/resources/audio_stream_resampled.cpp
+++ b/scene/resources/audio_stream_resampled.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "audio_stream_resampled.h"
-#include "global_config.h"
+#include "project_settings.h"
#if 0
int AudioStreamResampled::get_channel_count() const {
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 867283d3a8..ae89d8ed94 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "environment.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "servers/visual_server.h"
#include "texture.h"
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 1afaed2284..01a8342fed 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "packed_scene.h"
#include "core/core_string_names.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "io/resource_loader.h"
#include "scene/2d/node_2d.h"
#include "scene/3d/spatial.h"
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index 8ad2970005..585579aad5 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "scene_format_text.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "os/dir_access.h"
#include "version.h"
@@ -110,7 +110,7 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream *
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path));
}
r_res = ResourceLoader::load(path, type);
@@ -165,7 +165,7 @@ Error ResourceInteractiveLoaderText::poll() {
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
}
if (remaps.has(path)) {
@@ -648,7 +648,7 @@ void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f, List<String>
if (path.find("://") == -1 && path.is_rel_path()) {
// path is relative to file being loaded, so convert to a resource path
- path = GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
+ path = ProjectSettings::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path));
}
if (p_add_types) {
@@ -905,9 +905,9 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
ria->open(f);
return ria;
@@ -953,9 +953,9 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const {
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
String r = ria->recognize(f);
return r;
}
@@ -969,9 +969,9 @@ void ResourceFormatLoaderText::get_dependencies(const String &p_path, List<Strin
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
ria->get_dependencies(f, p_dependencies, p_add_types);
}
@@ -984,9 +984,9 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path, const
}
Ref<ResourceInteractiveLoaderText> ria = memnew(ResourceInteractiveLoaderText);
- ria->local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ ria->local_path = ProjectSettings::get_singleton()->localize_path(p_path);
ria->res_path = ria->local_path;
- //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( ProjectSettings::get_singleton()->localize_path(p_path) );
return ria->rename_dependencies(f, p_path, p_map);
}
@@ -1118,7 +1118,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
ERR_FAIL_COND_V(err, ERR_CANT_OPEN);
FileAccessRef _fref(f);
- local_path = GlobalConfig::get_singleton()->localize_path(p_path);
+ local_path = ProjectSettings::get_singleton()->localize_path(p_path);
relative_paths = p_flags & ResourceSaver::FLAG_RELATIVE_PATHS;
skip_editor = p_flags & ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES;
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index f108809c83..e0a9de6062 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -482,7 +482,7 @@ void StyleBoxLine::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "color"), "set_color", "get_color");
ADD_PROPERTY(PropertyInfo(Variant::INT, "thickness", PROPERTY_HINT_RANGE, "0,10"), "set_thickness", "get_thickness");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "get_vertical");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "is_vertical");
}
float StyleBoxLine::get_style_margin(Margin p_margin) const {
return thickness;
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index 9ec89e4003..056c49f1ae 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -31,7 +31,7 @@
#include "servers/physics_2d_server.h"
#include "servers/visual_server.h"
//#include "servers/spatial_sound_2d_server.h"
-#include "global_config.h"
+#include "project_settings.h"
#include "scene/2d/camera_2d.h"
#include "scene/2d/visibility_notifier_2d.h"
#include "scene/main/viewport.h"
diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h
index 35c8ce390f..f968b08a15 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -30,7 +30,7 @@
#ifndef WORLD_2D_H
#define WORLD_2D_H
-#include "global_config.h"
+#include "project_settings.h"
#include "resource.h"
#include "servers/physics_2d_server.h"