Skip to content

Commit

Permalink
add option to disable stop at action point
Browse files Browse the repository at this point in the history
  • Loading branch information
arch committed Jul 17, 2022
1 parent a6a350d commit 330d702
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions contrib/Installer/assets/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ multiaxis = false
tmpFileName = "funscript_actions.json"
tmpFileExists = false
enableLogs = false
stopAtNextActionPoint = true
filterSimilarTimestamps = true
scriptNames = {}
scriptNamesCount = 0
Expand Down Expand Up @@ -54,17 +55,19 @@ function binding.start_funscript_generator()
local currentTime = player.CurrentTime()
local fps = player.FPS()

local next_action = nil
if stopAtNextActionPoint then
next_action, _ = script:closestActionAfter(currentTime)
if next_action and next_action.at < (currentTime + 0.5) then
next_action, _ = script:closestActionAfter(next_action.at)
end
end

print("tmpFile: ", tmpFile)
print("video: ", video)
print("fps", fps)
print("currentScriptIdx: ", scriptIdx)
print("currentTime: ", currentTime)

local next_action, _ = script:closestActionAfter(currentTime)
if next_action and next_action.at < (currentTime + 0.5) then
next_action, _ = script:closestActionAfter(next_action.at)
end

print("nextAction: ", next_action and tostring(next_action.at) or "nil")

local cmd = ""
Expand Down Expand Up @@ -430,6 +433,7 @@ function gui()

ofs.Separator()
ofs.Text("Options:")
stopAtNextActionPoint, _ = ofs.Checkbox("Stop tracking at next existing point", stopAtNextActionPoint)
enableLogs, _ = ofs.Checkbox("Enable logging", enableLogs)
multiaxis, _ = ofs.Checkbox("Enable multiaxis", multiaxis)

Expand Down

0 comments on commit 330d702

Please sign in to comment.