Fixes to asset panel for new folder and file selection

This commit is contained in:
David Lannan 2024-11-27 09:52:09 +10:30
parent 686914e5c2
commit c87d64bfad
3 changed files with 7 additions and 15 deletions

View File

@ -1 +1 @@
["F:\\dev\\luajit\\Thunc\\sokol-luajit\\builds\\cube_sapp\\cube_sapp.slp","F:\\dev\\luajit\\Thunc\\sokol-luajit\\builds\\cube_sapp\\cube_sapp2.slp"]
["D:\\dev\\luajit\\Thunc\\sokol-luajit\\builds\\cube_sapp\\cube_sapp.slp"]

View File

@ -144,9 +144,9 @@ settings.save_recents = function( )
if(fh) then
fh:write(json.encode( settings.recents ))
fh:close()
logging.error(" settings.save_recents.")
logging.info(" settings.save_recents.")
else
logging.error(" settings.save_recents: Cannot load recents.")
logging.error(" settings.save_recents: Cannot save recents.")
end
end
end

View File

@ -317,11 +317,7 @@ local function assets_panel(ctx)
nk.nk_layout_row_dynamic(ctx, 25, 2)
if (nk.nk_button_label(ctx, "Add Folder") == true) then
folder_select.popup_active = 1
folder_select.prop = nil
folder_select.folder_path = "."
folder_select.drives = dirtools.get_drives()
folder_select.callback = function(udata, res)
fsel.open(folder_select, ".", nil, function(udata, res)
print(udata.folder_path, named_tab, res)
if(res == true) then
local tabinfo = tabs[curr_tab]
@ -331,15 +327,11 @@ local function assets_panel(ctx)
}
table.insert(panel.config.assets[tabinfo.asset_name], newfolder)
end
end
end)
end
if (nk.nk_button_label(ctx, "Add File") == true) then
file_select.popup_active = 1
file_select.prop = nil
file_select.folder_path = dirtools.get_folder(".")
file_select.drives = dirtools.get_drives()
file_select.callback = function(udata, res)
fsel.open(file_select, ".", nil, function(udata, res)
if(res == true) then
local tabinfo = tabs[curr_tab]
local newfile = {
@ -348,7 +340,7 @@ local function assets_panel(ctx)
}
table.insert(panel.config.assets[tabinfo.asset_name], newfile)
end
end
end)
end
end