From 3df9853ddaa37b3070be5b3a3839e7d05808cdc3 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 19 Jan 2020 01:14:35 +0200 Subject: [PATCH] Update the button textures accordingly Every button will have a texture based on its frame AND its layer. Which means, if the button is on layer 2 and frame 1, its texture will be the contents of frame 1's layer 2 contents. --- Scripts/Global.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Global.gd b/Scripts/Global.gd index 3e3d3561e..00d967e9a 100644 --- a/Scripts/Global.gd +++ b/Scripts/Global.gd @@ -465,7 +465,7 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: layers_container.move_child(layer_container, 1) frames_container.add_child(layers[current_layer][1]) - frames_container.move_child(layers[current_layer][1], 2) + frames_container.move_child(layers[current_layer][1], 1) for i in range(canvases.size()): var frame_button = load("res://Prefabs/FrameButton.tscn").instance() frame_button.frame = i @@ -487,8 +487,8 @@ func redo(_canvases : Array, layer_index : int = -1) -> void: label.align = Label.ALIGN_CENTER label.text = str(canvases.size() + 1) frame_ids.add_child(label) - if !frames_container.is_a_parent_of(_canvases[0].frame_button): - frames_container.add_child(_canvases[0].frame_button) + #if !frames_container.is_a_parent_of(_canvases[0].frame_button): + # frames_container.add_child(_canvases[0].frame_button) elif action_name == "Remove Frame": canvas_parent.remove_child(_canvases[0]) frames_container.remove_child(_canvases[0].frame_button) @@ -527,10 +527,10 @@ func frame_changed(value : int) -> void: var text_color := Color.white if theme_type == "Gold" || theme_type == "Light": text_color = Color.black - c.frame_button.pressed = false + #c.frame_button.pressed = false #c.frame_button.get_node("FrameID").add_color_override("font_color", text_color) # Make only the current frame button pressed - canvas.frame_button.pressed = true + #canvas.frame_button.pressed = true #canvas.frame_button.get_node("FrameID").add_color_override("font_color", Color("#3c5d75")) func create_brush_button(brush_img : Image, brush_type := Brush_Types.CUSTOM, hint_tooltip := "") -> void: