control.gd 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. extends Control
  2. var mainmenu_visible : bool = false #used to test if mainmenu is open
  3. var effect_position = Vector2(40,40) #tracks mouse position for node placement offset
  4. @onready var graph_edit = $GraphEdit
  5. var cdpprogs_location #stores the cdp programs location from user prefs for easy access
  6. var delete_intermediate_outputs # tracks state of delete intermediate outputs toggle
  7. @onready var console_output: RichTextLabel = $Console/ConsoleOutput
  8. var undo_redo := UndoRedo.new()
  9. var output_audio_player #tracks the node that is the current output player for linking
  10. var input_audio_player #tracks node that is the current input player for linking
  11. var currentfile = "none" #tracks dir of currently loaded file for saving
  12. var changesmade = false #tracks if user has made changes to the currently loaded save file
  13. var savestate # tracks what the user is trying to do when savechangespopup is called
  14. var helpfile #tracks which help file the user was trying to load when savechangespopup is called
  15. var outfilename #links to the user name for outputfile field
  16. var foldertoggle #links to the reuse folder button
  17. var lastoutputfolder = "none" #tracks last output folder, this can in future be used to replace global.outfile but i cba right now
  18. var uiscale = 1.0 #tracks scaling for retina screens
  19. #scripts
  20. var open_help
  21. var run_thread
  22. var save_load
  23. # Called when the node enters the scene tree for the first time.
  24. func _ready() -> void:
  25. Nodes.hide()
  26. $mainmenu.hide()
  27. $NoLocationPopup.hide()
  28. $Console.hide()
  29. $NoInputPopup.hide()
  30. $MultipleConnectionsPopup.hide()
  31. $AudioSettings.hide()
  32. $AudioDevicePopup.hide()
  33. $SearchMenu.hide()
  34. $Settings.hide()
  35. $ProgressWindow.hide()
  36. $SaveDialog.access = FileDialog.ACCESS_FILESYSTEM
  37. $SaveDialog.file_mode = FileDialog.FILE_MODE_SAVE_FILE
  38. $SaveDialog.filters = ["*.thd"]
  39. $LoadDialog.access = FileDialog.ACCESS_FILESYSTEM
  40. $LoadDialog.file_mode = FileDialog.FILE_MODE_OPEN_FILE
  41. $LoadDialog.filters = ["*.thd"]
  42. get_tree().set_auto_accept_quit(false) #disable closing the app with the x and instead handle it internally
  43. load_scripts()
  44. make_signal_connections()
  45. check_user_preferences()
  46. hidpi_adjustment()
  47. new_patch()
  48. check_cdp_location_set()
  49. func load_scripts():
  50. #load and initialise scripts
  51. open_help = preload("res://scenes/main/scripts/open_help.gd").new()
  52. open_help.init(self)
  53. add_child(open_help)
  54. run_thread = preload("res://scenes/main/scripts/run_thread.gd").new()
  55. run_thread.init(self, $ProgressWindow, $ProgressWindow/ProgressLabel, $ProgressWindow/ProgressBar, $GraphEdit, $Console, $Console/ConsoleOutput)
  56. add_child(run_thread)
  57. graph_edit.init(self, $GraphEdit, Callable(open_help, "show_help_for_node"), $MultipleConnectionsPopup)
  58. save_load = preload("res://scenes/main/scripts/save_load.gd").new()
  59. save_load.init(self, $GraphEdit, Callable(open_help, "show_help_for_node"), Callable(graph_edit, "_register_node_movement"), Callable(graph_edit, "_register_inputs_in_node"), Callable(self, "link_output"))
  60. add_child(save_load)
  61. func make_signal_connections():
  62. get_node("SearchMenu").make_node.connect(graph_edit._make_node)
  63. get_node("mainmenu").make_node.connect(graph_edit._make_node)
  64. get_node("mainmenu").open_help.connect(open_help.show_help_for_node)
  65. get_node("Settings").open_cdp_location.connect(show_cdp_location)
  66. get_node("Settings").console_on_top.connect(change_console_settings)
  67. func hidpi_adjustment():
  68. #checks if display is hidpi and scales ui accordingly hidpi - 144
  69. if DisplayServer.screen_get_dpi(0) >= 144:
  70. uiscale = 2.0
  71. get_window().content_scale_factor = uiscale
  72. #goes through popup_windows group and scales all popups and resizes them
  73. for window in get_tree().get_nodes_in_group("popup_windows"):
  74. window.size = window.size * uiscale
  75. window.content_scale_factor = uiscale
  76. #checks if user has opened a file from the system file menu and loads it
  77. var args = OS.get_cmdline_args()
  78. for arg in args:
  79. var path = arg.strip_edges()
  80. if FileAccess.file_exists(path) and path.get_extension().to_lower() == "thd":
  81. save_load.load_graph_edit(path)
  82. break
  83. func new_patch():
  84. #clear old patch
  85. graph_edit.clear_connections()
  86. for node in graph_edit.get_children():
  87. if node is GraphNode:
  88. node.queue_free()
  89. await get_tree().process_frame # Wait for nodes to actually be removed
  90. graph_edit.scroll_offset = Vector2(0, 0)
  91. #Generate input and output nodes
  92. var effect: GraphNode = Nodes.get_node(NodePath("inputfile")).duplicate()
  93. effect.name = "inputfile"
  94. get_node("GraphEdit").add_child(effect, true)
  95. effect.connect("open_help", Callable(open_help, "show_help_for_node"))
  96. effect.position_offset = Vector2(20,80)
  97. effect = Nodes.get_node(NodePath("outputfile")).duplicate()
  98. effect.name = "outputfile"
  99. get_node("GraphEdit").add_child(effect, true)
  100. effect.init() #initialise ui from user prefs
  101. effect.connect("open_help", Callable(open_help, "show_help_for_node"))
  102. effect.position_offset = Vector2((DisplayServer.screen_get_size().x - 480) / uiscale, 80)
  103. graph_edit._register_node_movement() #link nodes for tracking position changes for changes tracking
  104. changesmade = false #so it stops trying to save unchanged empty files
  105. get_window().title = "SoundThread"
  106. link_output()
  107. func link_output():
  108. #links various buttons and function in the input nodes - this is called after they are created so that it still works on new and loading files
  109. for control in get_tree().get_nodes_in_group("outputnode"): #check all items in outputnode group
  110. if control.get_meta("outputfunction") == "deleteintermediate": #link delete intermediate files toggle to script
  111. control.toggled.connect(_toggle_delete)
  112. _toggle_delete(control.button_pressed)
  113. #control.button_pressed = interface_settings.get("delete_intermediate", true)
  114. elif control.get_meta("outputfunction") == "runprocess": #link runprocess button
  115. control.button_down.connect(_run_process)
  116. elif control.get_meta("outputfunction") == "audioplayer": #link output audio player
  117. output_audio_player = control
  118. elif control.get_meta("outputfunction") == "filename":
  119. control.text = "outfile"
  120. outfilename = control
  121. elif control.get_meta("outputfunction") == "reusefolder":
  122. foldertoggle = control
  123. #foldertoggle.button_pressed = interface_settings.get("reuse_output_folder", true)
  124. elif control.get_meta("outputfunction") == "openfolder":
  125. control.button_down.connect(_open_output_folder)
  126. #for control in get_tree().get_nodes_in_group("inputnode"):
  127. #if control.get_meta("inputfunction") == "audioplayer": #link input for recycle function
  128. #print("input player found")
  129. #input_audio_player = control
  130. func check_user_preferences():
  131. var interface_settings = ConfigHandler.load_interface_settings()
  132. var audio_settings = ConfigHandler.load_audio_settings()
  133. var audio_devices = AudioServer.get_output_device_list()
  134. $Console.always_on_top = interface_settings.console_on_top
  135. if audio_devices.has(audio_settings.device):
  136. AudioServer.set_output_device(audio_settings.device)
  137. else:
  138. $AudioDevicePopup.popup_centered()
  139. match interface_settings.theme:
  140. 0:
  141. RenderingServer.set_default_clear_color(Color("#2f4f4e"))
  142. 1:
  143. RenderingServer.set_default_clear_color(Color("#000807"))
  144. 2:
  145. RenderingServer.set_default_clear_color(Color("#98d4d2"))
  146. 3:
  147. RenderingServer.set_default_clear_color(Color(interface_settings.theme_custom_colour))
  148. func show_cdp_location():
  149. $CdpLocationDialog.show()
  150. func check_cdp_location_set():
  151. #checks if the location has been set and prompts user to set it
  152. var cdpprogs_settings = ConfigHandler.load_cdpprogs_settings()
  153. if cdpprogs_settings.location == "no_location":
  154. $NoLocationPopup.popup_centered()
  155. else:
  156. #if location is set, stores it in a variable
  157. cdpprogs_location = str(cdpprogs_settings.location)
  158. print(cdpprogs_location)
  159. func _on_ok_button_button_down() -> void:
  160. #after user has read dialog on where to find cdp progs this loads the file browser
  161. $NoLocationPopup.hide()
  162. if OS.get_name() == "Windows":
  163. $CdpLocationDialog.current_dir = "C:/"
  164. else:
  165. $CdpLocationDialog.current_dir = OS.get_environment("HOME")
  166. $CdpLocationDialog.show()
  167. func _on_cdp_location_dialog_dir_selected(dir: String) -> void:
  168. #saves default location for cdp programs in config file
  169. ConfigHandler.save_cdpprogs_settings(dir)
  170. cdpprogs_location = dir
  171. func _on_cdp_location_dialog_canceled() -> void:
  172. #cycles around the set location prompt if user cancels the file dialog
  173. check_cdp_location_set()
  174. func _input(event):
  175. if event.is_action_pressed("undo"):
  176. simulate_mouse_click()
  177. await get_tree().process_frame
  178. undo_redo.undo()
  179. elif event.is_action_pressed("redo"):
  180. undo_redo.redo()
  181. elif event.is_action_pressed("save"):
  182. if currentfile == "none":
  183. savestate = "saveas"
  184. $SaveDialog.popup_centered()
  185. else:
  186. save_load.save_graph_edit(currentfile)
  187. elif event.is_action_pressed("open_explore"):
  188. open_explore()
  189. func simulate_mouse_click():
  190. #simulates clicking the middle mouse button in order to hide any visible tooltips
  191. var click_pos = get_viewport().get_mouse_position()
  192. var down_event := InputEventMouseButton.new()
  193. down_event.button_index = MOUSE_BUTTON_MIDDLE
  194. down_event.pressed = true
  195. down_event.position = click_pos
  196. Input.parse_input_event(down_event)
  197. var up_event := InputEventMouseButton.new()
  198. up_event.button_index = MOUSE_BUTTON_MIDDLE
  199. up_event.pressed = false
  200. up_event.position = click_pos
  201. Input.parse_input_event(up_event)
  202. func _run_process() -> void:
  203. #check if any of the inputfile nodes don't have files loaded
  204. for node in graph_edit.get_children():
  205. if node.get_meta("command") == "inputfile" and node.get_node("AudioPlayer").has_meta("inputfile") == false:
  206. $NoInputPopup.popup_centered()
  207. return
  208. #check if the reuse folder toggle is set and a folder has been previously chosen
  209. if foldertoggle.button_pressed == true and lastoutputfolder != "none":
  210. _on_file_dialog_dir_selected(lastoutputfolder)
  211. else:
  212. $FileDialog.show()
  213. func _on_file_dialog_dir_selected(dir: String) -> void:
  214. lastoutputfolder = dir
  215. console_output.clear()
  216. var interface_settings = ConfigHandler.load_interface_settings()
  217. if interface_settings.disable_progress_bar == false:
  218. $ProgressWindow.show()
  219. else:
  220. if $Console.is_visible():
  221. $Console.hide()
  222. await get_tree().process_frame # Wait a frame to allow hide to complete
  223. $Console.popup_centered()
  224. else:
  225. $Console.popup_centered()
  226. await get_tree().process_frame
  227. run_thread.log_console("Generating processing queue", true)
  228. await get_tree().process_frame
  229. #get the current time in hh-mm-ss format as default : causes file name issues
  230. var time_dict = Time.get_time_dict_from_system()
  231. # Pad with zeros to ensure two digits for hour, minute, second
  232. var hour = str(time_dict.hour).pad_zeros(2)
  233. var minute = str(time_dict.minute).pad_zeros(2)
  234. var second = str(time_dict.second).pad_zeros(2)
  235. var time_str = hour + "-" + minute + "-" + second
  236. Global.outfile = dir + "/" + outfilename.text.get_basename() + "_" + Time.get_date_string_from_system() + "_" + time_str
  237. run_thread.log_console("Output directory and file name(s):" + Global.outfile, true)
  238. await get_tree().process_frame
  239. run_thread.run_thread_with_branches()
  240. func _toggle_delete(toggled_on: bool):
  241. delete_intermediate_outputs = toggled_on
  242. print(toggled_on)
  243. func _on_console_close_requested() -> void:
  244. $Console.hide()
  245. func _on_console_open_folder_button_down() -> void:
  246. $Console.hide()
  247. OS.shell_open(Global.outfile.get_base_dir())
  248. func _on_ok_button_2_button_down() -> void:
  249. $NoInputPopup.hide()
  250. func _on_ok_button_3_button_down() -> void:
  251. $MultipleConnectionsPopup.hide()
  252. func _on_settings_button_index_pressed(index: int) -> void:
  253. var interface_settings = ConfigHandler.load_interface_settings()
  254. match index:
  255. 0:
  256. $Settings.popup_centered()
  257. 1:
  258. $AudioSettings.popup_centered()
  259. 2:
  260. if $Console.is_visible():
  261. $Console.hide()
  262. await get_tree().process_frame # Wait a frame to allow hide to complete
  263. $Console.popup_centered()
  264. else:
  265. $Console.popup_centered()
  266. func _on_file_button_index_pressed(index: int) -> void:
  267. match index:
  268. 0:
  269. if changesmade == true:
  270. savestate = "newfile"
  271. $SaveChangesPopup.popup_centered()
  272. else:
  273. new_patch()
  274. currentfile = "none" #reset current file to none for save tracking
  275. print("new patch, changes made =")
  276. print(changesmade)
  277. print("current file =")
  278. print(currentfile)
  279. 1:
  280. if currentfile == "none":
  281. savestate = "saveas"
  282. $SaveDialog.popup_centered()
  283. else:
  284. save_load.save_graph_edit(currentfile)
  285. print("save pressed, changes made =")
  286. print(changesmade)
  287. print("current file =")
  288. print(currentfile)
  289. 2:
  290. savestate = "saveas"
  291. $SaveDialog.popup_centered()
  292. 3:
  293. if changesmade == true:
  294. savestate = "load"
  295. $SaveChangesPopup.popup_centered()
  296. else:
  297. $LoadDialog.popup_centered()
  298. func _on_save_dialog_file_selected(path: String) -> void:
  299. save_load.save_graph_edit(path) #save file
  300. #check what the user was trying to do before save and do that action
  301. if savestate == "newfile":
  302. new_patch()
  303. currentfile = "none" #reset current file to none for save tracking
  304. elif savestate == "load":
  305. $LoadDialog.popup_centered()
  306. elif savestate == "helpfile":
  307. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  308. save_load.load_graph_edit(helpfile)
  309. elif savestate == "quit":
  310. await get_tree().create_timer(0.25).timeout #little pause so that it feels like it actually saved even though it did
  311. get_tree().quit()
  312. elif savestate == "saveas":
  313. currentfile = path
  314. savestate = "none" #reset save state, not really needed but feels good
  315. func _on_load_dialog_file_selected(path: String) -> void:
  316. currentfile = path #tracking path here only means "save" only saves patches the user has loaded rather than overwriting help files
  317. save_load.load_graph_edit(path)
  318. func _on_help_button_index_pressed(index: int) -> void:
  319. match index:
  320. 0:
  321. pass
  322. 1:
  323. if changesmade == true:
  324. savestate = "helpfile"
  325. helpfile = "res://examples/getting_started.thd"
  326. $SaveChangesPopup.popup_centered()
  327. else:
  328. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  329. save_load.load_graph_edit("res://examples/getting_started.thd")
  330. 2:
  331. if changesmade == true:
  332. savestate = "helpfile"
  333. helpfile = "res://examples/navigating.thd"
  334. $SaveChangesPopup.popup_centered()
  335. else:
  336. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  337. save_load.load_graph_edit("res://examples/navigating.thd")
  338. 3:
  339. if changesmade == true:
  340. savestate = "helpfile"
  341. helpfile = "res://examples/building_a_thread.thd"
  342. $SaveChangesPopup.popup_centered()
  343. else:
  344. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  345. save_load.load_graph_edit("res://examples/building_a_thread.thd")
  346. 4:
  347. if changesmade == true:
  348. savestate = "helpfile"
  349. helpfile = "res://examples/frequency_domain.thd"
  350. $SaveChangesPopup.popup_centered()
  351. else:
  352. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  353. save_load.load_graph_edit("res://examples/frequency_domain.thd")
  354. 5:
  355. if changesmade == true:
  356. savestate = "helpfile"
  357. helpfile = "res://examples/automation.thd"
  358. $SaveChangesPopup.popup_centered()
  359. else:
  360. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  361. save_load.load_graph_edit("res://examples/automation.thd")
  362. 6:
  363. if changesmade == true:
  364. savestate = "helpfile"
  365. helpfile = "res://examples/trimming.thd"
  366. $SaveChangesPopup.popup_centered()
  367. else:
  368. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  369. save_load.load_graph_edit("res://examples/trimming.thd")
  370. 7:
  371. pass
  372. 8:
  373. if changesmade == true:
  374. savestate = "helpfile"
  375. helpfile = "res://examples/wetdry.thd"
  376. $SaveChangesPopup.popup_centered()
  377. else:
  378. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  379. save_load.load_graph_edit("res://examples/wetdry.thd")
  380. 9:
  381. if changesmade == true:
  382. savestate = "helpfile"
  383. helpfile = "res://examples/resonant_filters.thd"
  384. $SaveChangesPopup.popup_centered()
  385. else:
  386. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  387. save_load.load_graph_edit("res://examples/resonant_filters.thd")
  388. 10:
  389. pass
  390. 11:
  391. OS.shell_open("https://www.composersdesktop.com/docs/html/ccdpndex.htm")
  392. 12:
  393. OS.shell_open("https://github.com/j-p-higgins/SoundThread/issues")
  394. #func _recycle_outfile():
  395. #if outfile != "no file":
  396. #input_audio_player.recycle_outfile(outfile)
  397. func _on_save_changes_button_down() -> void:
  398. $SaveChangesPopup.hide()
  399. if currentfile == "none":
  400. $SaveDialog.show()
  401. else:
  402. save_load.save_graph_edit(currentfile)
  403. if savestate == "newfile":
  404. new_patch()
  405. currentfile = "none" #reset current file to none for save tracking
  406. elif savestate == "load":
  407. $LoadDialog.popup_centered()
  408. elif savestate == "helpfile":
  409. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  410. save_load.load_graph_edit(helpfile)
  411. elif savestate == "quit":
  412. await get_tree().create_timer(0.25).timeout #little pause so that it feels like it actually saved even though it did
  413. get_tree().quit()
  414. savestate = "none"
  415. func _on_dont_save_changes_button_down() -> void:
  416. $SaveChangesPopup.hide()
  417. if savestate == "newfile":
  418. new_patch()
  419. currentfile = "none" #reset current file to none for save tracking
  420. elif savestate == "load":
  421. $LoadDialog.popup_centered()
  422. elif savestate == "helpfile":
  423. currentfile = "none" #reset current file to none for save tracking so user cant save over help file
  424. save_load.load_graph_edit(helpfile)
  425. elif savestate == "quit":
  426. get_tree().quit()
  427. savestate = "none"
  428. func _notification(what):
  429. if what == NOTIFICATION_WM_CLOSE_REQUEST:
  430. run_thread._on_kill_process_button_down()
  431. $Console.hide()
  432. if changesmade == true:
  433. savestate = "quit"
  434. $SaveChangesPopup.popup_centered()
  435. #$HelpWindow.hide()
  436. else:
  437. get_tree().quit() # default behavior
  438. func _open_output_folder():
  439. if lastoutputfolder != "none":
  440. OS.shell_open(lastoutputfolder)
  441. func _on_rich_text_label_meta_clicked(meta: Variant) -> void:
  442. print(str(meta))
  443. OS.shell_open(str(meta))
  444. func _on_graph_edit_popup_request(at_position: Vector2) -> void:
  445. effect_position = graph_edit.get_local_mouse_position()
  446. #get the mouse position in screen coordinates
  447. var mouse_screen_pos = DisplayServer.mouse_get_position()
  448. #get the window position in screen coordinates
  449. var window_screen_pos = get_window().position
  450. #get the window size relative to its scaling for retina displays
  451. var window_size = get_window().size * DisplayServer.screen_get_scale()
  452. #calculate the xy position of the mouse clamped to the size of the window and menu so it doesn't go off the screen
  453. var clamped_x = clamp(mouse_screen_pos.x, window_screen_pos.x, window_screen_pos.x + window_size.x - $SearchMenu.size.x)
  454. var clamped_y = clamp(mouse_screen_pos.y, window_screen_pos.y, window_screen_pos.y + window_size.y - (420 * DisplayServer.screen_get_scale()))
  455. #position and show the menu
  456. $SearchMenu.position = Vector2(clamped_x, clamped_y)
  457. $SearchMenu.popup()
  458. func _on_audio_settings_close_requested() -> void:
  459. $AudioSettings.hide()
  460. func _on_open_audio_settings_button_down() -> void:
  461. $AudioDevicePopup.hide()
  462. $AudioSettings.popup_centered()
  463. func _on_audio_device_popup_close_requested() -> void:
  464. $AudioDevicePopup.hide()
  465. func _on_mainmenu_close_requested() -> void:
  466. #closes menu if click is anywhere other than the menu as it is a window with popup set to true
  467. $mainmenu.hide()
  468. func open_explore():
  469. effect_position = graph_edit.get_local_mouse_position()
  470. #get the mouse position in screen coordinates
  471. var mouse_screen_pos = DisplayServer.mouse_get_position()
  472. #get the window position in screen coordinates
  473. var window_screen_pos = get_window().position
  474. #get the window size relative to its scaling for retina displays
  475. var window_size = get_window().size * DisplayServer.screen_get_scale()
  476. #get the size of the popup menu
  477. var popup_size = $mainmenu.size
  478. #calculate the xy position of the mouse clamped to the size of the window and menu so it doesn't go off the screen
  479. var clamped_x = clamp(mouse_screen_pos.x, window_screen_pos.x, window_screen_pos.x + window_size.x - popup_size.x)
  480. var clamped_y = clamp(mouse_screen_pos.y, window_screen_pos.y, window_screen_pos.y + window_size.y - popup_size.y)
  481. #position and show the menu
  482. $mainmenu.position = Vector2(clamped_x, clamped_y)
  483. $mainmenu.popup()
  484. func change_console_settings(toggled: bool):
  485. $Console.always_on_top = toggled
  486. func _on_kill_process_button_down() -> void:
  487. run_thread._on_kill_process_button_down()