Skip to content

Commit 2b93779

Browse files
author
arch
committed
lua formating
1 parent ddd7a5b commit 2b93779

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

contrib/Installer/assets/main.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,11 @@ function import_funscript_generator_json_result()
134134
script = ofs.Script(i)
135135
for _, action in pairs(actions[k]) do
136136
local closest_action, _ = script:closestAction(action["at"])
137-
local filtered = false
137+
local filtered = false
138138
if closest_action and math.abs(closest_action.at - (action["at"]/1000.0)) < 0.01 then
139139
filtered = true
140140
else
141-
local a = Action.new(action["at"]/1000.0, action["pos"], true)
142-
table.insert(script.actions, a)
141+
script:add(Action.new(action["at"]/1000.0, action["pos"], true))
143142
end
144143
end
145144
script:commit()
@@ -159,17 +158,14 @@ function import_funscript_generator_json_result()
159158
if closest_action and math.abs(closest_action.at - (action["at"]/1000.0)) < 0.01 then
160159
filtered = true
161160
else
162-
local a = Action.new(action["at"]/1000.0, action["pos"], true)
163-
table.insert(script.actions, a)
161+
script:add(Action.new(action["at"]/1000.0, action["pos"], true))
164162
end
165163
end
166164
end
167165

168166
script:commit()
169167
end
170168

171-
-- delete json file
172-
-- os.remove(tmpFile)
173169
end
174170

175171

@@ -322,7 +318,6 @@ function update_script_names()
322318
scriptNamesCount = 0
323319
scriptNames = {'ignore'}
324320
scriptNamesCount = scriptNamesCount + 1
325-
local i = 1
326321
while i <= ofs.ScriptCount() do
327322
name = ofs.ScriptName(i)
328323
if not is_empty(name) then

0 commit comments

Comments
 (0)