mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Added guide color in Preferences
This commit is contained in:
parent
a3fcfc4597
commit
f81ef37e92
|
@ -37,10 +37,11 @@ size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="HSplitContainer/ScrollContainer"]
|
||||||
margin_right = 205.0
|
margin_right = 205.0
|
||||||
margin_bottom = 282.0
|
margin_bottom = 454.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="Languages" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
[node name="Languages" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||||
|
editor/display_folded = true
|
||||||
margin_right = 205.0
|
margin_right = 205.0
|
||||||
margin_bottom = 282.0
|
margin_bottom = 282.0
|
||||||
|
|
||||||
|
@ -117,6 +118,7 @@ custom_fonts/font = ExtResource( 3 )
|
||||||
text = "繁體中文 [zh_TW]"
|
text = "繁體中文 [zh_TW]"
|
||||||
|
|
||||||
[node name="Themes" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
[node name="Themes" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||||
|
editor/display_folded = true
|
||||||
margin_right = 40.0
|
margin_right = 40.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 40.0
|
||||||
|
|
||||||
|
@ -162,6 +164,7 @@ mouse_default_cursor_shape = 2
|
||||||
text = "Light"
|
text = "Light"
|
||||||
|
|
||||||
[node name="Grid&Guides" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
[node name="Grid&Guides" type="VBoxContainer" parent="HSplitContainer/ScrollContainer/VBoxContainer"]
|
||||||
|
editor/display_folded = true
|
||||||
visible = false
|
visible = false
|
||||||
margin_top = 24.0
|
margin_top = 24.0
|
||||||
margin_right = 151.0
|
margin_right = 151.0
|
||||||
|
@ -223,7 +226,22 @@ margin_top = 56.0
|
||||||
margin_right = 124.0
|
margin_right = 124.0
|
||||||
margin_bottom = 76.0
|
margin_bottom = 76.0
|
||||||
rect_min_size = Vector2( 64, 20 )
|
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="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/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="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/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"]
|
||||||
|
|
|
@ -29,6 +29,8 @@ var grid_width := 1
|
||||||
var grid_height := 1
|
var grid_height := 1
|
||||||
# warning-ignore:unused_class_variable
|
# warning-ignore:unused_class_variable
|
||||||
var grid_color := Color.black
|
var grid_color := Color.black
|
||||||
|
# warning-ignore:unused_class_variable
|
||||||
|
var guide_color := Color.purple
|
||||||
|
|
||||||
# Tools & options
|
# Tools & options
|
||||||
# warning-ignore:unused_class_variable
|
# warning-ignore:unused_class_variable
|
||||||
|
|
|
@ -161,3 +161,10 @@ func _on_GridHeightValue_value_changed(value : float) -> void:
|
||||||
|
|
||||||
func _on_GridColor_color_changed(color : Color) -> void:
|
func _on_GridColor_color_changed(color : Color) -> void:
|
||||||
Global.grid_color = color
|
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
|
||||||
|
|
|
@ -11,6 +11,7 @@ var type = TYPE.HORIZONTAL
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
width = 0.1
|
width = 0.1
|
||||||
|
default_color = Global.guide_color
|
||||||
|
|
||||||
# warning-ignore:unused_argument
|
# warning-ignore:unused_argument
|
||||||
func _process(delta : float) -> void:
|
func _process(delta : float) -> void:
|
||||||
|
|
|
@ -67,7 +67,6 @@ func _on_HorizontalRuler_pressed() -> void:
|
||||||
Global.vertical_ruler._on_VerticalRuler_pressed()
|
Global.vertical_ruler._on_VerticalRuler_pressed()
|
||||||
var guide := Guide.new()
|
var guide := Guide.new()
|
||||||
guide.type = guide.TYPE.HORIZONTAL
|
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))
|
||||||
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)
|
Global.canvas.add_child(guide)
|
||||||
|
|
|
@ -62,7 +62,6 @@ func _on_VerticalRuler_pressed() -> void:
|
||||||
return
|
return
|
||||||
var guide := Guide.new()
|
var guide := Guide.new()
|
||||||
guide.type = guide.TYPE.VERTICAL
|
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))
|
||||||
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)
|
Global.canvas.add_child(guide)
|
||||||
|
|
Loading…
Reference in a new issue