Graphic folder

Post Reply
User avatar
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth

Graphic folder

Post by Omit » Mon Aug 09, 2010 10:26 am

here is just a little code that can be used in a script
It creates a database to store the path of the graphic folder, on first run it will ask the user to find it and store the value, it loads the value when the script starts and checks to make sure it's valid.(If folder is no longer valid it will ask again.)
Code: [show] | [select all] lua
local savesetting = db:create("graphicfolder", {setting = {gfx = "",_unique = {"gfx"},_violations = "REPLACE"}   })
results = db:fetch(savesetting.setting)
if results[1]==nil then
gfx_path = ""
gfx_path = results[1]["gfx"]
if io.exists(gfx_path)==false then
gfx_path = invokeFileDialog(false, "Find me the gfx folder, please")
db:add(savesetting.setting, {gfx=gfx_path})
just thought I would share.

User avatar
Posts: 4733
Joined: Sat Mar 14, 2009 3:13 pm

Re: Graphic folder

Post by Vadi » Mon Aug 09, 2010 11:16 am

It does look smaller than my flat-file solution!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests