summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.appveyor.yml15
-rw-r--r--doc/classes/Directory.xml1
-rw-r--r--editor/create_dialog.cpp16
-rw-r--r--editor/editor_feature_profile.cpp10
-rw-r--r--editor/filesystem_dock.cpp1
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp24
6 files changed, 32 insertions, 35 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index b04e7d9ce8..05e7094981 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,16 +1,16 @@
-os: Visual Studio 2015
+image: Visual Studio 2019
+
+platform: x64
environment:
HOME: "%HOMEDRIVE%%HOMEPATH%"
- PYTHON: C:\Python27
+ PYTHON: C:\Python38
SCONS_CACHE_ROOT: "%HOME%\\scons_cache"
SCONS_CACHE_LIMIT: 1024
matrix:
- - VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
- GD_PLATFORM: windows
+ - GD_PLATFORM: windows
TOOLS: yes
TARGET: release_debug
- ARCH: amd64
init:
- ps: if ($env:APPVEYOR_REPO_BRANCH -ne "master") { $env:APPVEYOR_CACHE_SKIP_SAVE = "true" }
@@ -20,15 +20,12 @@ cache:
install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- - pip install -U wheel # needed for pip install scons to work, otherwise a flag is missing
- - pip install scons==3.0.1
- - if defined VS call "%VS%" %ARCH% # if defined - so we can also use mingw
+ - pip install scons==3.1.2
before_build:
- echo %GD_PLATFORM%
- python --version
- scons --version
- - cl.exe
- set "SCONS_CACHE=%SCONS_CACHE_ROOT%\%APPVEYOR_REPO_BRANCH%"
build_script:
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml
index 754fafadbe..91256359fb 100644
--- a/doc/classes/Directory.xml
+++ b/doc/classes/Directory.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
Directory type. It is used to manage directories and their content (not restricted to the project folder).
+ When creating a new [Directory], its default opened directory will be [code]res://[/code]. This may change in the future, so it is advised to always use [method open] to initialize your [Directory] where you want to operate, with explicit error checking.
Here is an example on how to iterate through the files of a directory:
[codeblock]
func dir_contents(path):
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index df423bfa0e..4adb3844bc 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -58,9 +58,7 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
String name = l.split(" ")[0];
-
if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)) {
-
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
@@ -275,17 +273,7 @@ bool CreateDialog::_is_class_disabled_by_feature_profile(const StringName &p_cla
return false;
}
- StringName class_name = p_class;
-
- while (class_name != StringName()) {
-
- if (profile->is_class_disabled(class_name)) {
- return true;
- }
- class_name = ClassDB::get_parent_class_nocheck(class_name);
- }
-
- return false;
+ return profile->is_class_disabled(p_class);
}
void CreateDialog::select_type(const String &p_type) {
@@ -616,7 +604,7 @@ void CreateDialog::_update_favorite_list() {
for (int i = 0; i < favorite_list.size(); i++) {
String l = favorite_list[i];
String name = l.split(" ")[0];
- if (!(ClassDB::class_exists(name) || ScriptServer::is_global_class(name)))
+ if (!((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)))
continue;
TreeItem *ti = favorites->create_item(root);
ti->set_text(0, l);
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp
index 1fa2bfcd60..a4a7a0cd45 100644
--- a/editor/editor_feature_profile.cpp
+++ b/editor/editor_feature_profile.cpp
@@ -64,7 +64,10 @@ void EditorFeatureProfile::set_disable_class(const StringName &p_class, bool p_d
}
bool EditorFeatureProfile::is_class_disabled(const StringName &p_class) const {
- return disabled_classes.has(p_class);
+ if (p_class == StringName()) {
+ return false;
+ }
+ return disabled_classes.has(p_class) || is_class_disabled(ClassDB::get_parent_class_nocheck(p_class));
}
void EditorFeatureProfile::set_disable_class_editor(const StringName &p_class, bool p_disabled) {
@@ -76,7 +79,10 @@ void EditorFeatureProfile::set_disable_class_editor(const StringName &p_class, b
}
bool EditorFeatureProfile::is_class_editor_disabled(const StringName &p_class) const {
- return disabled_editors.has(p_class);
+ if (p_class == StringName()) {
+ return false;
+ }
+ return disabled_editors.has(p_class) || is_class_editor_disabled(ClassDB::get_parent_class_nocheck(p_class));
}
void EditorFeatureProfile::set_disable_class_property(const StringName &p_class, const StringName &p_property, bool p_disabled) {
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index fb5c2b25c9..f74cadf67e 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -1589,6 +1589,7 @@ void FileSystemDock::_file_option(int p_option, const Vector<String> &p_selected
ProjectSettings::get_singleton()->set("application/run/main_scene", p_selected[0]);
ProjectSettings::get_singleton()->save();
_update_tree(_compute_uncollapsed_paths());
+ _update_file_list(true);
}
} break;
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 294bedd598..13faeb0edb 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -233,15 +233,19 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
mtx.elements[2] = -draw_ofs * draw_zoom;
mtx.scale_basis(Vector2(draw_zoom, draw_zoom));
- Vector2 endpoints[8] = {
- mtx.xform(rect.position) + Vector2(-4, -4),
- mtx.xform(rect.position + Vector2(rect.size.x / 2, 0)) + Vector2(0, -4),
- mtx.xform(rect.position + Vector2(rect.size.x, 0)) + Vector2(4, -4),
- mtx.xform(rect.position + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(4, 0),
- mtx.xform(rect.position + rect.size) + Vector2(4, 4),
- mtx.xform(rect.position + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, 4),
- mtx.xform(rect.position + Vector2(0, rect.size.y)) + Vector2(-4, 4),
- mtx.xform(rect.position + Vector2(0, rect.size.y / 2)) + Vector2(-4, 0)
+ const real_t handle_radius = 8 * EDSCALE;
+ const real_t handle_offset = 4 * EDSCALE;
+
+ // Position of selection handles.
+ const Vector2 endpoints[8] = {
+ mtx.xform(rect.position) + Vector2(-handle_offset, -handle_offset),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, 0)) + Vector2(0, -handle_offset),
+ mtx.xform(rect.position + Vector2(rect.size.x, 0)) + Vector2(handle_offset, -handle_offset),
+ mtx.xform(rect.position + Vector2(rect.size.x, rect.size.y / 2)) + Vector2(handle_offset, 0),
+ mtx.xform(rect.position + rect.size) + Vector2(handle_offset, handle_offset),
+ mtx.xform(rect.position + Vector2(rect.size.x / 2, rect.size.y)) + Vector2(0, handle_offset),
+ mtx.xform(rect.position + Vector2(0, rect.size.y)) + Vector2(-handle_offset, handle_offset),
+ mtx.xform(rect.position + Vector2(0, rect.size.y / 2)) + Vector2(-handle_offset, 0)
};
Ref<InputEventMouseButton> mb = p_input;
@@ -354,7 +358,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
for (int i = 0; i < 8; i++) {
Vector2 tuv = endpoints[i];
- if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
+ if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < handle_radius) {
drag_index = i;
}
}