1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00
Pixelorama/src/Tools/BaseDraw.tscn
RorotoSic 8bfd474613
Add flip X and Flip Y, and Rotation (90, 180, 270) buttons to BaseTool (#988)
* Add Flip X, Flip Y, Rotate 90, Rotate 180, Rotate 270

* node placement

* flip_rotate for BrushButton

* flip corrected for BrushButton (x, y was reversed)

* code changed for github static checks

* github static checks

* github static checks 2

* remove " _ " before my variable name

hope this was the problem

* var brush_texture_rotation

* Hide Flip/Rotate buttons where it is unnecessary

* btns flip/rotate  hide when a non-image brush is selected

* rotate ButtonGroup (radio btn)

* expand button for flip/rotate

* radio btn grp 2

* expand button (forgot to add the tscn )

* cursor shape to pointing hand

* tooltip R90 R180 R270

i dont add txt to the Translations.pot bc not sure to understand and dont want to make mistake

* shading.tscn  (nodes placement debreaking)

back as before

* Revert "expand button (forgot to add the tscn )"

This reverts commit 3062afe73f.

* Revert "expand button for flip/rotate"

This reverts commit 51189ac793.

* Collapsible Container

change "expend buton" to the pixelorama custum node "CollapsibleContainer"

* remove thick white outline when CollapseContainer is pressed and focus

* styleboxflat when CollapseContainer is pressed and empty for checkbox

* Revert "styleboxflat when CollapseContainer is pressed and empty for checkbox"

This reverts commit 0af0e1f427.

* StyleboxEmpty for normal /  keep hover unchanged

* Revert "StyleboxEmpty for normal /  keep hover unchanged"

This reverts commit 14b3745053.

* Revert "remove thick white outline when CollapseContainer is pressed and focus"

This reverts commit b80ab1ad5c.

* "flip_rotateD" + "Flat CollapsibleContainer'"

* conflicts Resolved

signal color_changed(color: Color, button: int)

---------

Co-authored-by: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com>
2024-03-23 16:39:44 +02:00

128 lines
4.5 KiB
Plaintext

[gd_scene load_steps=8 format=3 uid="uid://ubyatap3sylf"]
[ext_resource type="PackedScene" uid="uid://yjhp0ssng2mp" path="res://src/UI/Nodes/ValueSlider.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://ctfgfelg0sho8" path="res://src/Tools/BaseTool.tscn" id="2"]
[ext_resource type="Script" path="res://src/Tools/BaseDraw.gd" id="3"]
[ext_resource type="Script" path="res://src/UI/Nodes/CollapsibleContainer.gd" id="3_76bek"]
[sub_resource type="ButtonGroup" id="ButtonGroup_7u3x0"]
resource_name = "rotate"
allow_unpress = true
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false
[sub_resource type="StyleBoxFlat" id="2"]
bg_color = Color(1, 1, 1, 1)
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false
[node name="ToolOptions" instance=ExtResource("2")]
script = ExtResource("3")
[node name="RotationOptions" type="VBoxContainer" parent="." index="2"]
visible = false
layout_mode = 2
theme_type_variation = &"CollapsibleContainer"
script = ExtResource("3_76bek")
text = "Rotation options"
flat = true
[node name="Flip" type="HBoxContainer" parent="RotationOptions" index="1"]
visible = false
layout_mode = 2
[node name="FlipX" type="CheckBox" parent="RotationOptions/Flip" index="0"]
layout_mode = 2
mouse_default_cursor_shape = 2
text = "Flip X"
[node name="FlipY" type="CheckBox" parent="RotationOptions/Flip" index="1"]
layout_mode = 2
mouse_default_cursor_shape = 2
text = "Flip Y"
[node name="Rotate" type="HBoxContainer" parent="RotationOptions" index="2"]
visible = false
layout_mode = 2
[node name="Rotate90" type="CheckBox" parent="RotationOptions/Rotate" index="0"]
layout_mode = 2
tooltip_text = "rotate the brush 90 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "R 90"
[node name="Rotate180" type="CheckBox" parent="RotationOptions/Rotate" index="1"]
layout_mode = 2
tooltip_text = "rotate the brush 180 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "R 180"
[node name="Rotate270" type="CheckBox" parent="RotationOptions/Rotate" index="2"]
layout_mode = 2
tooltip_text = "rotate the brush 270 degrees"
mouse_default_cursor_shape = 2
button_group = SubResource("ButtonGroup_7u3x0")
text = "R 270"
[node name="Brush" type="HBoxContainer" parent="." index="3"]
layout_mode = 2
alignment = 1
[node name="Type" type="Button" parent="Brush" index="0"]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "Select a brush"
mouse_default_cursor_shape = 2
theme_override_styles/normal = SubResource("1")
theme_override_styles/hover = SubResource("1")
theme_override_styles/pressed = SubResource("1")
theme_override_styles/disabled = SubResource("2")
theme_override_styles/focus = SubResource("2")
[node name="Texture" type="TextureRect" parent="Brush/Type" index="0"]
layout_mode = 0
offset_right = 32.0
offset_bottom = 32.0
expand_mode = 1
stretch_mode = 6
[node name="BrushSize" parent="Brush" index="1" instance=ExtResource("1")]
layout_mode = 2
min_value = 1.0
max_value = 25.0
value = 1.0
allow_greater = true
prefix = "Size:"
suffix = "px"
global_increment_action = "brush_size_increment"
global_decrement_action = "brush_size_decrement"
[node name="ColorInterpolation" parent="." index="4" instance=ExtResource("1")]
visible = false
layout_mode = 2
tooltip_text = "0: Color from the brush itself, 100: the currently selected color"
prefix = "Brush color from:"
[connection signal="toggled" from="RotationOptions/Flip/FlipX" to="." method="_on_flip_x_toggled"]
[connection signal="toggled" from="RotationOptions/Flip/FlipY" to="." method="_on_flip_y_toggled"]
[connection signal="toggled" from="RotationOptions/Rotate/Rotate90" to="." method="_on_rotate_90_toggled"]
[connection signal="toggled" from="RotationOptions/Rotate/Rotate180" to="." method="_on_rotate_180_toggled"]
[connection signal="toggled" from="RotationOptions/Rotate/Rotate270" to="." method="_on_rotate_270_toggled"]
[connection signal="pressed" from="Brush/Type" to="." method="_on_BrushType_pressed"]
[connection signal="value_changed" from="Brush/BrushSize" to="." method="_on_BrushSize_value_changed"]
[connection signal="value_changed" from="ColorInterpolation" to="." method="_on_InterpolateFactor_value_changed"]