X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=console.lisp;h=545d1e62d5f73d8e5047b0c657ca9947511ca277;hb=refs%2Fheads%2Fmaster;hp=86588b1815d8f115b207a42e35ed886040ca744d;hpb=0b54e760a0bb4044372a2407ee959b37952d3e4d;p=lifp.git diff --git a/console.lisp b/console.lisp index 86588b1..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 (:debug :develop) + (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)))))