Skip to content

Commit

Permalink
Fix timer starting with reset when paused
Browse files Browse the repository at this point in the history
  • Loading branch information
cg2121 committed May 10, 2021
1 parent 3372d5b commit 4772824
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion advanced-timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cur_time = 0
cur_ns = 0
up_when_finished = false
up = false
paused = false

hotkey_id_reset = obs.OBS_INVALID_HOTKEY_ID
hotkey_id_pause = obs.OBS_INVALID_HOTKEY_ID
Expand Down Expand Up @@ -272,9 +273,11 @@ function on_pause(pressed)
if timer_active then
stop_timer()
cur_time = cur_ns
paused = true
else
stop_timer()
start_timer()
paused = false
end
end

Expand Down Expand Up @@ -475,7 +478,7 @@ function script_update(settings)

set_time_text(cur_time, format)

if global == false then
if global == false and paused == false then
start_timer()
end
end
Expand Down

0 comments on commit 4772824

Please sign in to comment.