tidy + fixes
This commit is contained in:
parent
8a1b5c647c
commit
e8c964662f
7
HUD.gd
7
HUD.gd
@ -26,9 +26,12 @@ func _process(delta):
|
||||
var time_string = "%02d:%02d:%02d" % [hours, minutes, seconds] # Format time as H:M:S
|
||||
var fps = Engine.get_frames_per_second() # Get the current FPS
|
||||
$HBoxContainer/Debug.text = time_string+" "+str(fps) + " fps" # Combine FPS and runtime into one string
|
||||
if %Map.controlling and is_instance_valid(%Map.controlling) and %Map.controlling==self:
|
||||
$HBoxContainer/Debug.text += str(%Map.controlling.health) # Combine FPS and runtime into one string
|
||||
if %Map.controlling and is_instance_valid(%Map.controlling):
|
||||
$HBoxContainer/Debug.text += " [H:"+str(%Map.controlling.health)+"]"
|
||||
|
||||
func _on_settings_window_close_requested():
|
||||
print("close")
|
||||
$"../SettingsWindow".hide()
|
||||
|
||||
func _on_control_stop_button_pressed():
|
||||
%Map.controlling=null
|
||||
|
2
Map.gd
2
Map.gd
@ -52,7 +52,7 @@ func spawn(pos,vol):
|
||||
var results = space_state.intersect_point(query_params, 32) # Adjust max_results as needed
|
||||
for result in results:
|
||||
result.collider.queue_free()
|
||||
if tool.name=="Control":
|
||||
if tool.name=="Control Player":
|
||||
var closest_node = null
|
||||
var min_distance = INF # Infinite distance initially
|
||||
for node in %Map.get_children():
|
||||
|
7
hud.tscn
7
hud.tscn
@ -117,9 +117,13 @@ layout_mode = 2
|
||||
[node name="Delete" type="VBoxContainer" parent="HBoxContainer/ToolSelect/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Control" type="VBoxContainer" parent="HBoxContainer/ToolSelect/VBoxContainer"]
|
||||
[node name="Control Player" type="VBoxContainer" parent="HBoxContainer/ToolSelect/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="HBoxContainer/ToolSelect/VBoxContainer/Control Player"]
|
||||
layout_mode = 2
|
||||
text = "Stop"
|
||||
|
||||
[node name="Debug" type="Label" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
@ -146,3 +150,4 @@ popup/item_4/text = "Settings..."
|
||||
popup/item_4/id = 4
|
||||
|
||||
[connection signal="item_selected" from="HBoxContainer/ToolSelect/VBoxContainer/OptionButton" to="HBoxContainer/ToolSelect" method="_on_option_button_item_selected"]
|
||||
[connection signal="pressed" from="HBoxContainer/ToolSelect/VBoxContainer/Control Player/Button" to="." method="_on_control_stop_button_pressed"]
|
||||
|
Loading…
Reference in New Issue
Block a user