From f6e18878cb498cd7eb714ffad5c8640d1efc13db Mon Sep 17 00:00:00 2001 From: David O'Toole Date: Sat, 10 Apr 2010 19:06:27 -0400 Subject: [PATCH] add variable *module-package-name*, enter that package after loading module --- cons/cons-package.lisp | 2 ++ cons/cons.lisp | 2 +- console.lisp | 12 +++++++++++- forest/forest.lisp | 8 ++++---- forms.lisp | 2 -- xe2.lisp | 1 + xiomacs/xiomacs.lisp | 13 +++++++++++-- xiomacs/xiomacs.org | 7 ++++++- 8 files changed, 36 insertions(+), 11 deletions(-) diff --git a/cons/cons-package.lisp b/cons/cons-package.lisp index eff0719..7374bda 100644 --- a/cons/cons-package.lisp +++ b/cons/cons-package.lisp @@ -4,3 +4,5 @@ (:export cons-game)) (in-package :cons-game) + +(setf xe2:*module-package-name* :cons-game) diff --git a/cons/cons.lisp b/cons/cons.lisp index 298bfa4..d136235 100644 --- a/cons/cons.lisp +++ b/cons/cons.lisp @@ -19,7 +19,7 @@ ;; along with this program. If not, see . (in-package :cons-game) - +(setf xe2:*module-package-name* :cons-game) (setf xe2:*dt* 20) ;;; Splash screen diff --git a/console.lisp b/console.lisp index 7351639..6e1e059 100644 --- a/console.lisp +++ b/console.lisp @@ -1277,6 +1277,14 @@ found." (defparameter *after-load-module-hook* nil) +(defvar *module-package-name* nil) + +(defun module-package-name (&optional (module-name *module*)) + (let ((default-name (or *module-package-name* (make-keyword module-name)))) + (prog1 default-name + (unless (find-package default-name) + (error "Cannot find package ~S" default-name))))) + (defun load-module (module &key (autoload t)) "Load the module named MODULE. Load any resources marked with a non-nil :autoload property. This operation also sets the default @@ -1293,7 +1301,8 @@ object save directory (by setting the current `*module*'. See also (when (probe-file object-index-file) (message "Loading saved objects from ~S" object-index-file) (index-pak module object-index-file))) - (run-hook '*after-load-module-hook*)) + (run-hook '*after-load-module-hook*) + (setf *package* (find-package (module-package-name)))) ;;; Playing music and sound effects @@ -1568,6 +1577,7 @@ also the file LIBSDL-LICENSE for details. and its .startup resource is loaded." (format t "~A" *copyright-text*) (initialize-resource-table) + (setf *module-package-name* nil) (setf *initialization-hook* nil) (setf *play-args* args) (setf *random-state* (make-random-state t)) diff --git a/forest/forest.lisp b/forest/forest.lisp index 1c604c7..adab233 100644 --- a/forest/forest.lisp +++ b/forest/forest.lisp @@ -83,7 +83,7 @@ "water-3")) (defcell water - (tile :initform "floor") + (tile :initform "water-1") (description :initform "These waters of the wasteland are not always fit to drink.") (categories :initform '(:actor :reflective :water :exclusive))) @@ -167,7 +167,7 @@ (defparameter *snow-clock* 8) (defcell earth - (tile :initform "floor") + (tile :initform "earth-1") (categories :initform '(:actor :reflective)) (snow-clock :initform *snow-clock*) (description :initform "The solid earth beneath your feet.") @@ -515,8 +515,8 @@ (define-method generate forest (&key (height *forest-height*) (width *forest-width*) - sequence-number - description + (sequence-number (genseq)) + (description "Forest") (fireflies 100) (graveyards 15) (ruins 15) diff --git a/forms.lisp b/forms.lisp index 6dd81e2..bdc2e7e 100644 --- a/forms.lisp +++ b/forms.lisp @@ -611,8 +611,6 @@ DIRECTION is one of :up :down :right :left." (setf 0) [scroll self]) - - ;;; A var cell stores a value into a variable, and reads it. (defparameter *var-cell-style* '(:foreground ".white" :background ".blue")) diff --git a/xe2.lisp b/xe2.lisp index c9a8060..6db154f 100644 --- a/xe2.lisp +++ b/xe2.lisp @@ -63,6 +63,7 @@ *frequency* *output-chunksize* *output-channels* halt-sample *dt* *physics-function* =equipment= *default-world-axis-size* generic-keybind *default-world-z-size* =browser= install-widgets =label= =form= +*module-package-name* module-package-name =data-cell= =var-cell= =option-cell= =toggle-cell= =event-cell= =buffer-cell= =comment-cell= install-widget uninstall-widget =button-cell= =image-cell= *initialization-hook* initialize-engine diff --git a/xiomacs/xiomacs.lisp b/xiomacs/xiomacs.lisp index 836dbb5..3bc66db 100644 --- a/xiomacs/xiomacs.lisp +++ b/xiomacs/xiomacs.lisp @@ -96,12 +96,21 @@ ("END" nil :move-end-of-line) ("PAGEUP" nil :move-beginning-of-column) ("PAGEDOWN" nil :move-end-of-column) -;; ("K" (:control) :clear-line) -;; ("BACKSPACE" nil :backward-delete-char) + ;; ("K" (:control) :clear-line) + ;; ("BACKSPACE" nil :backward-delete-char) ("UP" (:control) :apply-right) ("DOWN" (:control) :apply-left) ("LEFT" (:control) :left-pane) ("RIGHT" (:control) :right-pane) + ;; + ("KP8" nil :move-cursor-up) + ("KP2" nil :move-cursor-down) + ("KP4" nil :move-cursor-left) + ("KP6" nil :move-cursor-right) + ("KP8" (:control) :apply-right) + ("KP2" (:control) :apply-left) + ("KP4" (:control) :left-pane) + ("KP6" (:control) :right-pane) ;; ("LEFTBRACKET" nil :apply-left) ;; ("RIGHTBRACKET" nil :apply-right) ("TAB" nil :switch-panes) diff --git a/xiomacs/xiomacs.org b/xiomacs/xiomacs.org index 69a1cfa..d73187f 100644 --- a/xiomacs/xiomacs.org +++ b/xiomacs/xiomacs.org @@ -1,4 +1,9 @@ -** TODO command button runs its text to prompt +** TODO [#B] command button runs its text to prompt +** TODO [#A] pick up and put down, attach object to cursor? +** TODO [#A] move command to move objects w mouse or keyboard. +** TODO [#C] auto moving speech bubbles +** TODO search feature +** TODO generic page browser with preview ** TODO fix text box RETURN keybinding not working ** TODO [#A] *menu* sheet, autogenerated, f5 refresh revisit ** TODO [#A] mark command and mark-row mark-column fields