Skip to content

Commit

Permalink
[Core] Align naming and args of (SceneTree)Timer time scale methods
Browse files Browse the repository at this point in the history
Renamed `get_ignore_time_scale` to `is_ignoring_time_scale` following general naming standards.
  • Loading branch information
AThousandShips committed Dec 23, 2024
1 parent 0f95e9f commit 8d1a3e2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion doc/classes/Timer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
[b]Note:[/b] After the timer enters the tree, this property is automatically set to [code]false[/code].
[b]Note:[/b] This property does nothing when the timer is running in the editor.
</member>
<member name="ignore_time_scale" type="bool" setter="set_ignore_time_scale" getter="get_ignore_time_scale" default="false">
<member name="ignore_time_scale" type="bool" setter="set_ignore_time_scale" getter="is_ignoring_time_scale" default="false">
If [code]true[/code], the timer will ignore [member Engine.time_scale] and update with the real, elapsed time.
</member>
<member name="one_shot" type="bool" setter="set_one_shot" getter="is_one_shot" default="false">
Expand Down
4 changes: 2 additions & 2 deletions scene/main/scene_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void SceneTreeTimer::set_ignore_time_scale(bool p_ignore) {
ignore_time_scale = p_ignore;
}

bool SceneTreeTimer::is_ignore_time_scale() {
bool SceneTreeTimer::is_ignoring_time_scale() {
return ignore_time_scale;
}

Expand Down Expand Up @@ -657,7 +657,7 @@ void SceneTree::process_timers(double p_delta, bool p_physics_frame) {
}

double time_left = E->get()->get_time_left();
if (E->get()->is_ignore_time_scale()) {
if (E->get()->is_ignoring_time_scale()) {
time_left -= Engine::get_singleton()->get_process_step();
} else {
time_left -= p_delta;
Expand Down
2 changes: 1 addition & 1 deletion scene/main/scene_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class SceneTreeTimer : public RefCounted {
bool is_process_in_physics();

void set_ignore_time_scale(bool p_ignore);
bool is_ignore_time_scale();
bool is_ignoring_time_scale();

void release_connections();

Expand Down
6 changes: 3 additions & 3 deletions scene/main/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void Timer::set_ignore_time_scale(bool p_ignore) {
ignore_time_scale = p_ignore;
}

bool Timer::get_ignore_time_scale() {
bool Timer::is_ignoring_time_scale() {
return ignore_time_scale;
}

Expand Down Expand Up @@ -223,7 +223,7 @@ void Timer::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_paused"), &Timer::is_paused);

ClassDB::bind_method(D_METHOD("set_ignore_time_scale", "ignore"), &Timer::set_ignore_time_scale);
ClassDB::bind_method(D_METHOD("get_ignore_time_scale"), &Timer::get_ignore_time_scale);
ClassDB::bind_method(D_METHOD("is_ignoring_time_scale"), &Timer::is_ignoring_time_scale);

ClassDB::bind_method(D_METHOD("is_stopped"), &Timer::is_stopped);

Expand All @@ -239,7 +239,7 @@ void Timer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "one_shot"), "set_one_shot", "is_one_shot");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autostart"), "set_autostart", "has_autostart");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_paused", "is_paused");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_time_scale"), "set_ignore_time_scale", "get_ignore_time_scale");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_time_scale"), "set_ignore_time_scale", "is_ignoring_time_scale");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_left", PROPERTY_HINT_NONE, "suffix:s", PROPERTY_USAGE_NONE), "", "get_time_left");

BIND_ENUM_CONSTANT(TIMER_PROCESS_PHYSICS);
Expand Down
2 changes: 1 addition & 1 deletion scene/main/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Timer : public Node {
bool is_paused() const;

void set_ignore_time_scale(bool p_ignore);
bool get_ignore_time_scale();
bool is_ignoring_time_scale();

bool is_stopped() const;

Expand Down

0 comments on commit 8d1a3e2

Please sign in to comment.