appleide wrote:
It now searches for itself anywhere in the package rather than in one of the specific folders, and you don't need to call anything, [...]
I still have a problem with the new recursive search.
because I have :
Code: Select all
myproject/main.lua
myproject/lib/ -- my libs inside
myproject/external/ -- the external projects inside
myproject/external/loveuibeta -- one or more version the loveui ...
myproject/external/loveuiunstable -- the lastest one
Of course I can remove the "myproject/external/loveuibeta". But it's not my real problem : I hate the non-predictive load.
In my case I work with Subversion, and I see the recursive search check a very lot of directory to finally found the bad one (in loveuibeta).
Because
I don't want to ask another change of the LoveUI loading system...
I made my own "hack" of the loading of LoveUI see below.
I'm change the enumerate function to return to LoveUI the direct and good path to the lib.
After load I restore the love function.
Code: Select all
local enumerateBackup = love.filesystem.enumerate; -- backup before
love.filesystem.enumerate = function(path)
local fakefs = {external = {loveuiunstable = {Library = {LoveUI = {}}}}};
local dir = fakefs;
for subdir in string.gfind(path, "[^/]+") do
if dir[subdir] ~= nil then
dir = dir[subdir]
end
end
local result = {};
for k, v in pairs(dir) do
table.insert(result, k);
end
return result;
end
love.filesystem.require( "external/loveuiunstable/Library/LoveUI/LoveUI.lua");
love.filesystem.enumerate = enumerateBackup; -- restore
LoveUI.requireall();
I'm almost sure to be the only one to get this problem, but never mind!
Best Regards,