summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/Timer.xml3
-rw-r--r--editor/editor_file_system.cpp4
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp5
-rw-r--r--scene/main/timer.cpp11
-rw-r--r--scene/main/timer.h2
5 files changed, 21 insertions, 4 deletions
diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml
index a6ea5738d5..fde887dd87 100644
--- a/doc/classes/Timer.xml
+++ b/doc/classes/Timer.xml
@@ -51,7 +51,8 @@
[b]Note:[/b] You cannot set this value. To change the timer's remaining time, use [method start].
</member>
<member name="wait_time" type="float" setter="set_wait_time" getter="get_wait_time" default="1.0">
- Wait time in seconds.
+ The wait time in seconds.
+ [b]Note:[/b] Timers can only emit once per rendered frame at most (or once per physics frame if [member process_callback] is [constant TIMER_PROCESS_PHYSICS). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node.
</member>
</members>
<signals>
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 953989aadd..6fef65c92d 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1078,8 +1078,8 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const
}
for (int i = 0; i < p_dir->subdirs.size(); i++) {
- if (updated_dir && !p_dir->subdirs[i]->verified) {
- //this directory was removed, add action to remove it
+ if ((updated_dir && !p_dir->subdirs[i]->verified) || _should_skip_directory(p_dir->subdirs[i]->get_path())) {
+ //this directory was removed or ignored, add action to remove it
ItemAction ia;
ia.action = ItemAction::ACTION_DIR_REMOVE;
ia.dir = p_dir->subdirs[i];
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 2c9801f512..69474c6dec 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -463,7 +463,10 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
// The trash can is successfully created, now we check that we don't exceed our file name length limit.
// If the file name is too long trim it so we can add the identifying number and ".trashinfo".
// Assumes that the file name length limit is 255 characters.
- String file_name = basename(p_path.utf8().get_data());
+ String file_name = p_path.get_file();
+ if (file_name.length() == 0) {
+ file_name = p_path.get_base_dir().get_file();
+ }
if (file_name.length() > 240) {
file_name = file_name.substr(0, file_name.length() - 15);
}
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index 9e462eb1c8..154e4cf683 100644
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -82,6 +82,7 @@ void Timer::_notification(int p_what) {
void Timer::set_wait_time(double p_time) {
ERR_FAIL_COND_MSG(p_time <= 0, "Time should be greater than zero.");
wait_time = p_time;
+ update_configuration_warnings();
}
double Timer::get_wait_time() const {
@@ -179,6 +180,16 @@ void Timer::_set_process(bool p_process, bool p_force) {
processing = p_process;
}
+TypedArray<String> Timer::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
+
+ if (wait_time < 0.05 - CMP_EPSILON) {
+ warnings.push_back(TTR("Very low timer wait times (< 0.05 seconds) may behave in significantly different ways depending on the rendered or physics frame rate.\nConsider using a script's process loop instead of relying on a Timer for very low wait times."));
+ }
+
+ return warnings;
+}
+
void Timer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_wait_time", "time_sec"), &Timer::set_wait_time);
ClassDB::bind_method(D_METHOD("get_wait_time"), &Timer::get_wait_time);
diff --git a/scene/main/timer.h b/scene/main/timer.h
index 2b9faddcb9..e2f34042dd 100644
--- a/scene/main/timer.h
+++ b/scene/main/timer.h
@@ -73,6 +73,8 @@ public:
double get_time_left() const;
+ TypedArray<String> get_configuration_warnings() const override;
+
void set_timer_process_callback(TimerProcessCallback p_callback);
TimerProcessCallback get_timer_process_callback() const;
Timer();