X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=console.lisp;h=545d1e62d5f73d8e5047b0c657ca9947511ca277;hb=HEAD;hp=402d2afb3d90494b15f9f363a5667936529c0db6;hpb=c338b0c290278eeb10844d69faca93b4fc36a79b;p=lifp.git diff --git a/console.lisp b/console.lisp index 402d2af..545d1e6 100644 --- a/console.lisp +++ b/console.lisp @@ -141,10 +141,26 @@ :defaults file)) (values file dir)))) +(defun splice-filename (file) + "Returns file itself and its directory as the second value" + (values file (make-pathname + :directory (pathname-directory file) + :name nil + :type nil + :defaults file))) (defun load-module (startup lib-loader) "Loads IF module into the interpreter" - (multiple-value-bind (file dir) (pick-file) + (multiple-value-bind (file dir) + (splice-filename (get-open-file :filetypes '(("Loadable files" + "*.fas *.lisp") + ("Compiled story files" + "*.fas") + ("Plain story files" + "*.lisp") + ("All files" "*")) + :title "Load story file")) + ;;(pick-file) <- was used before (unless file (append-text *text* (format nil "Failed to load module.~%")) (return-from load-module nil)) (funcall lib-loader file dir) @@ -194,5 +210,4 @@ (terpri *standard-output*)) (progn (configure *text* :state "normal") (append-text *text* (apply #'format nil string args)) - (append-text *text* " -")))) \ No newline at end of file + (append-text *text* (make-string 1 :initial-element #\Newline)))))