Use enums instead of strings for tools

This could be a slight increase in performance
This commit is contained in:
OverloadedOrama 2020-05-31 16:04:33 +03:00
parent bda9e6267d
commit 5b7d161ecf
6 changed files with 71 additions and 72 deletions

View file

@ -17,7 +17,7 @@ func _on_BrushButton_pressed() -> void:
Global.current_left_brush_type = brush_type
Global.custom_left_brush_index = custom_brush_index
if custom_brush_index > -1: # Custom brush
if Global.current_left_tool == "Pencil":
if Global.current_left_tool == Global.Tools.PENCIL:
Global.left_color_interpolation_container.visible = true
# if hint_tooltip == "":
# Global.left_brush_type_label.text = tr("Custom brush")
@ -40,7 +40,7 @@ func _on_BrushButton_pressed() -> void:
Global.current_right_brush_type = brush_type
Global.custom_right_brush_index = custom_brush_index
if custom_brush_index > -1:
if Global.current_right_tool == "Pencil":
if Global.current_right_tool == Global.Tools.PENCIL:
Global.right_color_interpolation_container.visible = true
# if hint_tooltip == "":
# Global.right_brush_type_label.text = tr("Custom brush")