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 | * Special locations |
|
6 | * Special locations | |
3 | * Special variables |
|
7 | * Special variables | |
4 | * CLI build for Linux |
|
8 | * CLI build for Linux | |
@@ -8,4 +12,4 b'' | |||||
8 | * Windows GUI (for the compiler) |
|
12 | * Windows GUI (for the compiler) | |
9 | * Save-load game in slots |
|
13 | * Save-load game in slots | |
10 | * Resizable frames |
|
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 | ;;; Misc |
|
50 | ;;; Misc | |
51 |
|
51 | |||
|
52 | (defm (root api newline) (key) | |||
|
53 | (this.append-id (this.key-to-id key) "<br>" t)) | |||
|
54 | ||||
52 | (defm (root api clear-id) (id) |
|
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 | (defm (root api get-id) (id &optional force-html) |
|
67 | (defm (root api get-id) (id &optional force-html) | |
56 | (if (or force-html (var "USEHTML" 0 :num)) |
|
68 | (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))) |
|
|||
59 |
|
69 | |||
60 | (defm (root api set-id) (id contents &optional force-html) |
|
70 | (defm (root api set-id) (id contents &optional force-html) | |
61 | (if (or force-html (var "USEHTML" 0 :num)) |
|
71 | (setf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) (this.prepare-contents contents force-html))) | |
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))) |
|
|||
64 |
|
72 | |||
65 | (defm (root api append-id) (id contents &optional force-html) |
|
73 | (defm (root api append-id) (id contents &optional force-html) | |
66 | (if (or force-html (var "USEHTML" 0 :num)) |
|
74 | (when contents | |
67 |
|
|
75 | (incf (ps:chain (document.get-element-by-id id) inner-h-t-m-l) (this.prepare-contents contents force-html)))) | |
68 | (incf (ps:chain (document.get-element-by-id id) inner-text) contents))) |
|
|||
69 |
|
76 | |||
70 | ;;; Function calls |
|
77 | ;;; Function calls | |
71 |
|
78 | |||
@@ -108,10 +115,6 b'' | |||||
108 | (defm (root api clear-text) (key) |
|
115 | (defm (root api clear-text) (key) | |
109 | (this.clear-id (this.key-to-id key))) |
|
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 | (defm (root api enable-frame) (key enable) |
|
118 | (defm (root api enable-frame) (key enable) | |
116 | (let ((obj (this.get-frame key))) |
|
119 | (let ((obj (this.get-frame key))) | |
117 | (setf obj.style.display (if enable "block" "none")) |
|
120 | (setf obj.style.display (if enable "block" "none")) |
@@ -289,8 +289,13 b'' | |||||
289 |
|
289 | |||
290 | ;;; misc |
|
290 | ;;; misc | |
291 |
|
291 | |||
292 | (defm (root lib rgb) () |
|
292 | (defm (root lib rgb) (red green blue) | |
293 | (api-call report-error "RGB is not implemented.")) |
|
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 | (defm (root lib openqst) () |
|
300 | (defm (root lib openqst) () | |
296 | (api-call report-error "OPENQST is not supported.")) |
|
301 | (api-call report-error "OPENQST is not supported.")) |
@@ -6,6 +6,7 b'' | |||||
6 | :pathname "src/" |
|
6 | :pathname "src/" | |
7 | :serial t |
|
7 | :serial t | |
8 | :components ((:file "package") |
|
8 | :components ((:file "package") | |
|
9 | (:file "patches") | |||
9 | (:file "ps-macros") |
|
10 | (:file "ps-macros") | |
10 | (:file "intrinsic-macros") |
|
11 | (:file "intrinsic-macros") | |
11 | (:file "class") |
|
12 | (:file "class") |
General Comments 0
You need to be logged in to leave comments.
Login now