##// END OF EJS Templates
The Box bugfixes
naryl -
r21:f7b5d97b default
parent child Browse files
Show More
@@ -1,3 +1,4 b''
1 .*~
1 .*~
2 .qlot
2 .qlot
3 .html
3 .html
4 tests
@@ -1,6 +1,6 b''
1
1
2 * Make acts stored separately
2 * Special locations
3 * Update saving system to use separate acts and save at any point
3 * Special variables
4 * CLI build for Linux
4 * CLI build for Linux
5 * CLI build for Windows
5 * CLI build for Windows
6
6
@@ -1,7 +1,6 b''
1
1
2 # start
2 # start
3 USEHTML=1
3 USEHTML=1
4 BCOLOR = RGB(255, 255, 255)
5 '<center><font size="20" color="#FF0000" face="Times New Roman"><b>ВСкстовый квСст</b></font></center><br>'
4 '<center><font size="20" color="#FF0000" face="Times New Roman"><b>ВСкстовый квСст</b></font></center><br>'
6 ' <b>Π’Π°ΡˆΠ° Ρ†Π΅Π»ΡŒ</b> - Π·Π°Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Ρ‚ΡŒ <i>дСньги</i>, ΠΏΠΎΠΊΡƒΠΏΠ°Ρ‚ΡŒ Π½Π° Π½ΠΈΡ… <i>ΠΏΠΎΠ΄Π°Ρ€ΠΊΠΈ</i> ΠΈ Π΄Π°Ρ€ΠΈΡ‚ΡŒ своим <i>Π±Π»ΠΈΠ·ΠΊΠΈΠΌ</i>.'
5 ' <b>Π’Π°ΡˆΠ° Ρ†Π΅Π»ΡŒ</b> - Π·Π°Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°Ρ‚ΡŒ <i>дСньги</i>, ΠΏΠΎΠΊΡƒΠΏΠ°Ρ‚ΡŒ Π½Π° Π½ΠΈΡ… <i>ΠΏΠΎΠ΄Π°Ρ€ΠΊΠΈ</i> ΠΈ Π΄Π°Ρ€ΠΈΡ‚ΡŒ своим <i>Π±Π»ΠΈΠ·ΠΊΠΈΠΌ</i>.'
7 ACT '<b>ΠΠ°Ρ‡Π°Ρ‚ΡŒ ΠΈΠ³Ρ€Ρƒ</b>':GOTO 'Π”ΠΎΠΌ'
6 ACT '<b>ΠΠ°Ρ‡Π°Ρ‚ΡŒ ΠΈΠ³Ρ€Ρƒ</b>':GOTO 'Π”ΠΎΠΌ'
@@ -52,18 +52,18 b''
52 (defm (root api clear-id) (id)
52 (defm (root api clear-id) (id)
53 (setf (ps:chain document (get-element-by-id id) inner-text) ""))
53 (setf (ps:chain document (get-element-by-id id) inner-text) ""))
54
54
55 (defm (root api get-id) (id)
55 (defm (root api get-id) (id &optional force-html)
56 (if (var "USEHTML" 0 :num)
56 (if (or force-html (var "USEHTML" 0 :num))
57 (ps:chain (document.get-element-by-id id) inner-h-t-m-l)
57 (ps:chain (document.get-element-by-id id) inner-h-t-m-l)
58 (ps:chain (document.get-element-by-id id) inner-text)))
58 (ps:chain (document.get-element-by-id id) inner-text)))
59
59
60 (defm (root api set-id) (id contents)
60 (defm (root api set-id) (id contents &optional force-html)
61 (if (var "USEHTML" 0 :num)
61 (if (or force-html (var "USEHTML" 0 :num))
62 (setf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) contents)
62 (setf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) contents)
63 (setf (ps:chain (document.get-element-by-id id) inner-text) contents)))
63 (setf (ps:chain (document.get-element-by-id id) inner-text) contents)))
64
64
65 (defm (root api append-id) (id contents)
65 (defm (root api append-id) (id contents &optional force-html)
66 (if (var "USEHTML" 0 :num)
66 (if (or force-html (var "USEHTML" 0 :num))
67 (incf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) contents)
67 (incf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) contents)
68 (incf (ps:chain (document.get-element-by-id id) inner-text) contents)))
68 (incf (ps:chain (document.get-element-by-id id) inner-text) contents)))
69
69
@@ -81,6 +81,9 b''
81 (var result 0 :str)
81 (var result 0 :str)
82 (var result 0 :num)))
82 (var result 0 :num)))
83
83
84 (defm (root api call-loc) (name args)
85 (funcall (ps:getprop (root locs) name) args))
86
84 ;;; Text windows
87 ;;; Text windows
85
88
86 (defm (root api key-to-id) (key)
89 (defm (root api key-to-id) (key)
@@ -110,8 +113,8 b''
110 (ps:chain div (append-child (document.create-element "br")))))
113 (ps:chain div (append-child (document.create-element "br")))))
111
114
112 (defm (root api enable-frame) (key enable)
115 (defm (root api enable-frame) (key enable)
113 (let ((clss (ps:getprop (this.get-frame key) 'class-list)))
116 (let ((obj (this.get-frame key)))
114 (setf clss.style.display (if enable "block" "none"))
117 (setf obj.style.display (if enable "block" "none"))
115 (values)))
118 (values)))
116
119
117 ;;; Actions
120 ;;; Actions
@@ -131,10 +134,11 b''
131
134
132 (defm (root api update-acts) ()
135 (defm (root api update-acts) ()
133 (this.clear-id "qsp-acts")
136 (this.clear-id "qsp-acts")
134 (ps:for-in (title (root acts))
137 (let ((elt (document.get-element-by-id "qsp-acts")))
135 (let ((obj (ps:getprop (root acts) title)))
138 (ps:for-in (title (root acts))
136 (this.append-id "qsp-acts"
139 (let ((obj (ps:getprop (root acts) title)))
137 (this.make-act-html title (ps:getprop obj :img))))))
140 (incf elt.inner-h-t-m-l (this.make-act-html title (ps:getprop obj :img)))))))
141
138
142
139 ;;; "Syntax"
143 ;;; "Syntax"
140
144
@@ -205,7 +209,7 b''
205
209
206 (defm (root api var-ref) (name)
210 (defm (root api var-ref) (name)
207 (let ((local-store (this.current-local-frame)))
211 (let ((local-store (this.current-local-frame)))
208 (cond ((in name local-store)
212 (cond ((and local-store (in name local-store))
209 (ps:getprop local-store name))
213 (ps:getprop local-store name))
210 ((in name (root vars))
214 ((in name (root vars))
211 (ps:getprop (root vars) name))
215 (ps:getprop (root vars) name))
@@ -330,6 +334,7 b''
330 (document.body.remove-child element)))
334 (document.body.remove-child element)))
331
335
332 (defm (root api stash-state) (args)
336 (defm (root api stash-state) (args)
337 (api-call call-serv-loc "ONGSAVE")
333 (setf (root state-stash)
338 (setf (root state-stash)
334 (*j-s-o-n.stringify
339 (*j-s-o-n.stringify
335 (ps:create vars (root vars)
340 (ps:create vars (root vars)
@@ -359,8 +364,9 b''
359 (ps:@ data main-html))
364 (ps:@ data main-html))
360 (setf (ps:@ (document.get-element-by-id :qsp-stat) inner-h-t-m-l)
365 (setf (ps:@ (document.get-element-by-id :qsp-stat) inner-h-t-m-l)
361 (ps:@ data stat-html))
366 (ps:@ data stat-html))
362 (funcall (root locs (root current-location)) (ps:@ data loc-args))
363 (this.update-objs)
367 (this.update-objs)
368 (api-call call-serv-loc "ONGLOAD")
369 (api-call call-loc (root current-location) (ps:@ data loc-args))
364 (values)))
370 (values)))
365
371
366 (defm (root api state-to-base64) ()
372 (defm (root api state-to-base64) ()
@@ -290,7 +290,7 b''
290 ;;; misc
290 ;;; misc
291
291
292 (defm (root lib rgb) ()
292 (defm (root lib rgb) ()
293 (api-call report-error "RGB is not supported. Use HTML."))
293 (api-call report-error "RGB is not implemented."))
294
294
295 (defm (root lib openqst) ()
295 (defm (root lib openqst) ()
296 (api-call report-error "OPENQST is not supported."))
296 (api-call report-error "OPENQST is not supported."))
@@ -107,7 +107,7 b''
107
107
108 ;;; Identifiers
108 ;;; Identifiers
109
109
110 (defparameter *keywords* '(act addlib addobj addqst and arrcomp arrpos arrsize cla clear *clear close clr *clr cls cmdclear cmdclr copyarr counter countobj curacts curloc debug delact dellib delobj desc disablescroll disablesubex dynamic dyneval else elseif end exit fcolor fname for freelib fsize func getobj gosub goto gs gt if iif inclib input instr isnum isplay jump killall killobj killqst killvar lcase lcolor len let loc local maintxt max menu mid min mod msecscount msg nl *nl no nosave obj onactsel ongload ongsave onnewloc onobjadd onobjdel onobjsel opengame openqst or p *p pl *pl play qspver rand refint replace rgb rnd savegame selact selobj set settimer showacts showinput showobjs showstat stattxt step str strcomp strfind strpos to trim ucase unsel unselect usercom user_text usrtxt val view wait xgoto xgt))
110 (defparameter *keywords* '(act addlib addobj addqst and arrcomp arrpos arrsize cla clear *clear close clr *clr cls cmdclear cmdclr copyarr counter countobj curacts curloc debug delact dellib delobj desc disablescroll disablesubex dynamic dyneval else elseif end exit for freelib func getobj gosub goto gs gt if iif inclib input instr isnum isplay jump killall killobj killqst killvar lcase lcolor len let loc local maintxt max menu mid min mod msecscount msg nl *nl no nosave obj opengame openqst or p *p pl *pl play qspver rand refint replace rgb rnd savegame selact selobj set settimer showacts showinput showobjs showstat stattxt step str strcomp strfind strpos to trim ucase unsel unselect usercom user_text usrtxt val view wait xgoto xgt))
111
111
112 (defun trim-$ (str)
112 (defun trim-$ (str)
113 (if (char= #\$ (elt str 0))
113 (if (char= #\$ (elt str 0))
@@ -329,7 +329,7 b''
329 (:lambda (list)
329 (:lambda (list)
330 (apply #'append list)))
330 (apply #'append list)))
331
331
332 (p:defrule block-act-head (and (p:~ "act") spaces qsp-string spaces?
332 (p:defrule block-act-head (and (p:~ "act") spaces? qsp-string spaces?
333 (p:? block-act-head-img)
333 (p:? block-act-head-img)
334 colon spaces?)
334 colon spaces?)
335 (:lambda (list)
335 (:lambda (list)
@@ -382,7 +382,7 b''
382 (p:defrule arguments (or parenthesized-arguments plain-arguments no-arguments))
382 (p:defrule arguments (or parenthesized-arguments plain-arguments no-arguments))
383 (p:defrule parenthesized-arguments (and spaces? #\( base-arguments #\))
383 (p:defrule parenthesized-arguments (and spaces? #\( base-arguments #\))
384 (:function third))
384 (:function third))
385 (p:defrule plain-arguments (and spaces base-arguments)
385 (p:defrule plain-arguments (and spaces? base-arguments)
386 (:function second))
386 (:function second))
387 (p:defrule no-arguments (or (and spaces? (p:& #\newline))
387 (p:defrule no-arguments (or (and spaces? (p:& #\newline))
388 (and spaces? (p:& #\&))
388 (and spaces? (p:& #\&))
@@ -478,6 +478,11 b''
478 ;; Dynamic
478 ;; Dynamic
479 (dynamic nil 1 10)
479 (dynamic nil 1 10)
480 (dyneval t 1 10)
480 (dyneval t 1 10)
481 ;; Sound
482 (play nil 1 2)
483 (isplay t 1 1)
484 (close nil 1 1)
485 (closeall nil 0 0 "close all")
481 ;; Main window
486 ;; Main window
482 (main-pl nil 1 1 "*pl")
487 (main-pl nil 1 1 "*pl")
483 (main-nl nil 0 1 "*nl")
488 (main-nl nil 0 1 "*nl")
@@ -509,11 +514,6 b''
509 (getobj t 1 1)
514 (getobj t 1 1)
510 ;; Menu
515 ;; Menu
511 (menu nil 1 1)
516 (menu nil 1 1)
512 ;; Sound
513 (play nil 1 2)
514 (isplay t 1 1)
515 (close nil 1 1)
516 (closeall nil 0 0 "close all")
517 ;; Images
517 ;; Images
518 (refint nil 0 0)
518 (refint nil 0 0)
519 (view nil 0 1)
519 (view nil 0 1)
General Comments 0
You need to be logged in to leave comments. Login now