mirror of
https://github.com/HarmonyHoney/ROTA.git
synced 2026-07-18 00:56:58 +00:00
Put speedrun timer in its own label rather than hijacking the file timer
This commit is contained in:
parent
3a4d607ead
commit
ea262e6f1f
3 changed files with 31 additions and 11 deletions
|
|
@ -235,11 +235,11 @@ func _physics_process(delta):
|
|||
map_clock += 1
|
||||
|
||||
# clock label
|
||||
if final_time > 0:
|
||||
UI.clock_file.text = "%s Final Time" % [time_string2(final_time, clock_decimals)]
|
||||
else:
|
||||
UI.clock_file.text = time_string2(save_time, clock_decimals)
|
||||
UI.clock_file.text = time_string2(save_time, clock_decimals)
|
||||
UI.clock_map.text = time_string2(map_clock, clock_decimals)
|
||||
if final_time > 0:
|
||||
# Always show at least 2 so we can get an accurate final time
|
||||
UI.clock_speedrun.text = time_string2(final_time, clock_decimals if clock_decimals >= 2 else 2) + "\nSpeedrun Time"
|
||||
|
||||
func _process(_delta):
|
||||
# arrows
|
||||
|
|
@ -296,6 +296,7 @@ func change_scene():
|
|||
arrow.modulate.a = 0.0
|
||||
|
||||
emit_signal("scene_before")
|
||||
var prev_csfn := csfn
|
||||
|
||||
is_reload = next_scene == csfn
|
||||
if is_reload:
|
||||
|
|
@ -320,6 +321,13 @@ func change_scene():
|
|||
try_achievement()
|
||||
map_clock = 0
|
||||
|
||||
if csfn == end_path:
|
||||
if !(prev_csfn in [title_path, end_path]):
|
||||
final_time = save_time
|
||||
else:
|
||||
final_time = 0
|
||||
Autosplitter.set_final_time(final_time)
|
||||
|
||||
yield(get_tree(), "idle_frame")
|
||||
|
||||
for y in 3:
|
||||
|
|
@ -846,13 +854,8 @@ func try_achievement():
|
|||
if clock_rank > 49:
|
||||
achieve("clock50")
|
||||
|
||||
if csfn == end_path:
|
||||
final_time = save_time
|
||||
if save_time < 3600 * 60:
|
||||
achieve("speedrun")
|
||||
else:
|
||||
final_time = 0
|
||||
Autosplitter.set_final_time(final_time)
|
||||
if csfn == end_path and save_time < 3600 * Engine.iterations_per_second:
|
||||
achieve("speedrun")
|
||||
|
||||
func achieve(arg := ""):
|
||||
if arg != "" and Steam.is_init():
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ var keys = EaseMover.new()
|
|||
onready var clock := $Center/Control/Clock
|
||||
onready var clock_file := $Center/Control/Clock/File
|
||||
onready var clock_map := $Center/Control/Clock/Map
|
||||
onready var clock_speedrun := $Center/Control/Clock/Speedrun
|
||||
onready var clock_down := $Center/Control/Clock/Down
|
||||
onready var clock_best := $Center/Control/Clock/Down/Best
|
||||
onready var clock_goal := $Center/Control/Clock/Down/Goal
|
||||
|
|
@ -70,6 +71,7 @@ func scene_changed(override := false):
|
|||
var t = Shared.clock_show == Shared.SPEED.TRADE
|
||||
clock_file.visible = m and ((t and Shared.is_hub) or (b or Shared.clock_show == Shared.SPEED.FILE))
|
||||
clock_map.visible = m and !Shared.is_hub and (t or b or Shared.clock_show == Shared.SPEED.MAP)
|
||||
clock_speedrun.visible = Shared.final_time > 0 and (b or Shared.clock_show == Shared.SPEED.FILE)
|
||||
clock_ease.show = m and !Shared.is_hub and Shared.clock_show > 0
|
||||
|
||||
func menu_keys(accept := "", cancel := ""):
|
||||
|
|
|
|||
|
|
@ -276,6 +276,21 @@ text = "3:57"
|
|||
[node name="Spacer" type="Control" parent="Center/Control/Clock"]
|
||||
margin_top = 110.0
|
||||
margin_right = 600.0
|
||||
margin_bottom = 161.0
|
||||
rect_min_size = Vector2( 0, 51 )
|
||||
|
||||
[node name="Speedrun" type="Label" parent="Center/Control/Clock"]
|
||||
modulate = Color( 1, 0.95, 0.95, 1 )
|
||||
margin_top = 165.0
|
||||
margin_right = 600.0
|
||||
margin_bottom = 270.0
|
||||
theme = ExtResource( 1 )
|
||||
text = "1:48:02
|
||||
Speedrun Time"
|
||||
|
||||
[node name="Spacer2" type="Control" parent="Center/Control/Clock"]
|
||||
margin_top = 274.0
|
||||
margin_right = 600.0
|
||||
margin_bottom = 570.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue