1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Added guide color in Preferences

This commit is contained in:
OverloadedOrama 2019-12-27 02:28:36 +02:00
parent a3fcfc4597
commit f81ef37e92
6 changed files with 29 additions and 3 deletions

View file

@ -37,10 +37,11 @@ size_flags_horizontal = 3
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
margin_right = 205.0
margin_bottom = 282.0
margin_bottom = 454.0
size_flags_horizontal = 3
[node name="Languages" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
editor/display_folded = true
margin_right = 205.0
margin_bottom = 282.0
@ -117,6 +118,7 @@ custom_fonts/font = ExtResource( 3 )
text = "繁體中文 [zh_TW]"
[node name="Themes" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
editor/display_folded = true
margin_right = 40.0
margin_bottom = 40.0
@ -162,6 +164,7 @@ mouse_default_cursor_shape = 2
text = "Light"
[node name="Grid&Guides" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
editor/display_folded = true
visible = false
margin_top = 24.0
margin_right = 151.0
@ -223,7 +226,22 @@ margin_top = 56.0
margin_right = 124.0
margin_bottom = 76.0
rect_min_size = Vector2( 64, 20 )
[node name="GuideColorLabel" type="Label" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
margin_top = 59.0
margin_right = 46.0
margin_bottom = 73.0
text = "Guide color:"
[node name="GuideColor" type="ColorPickerButton" parent="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions"]
margin_left = 50.0
margin_top = 56.0
margin_right = 124.0
margin_bottom = 76.0
rect_min_size = Vector2( 64, 20 )
color = Color( 0.63, 0.13, 0.94, 1 )
[connection signal="item_selected" from="HSplitContainer/Tree" to="." method="_on_Tree_item_selected"]
[connection signal="value_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridWidthValue" to="." method="_on_GridWidthValue_value_changed"]
[connection signal="value_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridHeightValue" to="." method="_on_GridHeightValue_value_changed"]
[connection signal="color_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GridColor" to="." method="_on_GridColor_color_changed"]
[connection signal="color_changed" from="HSplitContainer/ScrollContainer/VBoxContainer/Grid&Guides/GridOptions/GuideColor" to="." method="_on_GuideColor_color_changed"]

View file

@ -29,6 +29,8 @@ var grid_width := 1
var grid_height := 1
# warning-ignore:unused_class_variable
var grid_color := Color.black
# warning-ignore:unused_class_variable
var guide_color := Color.purple
# Tools & options
# warning-ignore:unused_class_variable

View file

@ -161,3 +161,10 @@ func _on_GridHeightValue_value_changed(value : float) -> void:
func _on_GridColor_color_changed(color : Color) -> void:
Global.grid_color = color
func _on_GuideColor_color_changed(color : Color) -> void:
Global.guide_color = color
for canvas in Global.canvases:
for guide in canvas.get_children():
if guide is Guide:
guide.default_color = color

View file

@ -11,6 +11,7 @@ var type = TYPE.HORIZONTAL
func _ready() -> void:
width = 0.1
default_color = Global.guide_color
# warning-ignore:unused_argument
func _process(delta : float) -> void:

View file

@ -67,7 +67,6 @@ func _on_HorizontalRuler_pressed() -> void:
Global.vertical_ruler._on_VerticalRuler_pressed()
var guide := Guide.new()
guide.type = guide.TYPE.HORIZONTAL
guide.default_color = Color.purple
guide.add_point(Vector2(-99999, Global.canvas.current_pixel.y))
guide.add_point(Vector2(99999, Global.canvas.current_pixel.y))
Global.canvas.add_child(guide)

View file

@ -62,7 +62,6 @@ func _on_VerticalRuler_pressed() -> void:
return
var guide := Guide.new()
guide.type = guide.TYPE.VERTICAL
guide.default_color = Color.purple
guide.add_point(Vector2(Global.canvas.current_pixel.x, -99999))
guide.add_point(Vector2(Global.canvas.current_pixel.x, 99999))
Global.canvas.add_child(guide)