Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
David O'Toole committed Apr 7, 2010
1 parent 95bdd1b commit c03f5f1
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 16 deletions.
2 changes: 1 addition & 1 deletion forest/forest.pak
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@
(:name "forest-lisp" :type :lisp :file "forest.lisp" :properties (:autoload t))
(:name "mountain-lisp" :type :lisp :file "mountain.lisp" :properties (:autoload t))
(:name "monastery-lisp" :type :lisp :file "monastery.lisp" :properties (:autoload t))
(:name ".startup" :type :lisp :file "startup.lisp" :properties (:autoload t))
(:name ".startup" :type :lisp :file "startup.lisp")
)
2 changes: 1 addition & 1 deletion forms.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
;; (message "OBJEKKT: ~S" (find-resource page))
(let ((object (find-resource-object page)))
(prog1 object
(setf (field-value :name object) page))))))))
(setf (field-value :name object) (generate-page-name object)))))))))

;; (maphash #'(lambda (k v) (when (resource-p v)
;; (when (eq :object (resource-type v))
Expand Down
11 changes: 10 additions & 1 deletion widgets.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ normally."
(define-prototype textbox (:parent =widget=)
(font :initform ".default-font")
(buffer :initform nil)
(read-only :initform nil)
(bordered :initform nil)
(max-displayed-rows :initform nil :documentation "An integer when scrolling is enabled.")
(max-displayed-columns :initform nil)
Expand All @@ -697,6 +698,13 @@ normally."
(point-column :initform 0)
(visible :initform t))

(define-method handle-key textbox (event)
(unless <read-only>
(let ((func (gethash event <keymap>)))
(when func
(prog1 t
(funcall func))))))

(define-method set-buffer textbox (buffer)
(setf <buffer> buffer))

Expand Down Expand Up @@ -951,6 +959,8 @@ text INSERTION to be inserted at point."
:color <cursor-color>
:destination image)))))))



;;; The pager switches between different visible groups of widgets

(define-prototype pager (:parent =widget=)
Expand Down Expand Up @@ -1049,4 +1059,3 @@ text INSERTION to be inserted at point."
;; draw the string
(render-formatted-line (nreverse line) 0 0 :destination <image>))))

;;; widgets.lisp ends here
6 changes: 2 additions & 4 deletions xiodev/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
((("This is the help screen. Press F2 to return to play. While playing you"))
(("can left-click any object for help. Press PAUSE (or CONTROL-P) to pause,"))
(("this makes it easier to click and see what all the different objects are."))
(("Press Control Q to quit.")))
This is the help screen for XIODEV. Press F2 to return to the
spreadsheet view.

38 changes: 31 additions & 7 deletions xiodev/xiodev.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
(defvar *pager*)
(defvar *forms*)

(define-prototype help-prompt (:parent =prompt=)
(default-keybindings :initform '(("N" nil "page-down .")
("P" nil "page-up ."))))

(define-prototype help-textbox (:parent =textbox=))

(define-method render help-textbox ()
[parent>>render self]
[message *pager*
(list (format nil " --- Line ~A of ~A. Use N (NEXT) and P (PREVIOUS) to scroll the text."
<point-row> (length <buffer>)))])

(add-hook '*after-load-module-hook* (lambda ()
[message *pager* (list (format nil " CURRENT MODULE: ~S." *module*))]))

