Project brushes change when switching projects

A new Global.file_brushes array is used for the file brushes, and the Project class has its own brushes array for the project brushes
This commit is contained in:
OverloadedOrama 2020-06-05 17:21:35 +03:00
parent 736521246d
commit 4af130bc61
7 changed files with 67 additions and 63 deletions

View file

@ -15,8 +15,6 @@ var animation_tags := [] setget animation_tags_changed # Array of AnimationTags
var guides := [] # Array of Guides
var brushes := [] # Array of Images
var brush_images := [Image.new(), Image.new()]
var brush_textures := [ImageTexture.new(), ImageTexture.new()]
var selected_pixels := []
var x_min := 0
@ -103,6 +101,7 @@ func change_project() -> void:
Global.selection_rectangle.polygon[2] = Vector2.ZERO
Global.selection_rectangle.polygon[3] = Vector2.ZERO
# Change the guides
for guide in Global.canvas.get_children():
if guide is Guide:
if guide in guides:
@ -110,6 +109,13 @@ func change_project() -> void:
else:
guide.visible = false
# Change the project brushes
for child in Global.project_brush_container.get_children():
child.queue_free()
for brush in brushes:
Global.create_brush_button(brush)
func frames_changed(value : Array) -> void:
frames = value