Skip to content

Commit 5d6dc6b

Browse files
committed
fix deprecated sim.fileDialog
1 parent a5ff98c commit 5d6dc6b

5 files changed

+10
-10
lines changed

Events capture.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ function export()
4040
local scenePath = sim.getStringParameter(sim.stringparam_scene_path)
4141
local sceneName = sim.getStringParameter(sim.stringparam_scene_name):match("(.+)%..+")
4242
if sceneName == nil then sceneName = 'untitled' end
43-
local fileName = sim.fileDialog(
44-
sim.filedlg_type_save, 'Export events dump...', scenePath,
43+
local fileName = simUI.fileDialog(
44+
simUI.filedialog_type.save, 'Export events dump...', scenePath,
4545
sceneName .. '.cbor', 'CBOR file', 'cbor'
4646
)
4747
if fileName == nil then return end

Events dump exporter.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function export()
1919
local scenePath = sim.getStringParameter(sim.stringparam_scene_path)
2020
local sceneName = sim.getStringParameter(sim.stringparam_scene_name):match("(.+)%..+")
2121
if sceneName == nil then sceneName = 'untitled' end
22-
local fileName = sim.fileDialog(
23-
sim.filedlg_type_save, 'Export events dump...', scenePath,
22+
local fileName = simUI.fileDialog(
23+
simUI.filedialog_type.save, 'Export events dump...', scenePath,
2424
sceneName .. '.cbor', 'CBOR file', 'cbor'
2525
)
2626
if fileName == nil then return end

Floor plan importer.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function sysCall_init()
6161
end
6262
path = sim.getStringParam(sim.stringparam_scene_path)
6363
fmts, fmtss = simUI.supportedImageFormats(';')
64-
imageFile = sim.fileDialog(
65-
sim.filedlg_type_load, 'Open image...', path, '', 'Image files', fmtss
64+
imageFile = simUI.fileDialog(
65+
simUI.filedialog_type.load, 'Open image...', path, '', 'Image files', fmtss
6666
)
6767
addCuboid = function(classTbl, x1, y1, x2, y2)
6868
local handles = {}

Point cloud importer.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function sysCall_init()
1616
end
1717

1818
function importClicked_callback()
19-
local files = sim.fileDialog(
20-
sim.filedlg_type_load_multiple, '*.xyz point cloud import', '', '', '*.xyz',
19+
local files = simUI.fileDialog(
20+
simUI.filedialog_type.load_multiple, '*.xyz point cloud import', '', '', '*.xyz',
2121
'xyz'
2222
)
2323
if files then

Screenshot tool.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ function save_callback(ui, id, v)
319319
if config.transparent then options = 1 end
320320
local filenameAndPath
321321
if config.fileDlg then
322-
filenameAndPath = sim.fileDialog(
323-
sim.filedlg_type_save, 'title', '', 'screenshot.png', 'image file',
322+
filenameAndPath = simUI.fileDialog(
323+
simUI.filedialog_type.save, 'title', '', 'screenshot.png', 'image file',
324324
'*'
325325
)
326326
else

0 commit comments

Comments
 (0)