Looks promising. Just sent you email (wltrebor). Ill try it ASAP
@All,
I’m done updating this (now free) module. You can find it here:
https://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2015/01/caseDetectError
, or download it as a ZIP here:
https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/01/caseDetectError.zip
It now checks all of the following:
- require()
- display.newImage()
- display.newImageRect()
- graphics.newImageSheet()
- graphics.newMask()
- graphics.newOutline()
- widget.setTheme()
Note: require() ignores any paths containing these strings (see line 128-ish in caseErrorDetect.lua):
local requireIgnoreList = { "ads", "analytics", "gameNetwork", "facebook", "composer", "crypto", "json", "lfs", "licensing", "media", "physics", "socket", "sprite", "sqlite3", "store", "storyboard", "system", "widget", "plugin", "CoronaProvider", }
Cheers!
Hi again folks. I made a small change to the module so that the ‘require()’ tests do the following:
- Always try to require the file and return something.
- ONLY print messages to the console. i.e. Never throw an error and pop-up a dialog.
Why?
It seems the original way didn’t account for:
- Lua++ libraries I didn’t know about.
- People requiring things that are already included like ‘string’, ‘io’, etc. I didn’t expect this so I put no checks in.
So, now, you’ll get warnings if the module ‘thinks’ something may be wrong, but requires should always do their best to complete.
PS - I may do more updates, but don’t forget folks: This code is free and open source. So get it, modify it, and share your changes here. If I see something I like I’ll incorporate it in the main release.
I can confirm this works - kind of. I had to make a few changes. At first I had to keep adding all kinds of strings to the exclusion list and it got pretty complicated and crashed on other things. Mainly related to the ads library and corona plugins but the easiest way to get round it is remove the whole "_G.require = function( path ) "function . I figured that it would be pretty obvious a whole module wasnt loading.
Now this successfully detects the incorrect filename for a .png including incorrect folder names.
This basically does the job. Just needs audio load sound added. Thank you for this Roaring Gamer. Good job and not two years to do either 
Its also quite easy to add audio. This detects files loaded with audio.loadSound:
Just add it before the display section
-----///////////////////AUDIO
local audio_loadSound = _G.audio.loadSound
_G.audio.loadSound = function( … )
if( type(arg[1]) == “string” and not resourceFiles[arg[1]] ) then
ced.print("***** WARNING! audio LoadSound File ‘" … tostring(arg[1]) … "’ - does not exist. Check case of file.")
return nil
elseif( type(arg[2]) == “string” and not resourceFiles[arg[2]] ) then
ced.print("***** WARNING! audio LoadSound File ‘" … tostring(arg[2]) … "’ - does not exist. Check case of file.")
return nil
end
return audio_loadSound( unpack(arg) )
end
This module will be used at all times for me from now on that is for sure . Thank you and well done again RG
Hello all. I’m posting back to let folks know I FINALLY fixed the issue with caseErrorDetect and OS X. The script works properly now and will detect case errors for these cases:
- require
- display.*
- graphics.*
- widget.*
- composer.*
I purposely left audio.* and media.* unfixed since files may come from temporary, document, or event remote sources. You can easily extend this module if you need to check temporary and document folders.