Expand Down Expand Up @@ -104,7 +116,8 @@
(xe2:set-screen-height *window-height*)
(xe2:set-screen-width *window-width*)
(let* ((prompt (clone =xiodev-prompt=))
(help (clone =formatter=))
(help (clone =help-textbox=))
(help-prompt (clone =help-prompt=))
(quickhelp (clone =formatter=))
(form (clone =form=))
(form2 (clone =form= "*index*"))
Expand All @@ -123,7 +136,7 @@
*prompt-height* *pager-height*)
:width (- *screen-width* *sidebar-width* 2)]
[resize form2 :height (- *screen-height* *terminal-height* *prompt-height* *pager-height*) :width (- *sidebar-width* 2)]
[resize help :height 540 :width 800]
[resize-to-scroll help :height (- *screen-height* *pager-height*) :width *screen-width*]
[resize stack :width *screen-width* :height (- *screen-height* *pager-height*)]
[resize split :width (- *screen-width* 1) :height (- *screen-height* *pager-height* *prompt-height* *terminal-height*)]
[resize terminal :height *terminal-height* :width *screen-width*]
Expand All @@ -145,6 +158,18 @@
[move form :x 0 :y 0]
[set-prompt form prompt]
[set-narrator form terminal]
;;
[resize-to-scroll help :height 540 :width 800]
[move help :x 0 :y 0]
(setf (field-value :read-only help) t)
(let ((text (find-resource-object "help-message")))
[set-buffer help text])
;;
[resize help-prompt :width 10 :height 10]
[move help-prompt :x 0 :y 0]
[hide help-prompt]
[set-receiver help-prompt help]

;;
[resize form2 :height (- *screen-height* *terminal-height* *prompt-height* *pager-height*) :width *sidebar-width*]
[move form2 :x 0 :y 0]
Expand All @@ -154,13 +179,12 @@
;;
(xe2:halt-music 1000)
;;
[resize help :height 540 :width 800]
;; [resize help :height 540 :width 800]
;; [move help :x 0 :y 0]
[resize-to-scroll help :height 540 :width 800]
[move help :x 0 :y 0]
(let ((text (find-resource-object "help-message")))
(dolist (line text)
(dolist (string line)
(funcall #'send nil :print-formatted-string help string))
[newline help]))
[set-buffer help text])
;; ;;
;; [resize quickhelp :height 72 :width 250]
;; [move quickhelp :y (- *screen-height* 130) :x (- *screen-width* 250)]
Expand Down
2 changes: 1 addition & 1 deletion xiodev/xiodev.pak
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(
(:name "help-message" :type :formatted-text :file "README")
(:name "help-message" :type :text :file "README")
(:name ".default-font" :type :font :properties (:height 14 :width 7) :data "7x14b")
(:name ".startup" :type :lisp :file "xiodev.lisp" :properties (:autoload t))
)
15 changes: 15 additions & 0 deletions xiotank/tones.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

ecasound -i:tone,sine,261.63,5 -o:C-2-sine.wav
ecasound -i:tone,sine,277.18,5 -o:C\#2-sine.wav
ecasound -i:tone,sine,293.66,5 -o:D-2-sine.wav
ecasound -i:tone,sine,311.13,5 -o:D\#2-sine.wav
ecasound -i:tone,sine,329.63,5 -o:E-2-sine.wav
ecasound -i:tone,sine,349.23,5 -o:F-2-sine.wav
ecasound -i:tone,sine,369.99,5 -o:F\#2-sine.wav
ecasound -i:tone,sine,392.00,5 -o:G-2-sine.wav
ecasound -i:tone,sine,415.30,5 -o:G\#2-sine.wav
ecasound -i:tone,sine,440.00,5 -o:A-2-sine.wav
ecasound -i:tone,sine,466.16,5 -o:A\#2-sine.wav
ecasound -i:tone,sine,493.88,5 -o:B-2-sine.wav
ecasound -i:tone,sine,523.25,5 -o:C-3-sine.wav
2 changes: 1 addition & 1 deletion xong/xong.pak
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,5 @@
(:name "player-lisp" :type :lisp :file "player.lisp" :properties (:autoload t))
(:name "enemy-lisp" :type :lisp :file "enemy.lisp" :properties (:autoload t))
(:name "tutorial-lisp" :type :lisp :file "tutorial.lisp" :properties (:autoload t))
(:name ".startup" :type :lisp :file "xong.lisp" :properties (:autoload t))
(:name ".startup" :type :lisp :file "xong.lisp")
)

0 comments on commit c03f5f1

Please sign in to comment.