GraphicsEditor/addons/graphics_editor/Settings.gd

35 lines
1.0 KiB
GDScript3
Raw Normal View History

2019-08-04 09:57:42 +02:00
tool
extends Control
onready var editor = get_parent()
onready var canvas_outline = get_parent().get_node("PaintCanvasContainer/PaintCanvas/CanvasOutline")
var start_time
var end_time
func _ready():
#start_time = OS.get_ticks_msec()
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-04 09:57:42 +02:00
func _process(delta):
# if get_parent().paint_canvas_node != null:
# canvas_outline = get_parent().paint_canvas_node.get_node("CanvasOutline")
# end_time = OS.get_ticks_msec()
# print("[Settings] Found Editor node in %s seconds!" % [(end_time - start_time) / float(1000)])
# set_process(false)
pass
2019-08-06 03:19:40 +02:00
func _on_CheckButton_toggled(button_pressed):
canvas_outline.visible = button_pressed
2019-08-04 09:57:42 +02:00
func _on_ColorPickerButton_color_changed(color):
canvas_outline.color = color
2019-08-06 03:19:40 +02:00
func _on_SpinBox_value_changed(value):
canvas_outline.width = value
2019-08-04 09:57:42 +02:00
func _on_Ok_pressed():
2019-08-05 02:16:14 +02:00
hide()
2019-08-06 03:19:40 +02:00