GraphicsEditor/addons/graphics_editor/Settings.gd

44 lines
1.6 KiB
GDScript3
Raw Normal View History

2019-08-04 09:57:42 +02:00
tool
extends Control
onready var editor = get_parent()
2019-11-23 12:33:43 +01:00
onready var canvas_outline = get_parent().get_node("PaintCanvasContainer/ViewportContainer/Viewport/PaintCanvas/CanvasOutline")
onready var visual_grid_1 = get_parent().get_node("PaintCanvasContainer/ViewportContainer/Viewport/PaintCanvas/Grids/VisualGrid")
onready var visual_grid_2 = get_parent().get_node("PaintCanvasContainer/ViewportContainer/Viewport/PaintCanvas/Grids/VisualGrid2")
2019-08-04 09:57:42 +02:00
func _ready():
2019-08-06 07:36:52 +02:00
#CanvasOutline settings
2019-08-06 03:19:40 +02:00
get_node("CanvasOutline/Enabled/CheckButton").pressed = canvas_outline.visible
get_node("CanvasOutline/Color/ColorPickerButton").color = canvas_outline.color
get_node("CanvasOutline/Width/SpinBox").value = canvas_outline.width
2019-08-06 07:36:52 +02:00
#Grid settings
get_node("Grids/Grid1Color/ColorPickerButton").color = visual_grid_1.color
get_node("Grids/Grid1Size/SpinBox").value = visual_grid_1.size
get_node("Grids/Grid2Color/ColorPickerButton").color = visual_grid_2.color
get_node("Grids/Grid2Size/SpinBox").value = visual_grid_2.size
2019-08-04 09:57:42 +02:00
2019-08-06 07:36:52 +02:00
func _on_Ok_pressed():
hide()
2019-08-04 09:57:42 +02:00
2019-08-06 07:36:52 +02:00
func _on_CanvasOutline_Enabled_value_changed(button_pressed):
2019-08-06 03:19:40 +02:00
canvas_outline.visible = button_pressed
2019-08-06 07:36:52 +02:00
func _on_CanvasOutline_Color_value_changed(color):
2019-08-04 09:57:42 +02:00
canvas_outline.color = color
2019-08-06 07:36:52 +02:00
func _on_CanvasOutline_SpinBox_value_changed(value):
2019-08-06 03:19:40 +02:00
canvas_outline.width = value
2019-08-04 09:57:42 +02:00
2019-08-06 07:36:52 +02:00
func _on_Grids_Grid1Color_value_changed(color):
visual_grid_1.color = color
func _on_Grids_Grid1Size_value_changed(value):
visual_grid_1.size = value
func _on_Grids_Grid2Color_value_changed(color):
visual_grid_2.color = color
2019-08-06 03:19:40 +02:00
2019-08-06 07:36:52 +02:00
func _on_Grids_Grid2Size_value_changed(value):
2019-11-23 12:33:43 +01:00
visual_grid_2.size = value