X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=console.lisp;h=545d1e62d5f73d8e5047b0c657ca9947511ca277;hb=2d1a6f87c4d559af53eb5e5f0fe571caf14f8b29;hp=abca2163c1c03f3484a8010161e4e0a038cd738e;hpb=5ebd9d0215f32872bba84b52c697e23b0b7d444b;p=lifp.git diff --git a/console.lisp b/console.lisp index abca216..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) @@ -153,7 +169,7 @@ (defun run-console (startup lib-loader &key (interactive nil)) (if *repl-mode* (progn (funcall startup) (return-from run-console t)) - (with-ltk () + (with-ltk (:debug :develop :handle-warnings nil) (let* ((txt (make-instance 'text)) (menu (make-menubar)) (m-file (make-menu menu "File")) @@ -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)))))