1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-07-22 20:29:37 +00:00
8bitworkshop/gen/zmachine-AHTXFQQ6.js

3 lines
10 KiB
JavaScript
Raw Normal View History

import{a as f,b as m}from"./chunk-3XE5YOCV.js";import{x as h}from"./chunk-GKVIY6GD.js";import{D as l,H as _,Q as d}from"./chunk-YL2YTMD7.js";import"./chunk-RQFURXHW.js";var x=[{id:"hello.inf",name:"Hello World"},{id:"house01.inf",name:"House Tutorial #1"},{id:"house02.inf",name:"House Tutorial #2"},{id:"house03.inf",name:"House Tutorial #3"},{id:"house04.inf",name:"House Tutorial #4"},{id:"house05.inf",name:"House Tutorial #5"},{id:"house06.inf",name:"House Tutorial #6"},{id:"house07.inf",name:"House Tutorial #7"},{id:"alice.inf",name:"Through the Looking-Glass"},{id:"aloneice.inf",name:"Alone on the Ice"},{id:"adventureland.inf",name:"Adventureland"},{id:"toyshop.inf",name:"Toyshop"},{id:"ruins1.inf",name:"Ruins #1"},{id:"ruins2.inf",name:"Ruins #2"},{id:"ruins3.inf",name:"Ruins #3"},{id:"balances.inf",name:"Balances"},{id:"museum.inf",name:"Museum of Inform"},{id:"advent.inf",name:"Colossal Cave Adventure"},{id:"ztrek.inf",name:"Super Z Trek"}];function i(...u){}var c=class{constructor(e,t,n){this.exited=!1;this.DidNotReturn={dummy:"Glk call has not yet returned"};this.RefBox=g;this.RefStruct=p;this.mainwnd=new m(e,!1,t),this.mainwnd.keepinput=!1,this.mainwnd.splitInput=!1,this.mainwnd.uppercaseOnly=!0,this.mainwnd.hideinput(),this.windows={1:this.mainwnd,2:new f(n,!0),3:new f(null,!0)},this.input=t,this.mainwnd.resolveInput=r=>{var s=r.line;if(this.vm.read_data.buffer){for(var o=0;o<s.length;o++)this.vm.read_data.buffer[o]=s.charCodeAt(o)&255;this.vm.handle_line_input(s.length)}else this.vm.handle_char_input(s.charCodeAt(0));this.vm.run()},this.reset()}reset(){this.windowcount=0,this.exited=!1,this.windows[1].clear(),this.windows[2].clear(),this.curwnd=this.windows[1]}init(e){this.vm=e.vm,this.vm.start()}fatal_error(e){throw new d(e)}update(){}focusinput(){this.mainwnd.focusinput()}flushline(){this.curwnd.flushline()}glk_exit(){this.exited=!0,this.flushline(),this.windows[1].addtext("** Game exited **",1)}glk_window_clear(e){i("glk_window_clear",arguments),this.windows[e].clear()}glk_request_line_event_uni(e,t,n){this.mainwnd.waitingfor="line",this.focusinput(),this.startinputtimer()}glk_request_char_event_uni(e,t,n){this.mainwnd.waitingfor="char",this.focusinput(),this.startinputtimer()}startinputtimer(){}glk_put_jstring(e,t){this.curwnd.print(e)}glk_put_jstring_stream(e,t){this.windows[e].print(t)}glk_put_char_stream_uni(e,t){this.windows[e].print(String.fromCharCode(t))}glk_set_style(e){this.curwnd.curstyle=e}glk_char_to_lower(e){return e>=65&&e<=90||e>=192&&e<=222&&e!=215?e+32:e}glk_char_to_upper(e){return e>=97&&e<=122||e>=224&&e<=254&&e!=247?e-32:e}glk_stylehint_set(e,t,n,r){}glk_stylehint_clear(e,t,n){}glk_style_distinguish(e,t,n){return 0}glk_style_measure(e,t,n,r){return r&&r.set_value(0),0}glk_select(e){i("glk_select",arguments)}glk_window_open(e,t,n,r,s){return i("glk_window_open",arguments),e?t!=18||r!=4?0:n?($(this.windows[2].page).show(),2):3:1}glk_window_close(e){i("glk_window_close",arguments),e==2&&(this.windows[e].clear(),$(this.windows[e].page).hide())}glk_window_get_parent(e){return i("glk_window_get_parent",arguments),e==1?0:1}glk_window_move_cursor(e,t,n){i("glk_window_move_cursor",arguments),this.windows[e].move_cursor(t,n)}glk_window_set_arrangement(e,t,n,r){i("glk_window_set_arrangement",arguments),e==1&&this.windows[2].setrows(n)}glk_window_get_stream(e){return i("glk_window_get_stream",arguments),e}glk_set_window(e){i("glk_set_window",arguments),this.curwnd=this.windows[e],this.curwnd==null&&this.fatal_error("no window "+e)}glk_window_get_size(e,t,n){i("glk_window_get_size",arguments),t&&t.set_value(y),n&&n.set_value(e==1?25:1)}garglk_set_reversevideo(e){i("garglk_set_reversevideo",arguments),this.curwnd.reverse=!!e}garglk_set_reversevideo_stream(e,t){i("garglk_set_reversevideo_stream",arguments),this.windows[e].reverse=!!t}glk_fileref_create_by_prompt(e,t,n){i("glk_fileref_create_by_prompt",arguments),this.vm.handle_create_fileref(0),this.vm.run()}glk_gestalt(e,t){return this.glk_gestalt_ext(e,t,null)}glk_gestalt_ext(e,t,n){switch(e){case 0:return 257;case 1:return t<=a.keycode_Left&&t>=a.
//# sourceMappingURL=zmachine-AHTXFQQ6.js.map