Skip to content

Commit 330d702

Browse files
author
arch
committed
add option to disable stop at action point
1 parent a6a350d commit 330d702

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

contrib/Installer/assets/main.lua

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ multiaxis = false
1414
tmpFileName = "funscript_actions.json"
1515
tmpFileExists = false
1616
enableLogs = false
17+
stopAtNextActionPoint = true
1718
filterSimilarTimestamps = true
1819
scriptNames = {}
1920
scriptNamesCount = 0
@@ -54,17 +55,19 @@ function binding.start_funscript_generator()
5455
local currentTime = player.CurrentTime()
5556
local fps = player.FPS()
5657

58+
local next_action = nil
59+
if stopAtNextActionPoint then
60+
next_action, _ = script:closestActionAfter(currentTime)
61+
if next_action and next_action.at < (currentTime + 0.5) then
62+
next_action, _ = script:closestActionAfter(next_action.at)
63+
end
64+
end
65+
5766
print("tmpFile: ", tmpFile)
5867
print("video: ", video)
5968
print("fps", fps)
6069
print("currentScriptIdx: ", scriptIdx)
6170
print("currentTime: ", currentTime)
62-
63-
local next_action, _ = script:closestActionAfter(currentTime)
64-
if next_action and next_action.at < (currentTime + 0.5) then
65-
next_action, _ = script:closestActionAfter(next_action.at)
66-
end
67-
6871
print("nextAction: ", next_action and tostring(next_action.at) or "nil")
6972

7073
local cmd = ""
@@ -430,6 +433,7 @@ function gui()
430433

431434
ofs.Separator()
432435
ofs.Text("Options:")
436+
stopAtNextActionPoint, _ = ofs.Checkbox("Stop tracking at next existing point", stopAtNextActionPoint)
433437
enableLogs, _ = ofs.Checkbox("Enable logging", enableLogs)
434438
multiaxis, _ = ofs.Checkbox("Enable multiaxis", multiaxis)
435439

0 commit comments

Comments
 (0)