Add reset to default button for camera settings

main
Ensar Sarajčić 2022-01-25 10:16:16 +01:00
parent bcb0647926
commit 7289cf4b09
2 changed files with 15 additions and 2 deletions

View File

@ -195,6 +195,13 @@ func _on_VehicleSelector_item_selected(item_index: int) -> void:
camera_scene.change_vehicle_to(vehicles[item_index])
func _on_ResetToDefaultButton_pressed() -> void:
fov_slider.value = 70
move_depth_slider.value = 0
move_horizontal_slider.value = 0
move_vertical_slider.value = 0
func _set_fullscreen(new_state: bool) -> void:
OS.set_window_fullscreen(new_state)
OS.set_window_maximized(new_state)

View File

@ -231,7 +231,7 @@ size_flags_horizontal = 3
split_offset = -500
[node name="Camera" type="VBoxContainer" parent="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera"]
margin_right = 129.0
margin_right = 226.0
margin_bottom = 556.0
rect_pivot_offset = Vector2( -793.71, -168 )
size_flags_horizontal = 3
@ -325,8 +325,13 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="ResetToDefaultButton" type="Button" parent="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/Camera"]
margin_right = 24.0
margin_bottom = 48.0
text = "Reset to default"
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera"]
margin_left = 153.0
margin_left = 250.0
margin_right = 952.0
margin_bottom = 556.0
@ -611,6 +616,7 @@ __meta__ = {
[connection signal="value_changed" from="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/Camera/MoveDepthSlider" to="." method="_on_MoveDepthSlider_value_changed"]
[connection signal="value_changed" from="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/Camera/MoveHorizontalSlider" to="." method="_on_MoveHorizontalSlider_value_changed"]
[connection signal="value_changed" from="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/Camera/MoveVerticalSlider" to="." method="_on_MoveVerticalSlider_value_changed"]
[connection signal="pressed" from="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/Camera/ResetToDefaultButton" to="." method="_on_ResetToDefaultButton_pressed"]
[connection signal="item_selected" from="MarginContainer/VSplitContainer/TabContainer/Video/TabContainer/Camera/VBoxContainer/VehicleSelector" to="." method="_on_VehicleSelector_item_selected"]
[connection signal="toggled" from="MarginContainer/VSplitContainer/TabContainer/Controls/Controls/AutoClutchCheckBox" to="." method="_on_autoclutch_toggled"]
[connection signal="toggled" from="MarginContainer/VSplitContainer/TabContainer/Controls/Controls/AutomaticTransmissionCheckBox" to="." method="_on_automatictransmission_toggled"]