fixed squirrel for the text projects

This commit is contained in:
Vadim Grigoruk 2018-10-25 09:01:04 +03:00
parent 03fd522271
commit f0306b04f2
2 changed files with 13 additions and 6 deletions

View File

@ -690,18 +690,21 @@ static bool hasExt(const char* name, const char* ext)
static bool hasProjectExt(const char* name)
{
return hasExt(name, PROJECT_LUA_EXT) ||
hasExt(name, PROJECT_MOON_EXT) ||
hasExt(name, PROJECT_JS_EXT) ||
hasExt(name, PROJECT_WREN_EXT) ||
hasExt(name, PROJECT_FENNEL_EXT);
return hasExt(name, PROJECT_LUA_EXT)
|| hasExt(name, PROJECT_MOON_EXT)
|| hasExt(name, PROJECT_JS_EXT)
|| hasExt(name, PROJECT_WREN_EXT)
|| hasExt(name, PROJECT_SQUIRREL_EXT)
|| hasExt(name, PROJECT_FENNEL_EXT);
}
static const char* projectComment(const char* name)
{
char* comment;
if(hasExt(name, PROJECT_JS_EXT) || hasExt(name, PROJECT_WREN_EXT))
if(hasExt(name, PROJECT_JS_EXT)
|| hasExt(name, PROJECT_WREN_EXT)
|| hasExt(name, PROJECT_SQUIRREL_EXT))
comment = "//";
else if(hasExt(name, PROJECT_FENNEL_EXT))
comment = ";;";
@ -1085,6 +1088,9 @@ static void onConsoleLoadCommandConfirmed(Console* console, const char* param)
if(!fsExistsFile(console->fs, name))
name = getName(param, PROJECT_FENNEL_EXT);
if(!fsExistsFile(console->fs, name))
name = getName(param, PROJECT_SQUIRREL_EXT);
void* data = fsLoadFile(console->fs, name, &size);
if(data)

View File

@ -397,6 +397,7 @@ static bool addMenuItem(const char* name, const char* info, s32 id, void* ptr, b
|| hasExt(name, PROJECT_JS_EXT)
|| hasExt(name, PROJECT_WREN_EXT)
|| hasExt(name, PROJECT_FENNEL_EXT)
|| hasExt(name, PROJECT_SQUIRREL_EXT)
#endif
)
{