mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 12:14:24 +02:00
feat(web): re-enable web exports
This commit is contained in:
parent
fcad5d64b9
commit
ff95b60a56
26 changed files with 940 additions and 4887 deletions
|
@ -25,7 +25,7 @@ var menu_items := [
|
|||
"scene":
|
||||
(
|
||||
preload("../web_console/web_console.tscn")
|
||||
if OS.has_feature("JavaScript")
|
||||
if OS.has_feature("web")
|
||||
else preload("../terminal/terminal.tscn")
|
||||
)
|
||||
},
|
||||
|
@ -157,18 +157,16 @@ func _on_Terminal_key_pressed(data: String, event: InputEventKey) -> void:
|
|||
)
|
||||
return
|
||||
var scene = item.scene.instantiate()
|
||||
var pty = scene if OS.has_feature("JavaScript") else scene.get_node("PTY")
|
||||
var pty = scene if OS.has_feature("web") else scene.get_node("PTY")
|
||||
add_child(scene)
|
||||
scene.grab_focus()
|
||||
await pty.exited
|
||||
$Terminal.grab_focus()
|
||||
scene.queue_free()
|
||||
"Exit":
|
||||
pass
|
||||
# FIXME
|
||||
#if OS.has_feature("JavaScript"):
|
||||
#JavaScript.eval("window.history.back() || window.close()")
|
||||
#get_tree().quit()
|
||||
if OS.has_feature("web"):
|
||||
JavaScriptBridge.eval("window.history.back() || window.close()")
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_Asciicast_key_pressed(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue