More UI changes

- Left tool options is now on top of the right tool options.
- Brushes have been removed from the right panel, and have instead become a popup that appears when you press one of the brush type buttons, to choose a brush. The indicators will be removed.
This commit is contained in:
OverloadedOrama 2019-11-30 00:41:34 +02:00
parent 3fd2df11e8
commit 4721a01f2e
10 changed files with 377 additions and 216 deletions

View file

@ -1,24 +1,38 @@
extends Button
extends BaseButton
var brush_type = Global.BRUSH_TYPES.PIXEL
var custom_brush_index := -1
func _on_BrushButton_pressed() -> void:
if Input.is_action_just_released("left_mouse"):
if Global.brushes_popup.rect_global_position == Global.left_brush_type_button.rect_global_position:
Global.current_left_brush_type = brush_type
Global.left_brush_indicator.get_parent().remove_child(Global.left_brush_indicator)
add_child(Global.left_brush_indicator)
if custom_brush_index > -1:
if custom_brush_index > -1: #Custom brush
Global.custom_left_brush_index = custom_brush_index
Global.update_left_custom_brush()
if hint_tooltip == "":
Global.left_brush_type_label.text = "Custom brush"
else:
Global.left_brush_type_label.text = "Brush: %s" % hint_tooltip
else: #Pixel brush
Global.left_brush_type_label.text = "Brush: Pixel"
elif Input.is_action_just_released("right_mouse"):
Global.update_left_custom_brush()
else:
Global.current_right_brush_type = brush_type
Global.right_brush_indicator.get_parent().remove_child(Global.right_brush_indicator)
add_child(Global.right_brush_indicator)
if custom_brush_index > -1:
Global.custom_right_brush_index = custom_brush_index
Global.update_right_custom_brush()
if hint_tooltip == "":
Global.right_brush_type_label.text = "Custom brush"
else:
Global.right_brush_type_label.text = "Brush: %s" % hint_tooltip
else: #Pixel brush
Global.right_brush_type_label.text = "Brush: Pixel"
Global.update_right_custom_brush()
func _on_DeleteButton_pressed() -> void:
if brush_type == Global.BRUSH_TYPES.CUSTOM: