From eed8ea39d85400821040ac75855608cafb3e72d5 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 26 Nov 2009 02:56:10 +0100 Subject: Adding self-paq feature for lua-interface-light. --- lua-interface-light.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'lua-interface-light.lua') diff --git a/lua-interface-light.lua b/lua-interface-light.lua index ae115f9..b34baf9 100644 --- a/lua-interface-light.lua +++ b/lua-interface-light.lua @@ -142,23 +142,31 @@ local function generate_dlg() } end -function lua_interface_light_main() - local dlg = generate_dlg() +function lua_interface_light_main(passthru) + if not passthru then + local dlg = generate_dlg() - dlg:show() - iup.MainLoop() - dlg:hide() + dlg:show() + iup.MainLoop() + dlg:hide() + else + okay = true + end if commandline then return true end if not okay then return false end - if not pcall(Archive, input_file_text.value) then - error(error_not_archive_locale[system_locale]) + if not passthru then + if not pcall(Archive, input_file_text.value) then + error(error_not_archive_locale[system_locale]) + end end if not pcall(load, "archive_main.lua") then + if passthru then return lua_interface_light_main(false) end error(error_wrong_archive_locale[system_locale]) end if not type(archive_main) == "function" then + if passthru then return lua_interface_light_main(false) end error(error_bad_lua_locale[system_locale]) end -- cgit v1.2.3