diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-10-28 23:31:42 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-10-28 23:31:42 +0000 |
commit | d789e418847a527ffcfb90ed3443fb05efa2da04 (patch) | |
tree | fdc0c5a012ead2faed48fe8434167104a4620737 /apps/filetree.c | |
parent | 97881c1a62612e6fd716bd2feabeb1a333159d0d (diff) | |
download | rockbox-d789e418847a527ffcfb90ed3443fb05efa2da04.tar.gz rockbox-d789e418847a527ffcfb90ed3443fb05efa2da04.zip |
Add support for running Lua games/apps from the Plugins menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23390 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/filetree.c')
-rw-r--r-- | apps/filetree.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index 3b31358321..945b9ac504 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -344,7 +344,8 @@ int ft_load(struct tree_context* c, const char* tempdir) | |||
344 | (*c->dirfilter == SHOW_CFG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_CFG) || | 344 | (*c->dirfilter == SHOW_CFG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_CFG) || |
345 | (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) || | 345 | (*c->dirfilter == SHOW_LNG && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LNG) || |
346 | (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) || | 346 | (*c->dirfilter == SHOW_MOD && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_MOD) || |
347 | (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK)) | 347 | (*c->dirfilter == SHOW_PLUGINS && (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_ROCK && |
348 | (dptr->attr & FILE_ATTR_MASK) != FILE_ATTR_LUA)) | ||
348 | { | 349 | { |
349 | i--; | 350 | i--; |
350 | continue; | 351 | continue; |
@@ -582,13 +583,21 @@ int ft_enter(struct tree_context* c) | |||
582 | 583 | ||
583 | /* plugin file */ | 584 | /* plugin file */ |
584 | case FILE_ATTR_ROCK: | 585 | case FILE_ATTR_ROCK: |
586 | case FILE_ATTR_LUA: | ||
585 | { | 587 | { |
588 | char *plugin = buf, *argument = NULL; | ||
586 | int ret; | 589 | int ret; |
590 | |||
591 | if ((file->attr & FILE_ATTR_MASK) == FILE_ATTR_LUA) { | ||
592 | plugin = VIEWERS_DIR "/lua.rock"; /* Use a #define here ? */ | ||
593 | argument = buf; | ||
594 | } | ||
595 | |||
587 | if (global_settings.party_mode && audio_status()) { | 596 | if (global_settings.party_mode && audio_status()) { |
588 | splash(HZ, ID2P(LANG_PARTY_MODE)); | 597 | splash(HZ, ID2P(LANG_PARTY_MODE)); |
589 | break; | 598 | break; |
590 | } | 599 | } |
591 | ret = plugin_load(buf,NULL); | 600 | ret = plugin_load(plugin, argument); |
592 | switch (ret) | 601 | switch (ret) |
593 | { | 602 | { |
594 | case PLUGIN_GOTO_WPS: | 603 | case PLUGIN_GOTO_WPS: |