Browse Source

updated behavior of stop running thread button to make it clickable only while a thread is running

Jonathan Higgins 3 months ago
parent
commit
bd5d8f4085
2 changed files with 3 additions and 0 deletions
  1. 1 0
      scenes/main/control.tscn
  2. 2 0
      scenes/main/scripts/run_thread.gd

+ 1 - 0
scenes/main/control.tscn

@@ -290,6 +290,7 @@ offset_left = 12.0
 offset_top = 352.0
 offset_right = 292.0
 offset_bottom = 393.0
+disabled = true
 text = "Stop Running Thread"
 
 [node name="ConsoleRightClick" type="PopupMenu" parent="Console"]

+ 2 - 0
scenes/main/scripts/run_thread.gd

@@ -34,6 +34,7 @@ func run_thread_with_branches():
 	process_successful = true
 	progress_bar.value = 0
 	progress_label.text = "Initialising Inputs"
+	console_window.find_child("KillProcess").disabled = false
 	# Detect platform: Determine if the OS is Windows
 	var is_windows := OS.get_name() == "Windows"
 	
@@ -633,6 +634,7 @@ func run_thread_with_branches():
 	progress_window.hide()
 	progress_bar.value = 0
 	progress_label.text = ""
+	console_window.find_child("KillProcess").disabled = true
 	if interface_settings.auto_close_console and process_successful == true:
 		console_window.hide()