Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6e384e221 |
No files matched your search
@@ -13,7 +13,6 @@ signal image_captured(image: Image)
|
|||||||
signal burst_ended
|
signal burst_ended
|
||||||
|
|
||||||
var _input_action: String
|
var _input_action: String
|
||||||
var _toggle_shutter_action: String
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -26,29 +25,14 @@ func _ready() -> void:
|
|||||||
|
|
||||||
if only_run_in_editor and not OS.has_feature("editor"):
|
if only_run_in_editor and not OS.has_feature("editor"):
|
||||||
set_process_input(false)
|
set_process_input(false)
|
||||||
set_process(false)
|
|
||||||
hide()
|
hide()
|
||||||
return
|
return
|
||||||
|
|
||||||
_input_action = _local_data.settings.load_value("misc", "InputActionLineEdit", "")
|
_input_action = _local_data.settings.load_value("misc", "InputActionLineEdit", "")
|
||||||
_toggle_shutter_action = _local_data.settings.load_value("misc", "ToggleShutterInputActionLineEdit", "")
|
|
||||||
%ShutterButton.pressed.connect(take_burst)
|
%ShutterButton.pressed.connect(take_burst)
|
||||||
close_requested.connect(_on_close_requested)
|
close_requested.connect(_on_close_requested)
|
||||||
|
|
||||||
|
|
||||||
## Checked every frame (not via _input) because the shutter is its own native
|
|
||||||
## Window: once hidden, it stops receiving OS input entirely, and its _input()
|
|
||||||
## only ever fires while it has OS focus anyway. Input.is_action_just_pressed
|
|
||||||
## reflects global key state for the whole process, so this lets the toggle be
|
|
||||||
## pressed from the main Play window even while the shutter is hidden.
|
|
||||||
func _process(_delta: float) -> void:
|
|
||||||
if _toggle_shutter_action.is_empty() or not InputMap.has_action(_toggle_shutter_action):
|
|
||||||
return
|
|
||||||
if Input.is_action_just_pressed(_toggle_shutter_action):
|
|
||||||
visible = not visible
|
|
||||||
_local_data.settings.save("misc", "ShowShutterCheckBox", visible)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_close_requested() -> void:
|
func _on_close_requested() -> void:
|
||||||
hide()
|
hide()
|
||||||
|
|
||||||
@@ -136,6 +120,10 @@ func save_image() -> void:
|
|||||||
var play_shutter_sounds = _local_data.settings.load_value("misc", "ShutterSoundsCheckBox", true)
|
var play_shutter_sounds = _local_data.settings.load_value("misc", "ShutterSoundsCheckBox", true)
|
||||||
# Save the screenshot
|
# Save the screenshot
|
||||||
var image = get_tree().root.get_viewport().get_texture().get_image()
|
var image = get_tree().root.get_viewport().get_texture().get_image()
|
||||||
|
if get_tree().root.get_viewport().use_hdr_2d:
|
||||||
|
if image.get_format() != Image.FORMAT_RGB8:
|
||||||
|
image.convert(Image.FORMAT_RGB8)
|
||||||
|
image.linear_to_srgb()
|
||||||
image_captured.emit(image)
|
image_captured.emit(image)
|
||||||
|
|
||||||
if play_shutter_sounds:
|
if play_shutter_sounds:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ grow_vertical = 2
|
|||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
script = ExtResource("1_7ct7k")
|
script = ExtResource("1_7ct7k")
|
||||||
nodes_to_save = [NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer4/PausesGameCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer2/ShowShutterCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer3/ShutterSoundsCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer/InputActionLineEdit"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer6/ToggleShutterInputActionLineEdit"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/PNGCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/JPGCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/WEBPCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/HBoxContainer/PathLineEdit"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/HBoxContainer2/UseSubFoldersCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer5/OnlyRunInEditorCheckBox")]
|
nodes_to_save = [NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer4/PausesGameCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer2/ShowShutterCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer3/ShutterSoundsCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer/InputActionLineEdit"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/PNGCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/JPGCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/FormatsContainers/WEBPCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/HBoxContainer/PathLineEdit"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/SaveFolder/VBoxContainer/HBoxContainer2/UseSubFoldersCheckBox"), NodePath("HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer5/OnlyRunInEditorCheckBox")]
|
||||||
|
|
||||||
[node name="LocalData" type="Node" parent="."]
|
[node name="LocalData" type="Node" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
@@ -170,21 +170,6 @@ unique_name_in_owner = true
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="HBoxContainer6" type="HBoxContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer"]
|
|
||||||
layout_mode = 2
|
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer6"]
|
|
||||||
custom_minimum_size = Vector2(250, 0)
|
|
||||||
layout_mode = 2
|
|
||||||
tooltip_text = "Set an Input Action to show/hide the shutter from anywhere, including the Play window, even while it's hidden"
|
|
||||||
mouse_filter = 1
|
|
||||||
text = "Toggle shutter Input Action"
|
|
||||||
|
|
||||||
[node name="ToggleShutterInputActionLineEdit" type="LineEdit" parent="HSplitContainer/VBoxContainer/ScrollContainer/Settings/Shutter/VBoxContainer/HBoxContainer6"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
layout_mode = 2
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
|
|
||||||
[node name="Resolution" type="FoldableContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/Settings" node_paths=PackedStringArray("sizes_container")]
|
[node name="Resolution" type="FoldableContainer" parent="HSplitContainer/VBoxContainer/ScrollContainer/Settings" node_paths=PackedStringArray("sizes_container")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|||||||
Reference in new issue
Block a user