cuu 4 years ago
commit
6a79311bd9

+ 1 - 0
gameshell-19q1/AGENT OF SHINIGAMI/.game

@@ -0,0 +1 @@
+launcher

BIN
gameshell-19q1/AGENT OF SHINIGAMI/file/AGENT OF SHINIGAMI.tar.gz


BIN
gameshell-19q1/AGENT OF SHINIGAMI/shots/AGENT OF SHINIGAMI.png


+ 1 - 0
gameshell-19q1/quantum_shooter/.game

@@ -0,0 +1 @@
+pico8

BIN
gameshell-19q1/quantum_shooter/file/quantum_shooter.p8.png


BIN
gameshell-19q1/quantum_shooter/shots/quantum_shooter.png


+ 56 - 0
generate_game_index.lsp

@@ -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 - 0
index.json

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