typos, allowed output window scrolling (doesn't FUCKIN AUTOSCROLL AGH), reformat newlines

This commit is contained in:
kiefac 2024-05-23 17:11:42 -04:00
parent 36b3ac4a48
commit 5c865db137
2 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,7 @@
(dim 10 10) (dim 10 10)
(list (weapon "BIG SWORD" (pos 5 5) 4 'sword 5) (list (weapon "BIG SWORD" (pos 5 5) 4 'sword 5)
(armor "LEATHER CAP" (pos 5 9) 1 'helmet 2)))) (armor "LEATHER CAP" (pos 5 9) 1 'helmet 2))))
(define plyr (player "ME" room1 '() 'human 20 '() 50)) (define plyr (player "YOU" room1 '() 'human 20 '() 50))
(set-room-contents! room1 (append (room-contents room1) (list plyr))) (set-room-contents! room1 (append (room-contents room1) (list plyr)))
(define (interpret in) (define (interpret in)
@ -26,7 +26,7 @@
(let ([room (obj-pos plyr)]) (let ([room (obj-pos plyr)])
(if (empty? what) (if (empty? what)
(string-join (obj-names (room-contents room)) ", " (string-join (obj-names (room-contents room)) ", "
#:before-first "In this area, there is " #:before-first "In this area, there is: "
#:before-last ", and " #:before-last ", and "
#:after-last ".") #:after-last ".")
(let* ([what-str (string-join what)] (let* ([what-str (string-join what)]

View file

@ -10,16 +10,17 @@
(require racket/gui/easy (require racket/gui/easy
racket/gui/easy/operator) racket/gui/easy/operator)
(require "interpret.rkt") (require "interpret.rkt")
(require "console.rkt")
(define mono (send the-font-list find-or-create-font 12 'modern 'normal 'normal)) (define mono (send the-font-list find-or-create-font 12 'modern 'normal 'normal))
(define/obs @log "You awake in a dark room.\n") (define/obs @log "You awake in a dark room.")
(define/obs @input "Type here...") (define/obs @input "Type here...")
(define (text-entered event content) (define (text-entered event content)
(when (eqv? event 'return) (when (eqv? event 'return)
(:= @input "") (:= @input "")
(let ([input (string-upcase content)]) (let ([input (string-upcase content)])
(:= @log (~a (obs-peek @log) "> " input "\n" (interpret input) "\n"))))) (:= @log (~a (obs-peek @log) "\n> " input "\n" (interpret input))))))
(render (render
(window (window
@ -27,7 +28,8 @@
(hpanel (hpanel
(vpanel (vpanel
(input @log (input @log
#:enabled? #f ;hack to prevent text editing without disabling the editor
(λ (ev cnt) (let ([old (obs-peek @log)]) (:= @log "") (:= @log old)))
#:style '(multiple) #:style '(multiple)
#:min-size '(600 400) #:min-size '(600 400)
#:font mono) #:font mono)