This commit is contained in:
cuu 2019-12-15 16:12:09 +08:00
commit 6a79311bd9
8 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1 @@
launcher

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1 @@
pico8

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

56
generate_game_index.lsp Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env newlisp
(module "util.lsp")
(module "getopts.lsp")
(module "json.lsp")
(shortopt "d" (setq gamefolder getopts:arg) "" "game folder")
(shortopt "?" (getopts:usage) nil "Print this help message")
(getopts (2 (main-args))); parse getopt
(if (or (nil? gamefolder) (= gamefolder ""))
(begin
(getopts:usage)
(exit)
)
)
(setq files (directory gamefolder))
(setq res (list ))
(dolist (x files)
(if (and (not (starts-with x ".")) (directory? (string gamefolder "/" x )))
(begin
(setq gametype (read-file (string gamefolder "/" x "/.game")))
;(println gametype)
(if (not (nil? gametype))
(begin
(setq item_list '())
(setq _file (exec (string "raw.github.lsp " gamefolder "/'" x "'/file/*")))
(setq _shots (exec (string "raw.github.lsp " gamefolder "/'" x "'/shots/*")))
(setq item_list (list (list "title" x) (list "type" gametype)))
(if (= (length _file) 1)
(push (list "file" (nth 0 _file)) item_list)
(push (list "file" _file) item_list)
)
(if (= (length _shots) 1)
(push (list "shots" (nth 0 _shots)) item_list)
(push (list "shots" _shots) item_list)
)
;(println item_list)
(reverse item_list)
(push item_list res)
)
)
)
)
)
(set 'indexjson:list res)
(println (Json:Lisp->Json indexjson))
(exit)

3
index.json Normal file
View File

@ -0,0 +1,3 @@
{
"list":[{"title":"[gameshell-19q1]","file":"https://raw.githubusercontent.com/clockworkpi/warehouse/master/gameshell-19q1/index.json","type":"dir"}]
}