Show More
@@ -1,4 +1,8 b'' | |||
|
1 | 1 | |
|
2 | * Remove cl-uglify-js (no support for ES6 at all and no way to monkey-patch it reliably) | |
|
3 | * Use Parenscript's async/await | |
|
4 | * Use Parenscript's minifier | |
|
5 | * WAIT and MENU with async/await | |
|
2 | 6 | * Special locations |
|
3 | 7 | * Special variables |
|
4 | 8 | * CLI build for Linux |
@@ -8,4 +12,4 b'' | |||
|
8 | 12 | * Windows GUI (for the compiler) |
|
9 | 13 | * Save-load game in slots |
|
10 | 14 | * Resizable frames |
|
11 | ** modifying it to suit compiler specifics No newline at end of file | |
|
15 | ** modifying it to suit compiler specifics |
@@ -49,23 +49,30 b'' | |||
|
49 | 49 | |
|
50 | 50 | ;;; Misc |
|
51 | 51 | |
|
52 | (defm (root api newline) (key) | |
|
53 | (this.append-id (this.key-to-id key) "<br>" t)) | |
|
54 | ||
|
52 | 55 | (defm (root api clear-id) (id) |
|
53 |
(setf (ps:chain document (get-element-by-id id) inner- |
|
|
56 | (setf (ps:chain document (get-element-by-id id) inner-h-t-m-l) "")) | |
|
57 | ||
|
58 | (setf (root api text-escaper) (document.create-element :textarea)) | |
|
59 | ||
|
60 | (defm (root api prepare-contents) (s &optional force-html) | |
|
61 | (if (or force-html (var "USEHTML" 0 :num)) | |
|
62 | s | |
|
63 | (progn | |
|
64 | (setf (ps:@ (root api text-escaper) text-content) s) | |
|
65 | (ps:@ (root api text-escaper) inner-h-t-m-l)))) | |
|
54 | 66 | |
|
55 | 67 | (defm (root api get-id) (id &optional force-html) |
|
56 | (if (or force-html (var "USEHTML" 0 :num)) | |
|
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))) | |
|
68 | (ps:chain (document.get-element-by-id id) inner-h-t-m-l)) | |
|
59 | 69 | |
|
60 | 70 | (defm (root api set-id) (id contents &optional force-html) |
|
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) | |
|
63 | (setf (ps:chain (document.get-element-by-id id) inner-text) contents))) | |
|
71 | (setf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) (this.prepare-contents contents force-html))) | |
|
64 | 72 | |
|
65 | 73 | (defm (root api append-id) (id contents &optional force-html) |
|
66 | (if (or force-html (var "USEHTML" 0 :num)) | |
|
67 |
|
|
|
68 | (incf (ps:chain (document.get-element-by-id id) inner-text) contents))) | |
|
74 | (when contents | |
|
75 | (incf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) (this.prepare-contents contents force-html)))) | |
|
69 | 76 | |
|
70 | 77 | ;;; Function calls |
|
71 | 78 | |
@@ -108,10 +115,6 b'' | |||
|
108 | 115 | (defm (root api clear-text) (key) |
|
109 | 116 | (this.clear-id (this.key-to-id key))) |
|
110 | 117 | |
|
111 | (defm (root api newline) (key) | |
|
112 | (let ((div (this.get-frame key))) | |
|
113 | (ps:chain div (append-child (document.create-element "br"))))) | |
|
114 | ||
|
115 | 118 | (defm (root api enable-frame) (key enable) |
|
116 | 119 | (let ((obj (this.get-frame key))) |
|
117 | 120 | (setf obj.style.display (if enable "block" "none")) |
@@ -289,8 +289,13 b'' | |||
|
289 | 289 | |
|
290 | 290 | ;;; misc |
|
291 | 291 | |
|
292 | (defm (root lib rgb) () | |
|
293 | (api-call report-error "RGB is not implemented.")) | |
|
292 | (defm (root lib rgb) (red green blue) | |
|
293 | (flet ((rgb-to-hex (comp) | |
|
294 | (let ((hex (ps:chain (*number comp) (to-string 16)))) | |
|
295 | (if (< (length hex) 2) | |
|
296 | (+ "0" hex) | |
|
297 | hex)))) | |
|
298 | (+ "#" (rgb-to-hex red) (rgb-to-hex green) (rgb-to-hex red)))) | |
|
294 | 299 | |
|
295 | 300 | (defm (root lib openqst) () |
|
296 | 301 | (api-call report-error "OPENQST is not supported.")) |
General Comments 0
You need to be logged in to leave comments.
Login now