summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-08-18 10:24:36 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-16 11:42:07 +0100
commit0bec85079add5fe0cda8106ed18ef282e174691c (patch)
treee51f5c264cee9b01050de34aefee5cc222cf9a9e
parent062a5764dba899ed2215e4d55dead2919e64c98c (diff)
download1989-dawn-of-freedom-0bec85079add5fe0cda8106ed18ef282e174691c.tar.gz
feat: working on vm_prompt
-rw-r--r--rules.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 0973f0d..4fac33b 100644
--- a/rules.js
+++ b/rules.js
@@ -3255,6 +3255,30 @@ function vm_endif() {
vm_next()
}
+function event_prompt(str) {
+ if (typeof str === "undefined")
+ str = CODE[game.vm.fp][game.vm.prompt][1]
+ if (typeof str === "function")
+ str = str()
+ view.prompt = data.card_title[this_card()] + ": " + str
+}
+
+function vm_prompt() {
+ if (game.vm.prompt)
+ game.vm._prompt = game.vm.prompt
+ game.vm.prompt = game.vm.ip
+ vm_next()
+}
+
+function pop_vm_prompt() {
+ if (game.vm._prompt) {
+ game.vm.prompt = game.vm._prompt
+ delete game.vm._prompt
+ } else {
+ game.vm.prompt = 0
+ }
+}
+
function vm_return() {
/* let return_vm = game.vm.return_vm;
console.log('in vm_return')