isForSave, gamespath, themespath

This commit is contained in:
p.kosyh 2009-09-03 10:34:53 +00:00
parent 314fe0ec49
commit 14cab66f30
2 changed files with 31 additions and 8 deletions

View file

@ -11,6 +11,8 @@ extern void debug_done(void);
int debug_sw = 0;
char *game_sw = NULL;
char *games_sw = NULL;
char *themes_sw = NULL;
int main(int argc, char **argv)
{
@ -31,7 +33,19 @@ int main(int argc, char **argv)
game_sw = argv[++i];
else
game_sw = "";
} else if (!strcmp(argv[i], "-gamespath")) {
if ((i + 1) < argc)
games_sw = argv[++i];
else
games_sw = "";
} else if (!strcmp(argv[i], "-themespath")) {
if ((i + 1) < argc)
themes_sw = argv[++i];
else
themes_sw = "";
}
}
if (debug_sw) {
@ -43,15 +57,18 @@ int main(int argc, char **argv)
if (fullscreen_sw)
opt_fs = 1;
if (games_lookup(GAMES_PATH)) {
fprintf(stderr, "No games found.\n");
}
if (games_sw)
games_lookup(games_sw);
if (games_lookup(GAMES_PATH))
fprintf(stderr, "No games found in: %s.\n", GAMES_PATH);
if (themes_sw)
themes_lookup(themes_sw);
themes_lookup(THEMES_PATH);
themes_lookup(game_local_themes_path());
games_lookup(game_local_games_path());
cfg_load();
if (game_sw) {

View file

@ -1130,7 +1130,7 @@ function savemembers(h, self, name, need)
local need2
if k ~= "__visited__" then
need2 = false
if string.find(k, '_') == 1 or string.match(k,'^%u') then
if isForSave(k) then
need2 = true;
end
@ -1729,5 +1729,11 @@ function change_pl(p)
game.pl = p;
return goto(o.where);
end
-- here the game begins
function isForSave(k)
if string.find(k, '_') == 1 or string.match(k,'^%u') then
return true
end
return false
end
-- here the game begins