diff --git a/Autoload/Autoload.gd b/Autoload/Autoload.gd index 478c469..d5a69e1 100644 --- a/Autoload/Autoload.gd +++ b/Autoload/Autoload.gd @@ -24,18 +24,7 @@ const alone_steps: Array = [ "res://AutomaticBugs/FunctionExecutor.tscn", # Only need to run once ] -var time_object: Object - - func _init(): - # Workaround for Time/OS breaking change - https://github.com/godotengine/godot/pull/54056 - if ClassDB.class_exists("_Time"): - time_object = ClassDB.instance("_Time") - elif ClassDB.class_exists("Time"): - time_object = Time#ClassDB.instance("Time") - else: - time_object = ClassDB.instance("_OS") - start_time = Time.get_ticks_msec() # In case when user doesn't provide time @@ -50,7 +39,7 @@ func _init(): func _process(delta: float) -> void: - var current_run_time: int = time_object.get_ticks_msec() - start_time + var current_run_time: int = Time.get_ticks_msec() - start_time # While loop instead simple if, because will allow to properly flush results under heavy operations(e.g. Thread sanitizer) while current_run_time > time_to_print_next_time: @@ -62,5 +51,3 @@ func _process(delta: float) -> void: get_tree().quit() -func _exit_tree() -> void: - time_object.free() diff --git a/Start.gd b/Start.gd index cae8aae..1a82730 100644 --- a/Start.gd +++ b/Start.gd @@ -11,11 +11,11 @@ func _ready(): Autoload.can_be_closed = false for i in Autoload.alone_steps.size() + 1: - array_with_time_to_change.append(Autoload.time_object.get_ticks_msec() + i * Autoload.time_for_each_step) + array_with_time_to_change.append(Time.get_ticks_msec() + i * Autoload.time_for_each_step) func _process(_delta): - if current_scene < Autoload.alone_steps.size() - 1 && Autoload.time_object.get_ticks_msec() > array_with_time_to_change[current_scene + 1]: + if current_scene < Autoload.alone_steps.size() - 1 && Time.get_ticks_msec() > array_with_time_to_change[current_scene + 1]: current_scene += 1 if current_scene == Autoload.alone_steps.size() - 1: Autoload.can_be_closed = true