Changed Palette and Layer TextureButtons into Buttons, massive asset renaming

Most asset filenames are now in snake_case
This commit is contained in:
OverloadedOrama 2020-05-03 03:13:08 +03:00
parent 148d918f12
commit 9482b47825
653 changed files with 2178 additions and 3931 deletions

View file

@ -604,21 +604,15 @@ func layers_changed(value : Array) -> void:
self.current_frame = current_frame # Call frame_changed to update UI
if layers[current_layer][2]:
remove_layer_button.disabled = true
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
disable_button(remove_layer_button, true)
if layers.size() == 1:
remove_layer_button.disabled = true
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
move_up_layer_button.disabled = true
move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
move_down_layer_button.disabled = true
move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
merge_down_layer_button.disabled = true
merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
disable_button(remove_layer_button, true)
disable_button(move_up_layer_button, true)
disable_button(move_down_layer_button, true)
disable_button(merge_down_layer_button, true)
elif !layers[current_layer][2]:
remove_layer_button.disabled = false
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
disable_button(remove_layer_button, false)
func frame_changed(value : int) -> void:
@ -662,36 +656,51 @@ func layer_changed(value : int) -> void:
layer_button.pressed = true
if current_layer < layers.size() - 1:
move_up_layer_button.disabled = false
move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
disable_button(move_up_layer_button, false)
else:
move_up_layer_button.disabled = true
move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
disable_button(move_up_layer_button, true)
if current_layer > 0:
move_down_layer_button.disabled = false
move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
merge_down_layer_button.disabled = false
merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
disable_button(move_down_layer_button, false)
disable_button(merge_down_layer_button, false)
else:
move_down_layer_button.disabled = true
move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
merge_down_layer_button.disabled = true
merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
disable_button(move_down_layer_button, true)
disable_button(merge_down_layer_button, true)
if current_layer < layers.size():
if layers[current_layer][2]:
remove_layer_button.disabled = true
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
disable_button(remove_layer_button, true)
else:
if layers.size() > 1:
remove_layer_button.disabled = false
remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
disable_button(remove_layer_button, false)
yield(get_tree().create_timer(0.01), "timeout")
self.current_frame = current_frame # Call frame_changed to update UI
func disable_button(button : BaseButton, disable : bool) -> void:
button.disabled = disable
if disable:
button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
else:
button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
if button is Button:
var theme := theme_type
if theme == "Gold":
theme = "Light"
for c in button.get_children():
if c is TextureRect:
var last_backslash = c.texture.resource_path.get_base_dir().find_last("/")
var button_category = c.texture.resource_path.get_base_dir().right(last_backslash + 1)
var normal_file_name = c.texture.resource_path.get_file().trim_suffix(".png").replace("_disabled", "")
if disable:
c.texture = load("res://Assets/Graphics/%s_themes/%s/%s_disabled.png" % [theme.to_lower(), button_category, normal_file_name])
else:
c.texture = load("res://Assets/Graphics/%s_themes/%s/%s.png" % [theme.to_lower(), button_category, normal_file_name])
break
func animation_tags_changed(value : Array) -> void:
animation_tags = value
for child in tag_container.get_children():

View file

@ -602,13 +602,13 @@ func _on_Tool_pressed(tool_pressed : BaseButton, mouse_press := true, key_for_le
for t in tools:
var tool_name : String = t[0].name
if tool_name == Global.current_left_tool and tool_name == Global.current_right_tool:
t[0].texture_normal = load("res://Assets/Graphics/%s Themes/Tools/%s_l_r.png" % [Global.theme_type, tool_name])
t[0].texture_normal = load("res://Assets/Graphics/%s_themes/tools/%s_l_r.png" % [Global.theme_type, tool_name.to_lower()])
elif tool_name == Global.current_left_tool:
t[0].texture_normal = load("res://Assets/Graphics/%s Themes/Tools/%s_l.png" % [Global.theme_type, tool_name])
t[0].texture_normal = load("res://Assets/Graphics/%s_themes/tools/%s_l.png" % [Global.theme_type, tool_name.to_lower()])
elif tool_name == Global.current_right_tool:
t[0].texture_normal = load("res://Assets/Graphics/%s Themes/Tools/%s_r.png" % [Global.theme_type, tool_name])
t[0].texture_normal = load("res://Assets/Graphics/%s_themes/tools/%s_r.png" % [Global.theme_type, tool_name.to_lower()])
else:
t[0].texture_normal = load("res://Assets/Graphics/%s Themes/Tools/%s.png" % [Global.theme_type, tool_name])
t[0].texture_normal = load("res://Assets/Graphics/%s_themes/tools/%s.png" % [Global.theme_type, tool_name.to_lower()])
Global.left_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/cursor_icons/%s_cursor.png" % Global.current_left_tool.to_lower()), 0)
Global.right_cursor_tool_texture.create_from_image(load("res://Assets/Graphics/cursor_icons/%s_cursor.png" % Global.current_right_tool.to_lower()), 0)

View file

@ -1,16 +1,16 @@
[gd_scene load_steps=59 format=2]
[gd_scene load_steps=57 format=2]
[ext_resource path="res://Assets/themes/dark/theme.tres" type="Theme" id=1]
[ext_resource path="res://src/Main.gd" type="Script" id=2]
[ext_resource path="res://Assets/themes/dark/top_menu_style.tres" type="StyleBox" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/RectSelect.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/ColorPicker.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Pencil_l.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Eraser_r.png" type="Texture" id=7]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Bucket.png" type="Texture" id=8]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/LightenDarken.png" type="Texture" id=9]
[ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color switch.png" type="Texture" id=10]
[ext_resource path="res://Assets/Graphics/Dark Themes/Misc/Color defaults.png" type="Texture" id=11]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/rectselect.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/eraser_r.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/pencil_l.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/lightendarken.png" type="Texture" id=7]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/colorpicker.png" type="Texture" id=8]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/bucket.png" type="Texture" id=9]
[ext_resource path="res://Assets/Graphics/dark_themes/misc/color_switch.png" type="Texture" id=10]
[ext_resource path="res://Assets/Graphics/dark_themes/misc/color_defaults.png" type="Texture" id=11]
[ext_resource path="res://Assets/Graphics/Brush_button.png" type="Texture" id=12]
[ext_resource path="res://Assets/themes/dark/ruler_style.tres" type="StyleBox" id=13]
[ext_resource path="res://src/UI/Rulers/HorizontalRuler.gd" type="Script" id=14]
@ -20,16 +20,16 @@
[ext_resource path="res://src/SelectionRectangle.gd" type="Script" id=18]
[ext_resource path="res://src/UI/SecondViewport.gd" type="Script" id=19]
[ext_resource path="res://src/UI/Timeline/AnimationTimeline.tscn" type="PackedScene" id=20]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette.png" type="Texture" id=21]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Add_Palette_Hover.png" type="Texture" id=22]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette.png" type="Texture" id=23]
[ext_resource path="res://Assets/Graphics/Dark Themes/Palette/Edit_Palette_Hover.png" type="Texture" id=24]
[ext_resource path="res://Assets/Graphics/dark_themes/palette/edit_palette.png" type="Texture" id=21]
[ext_resource path="res://Assets/Graphics/dark_themes/palette/add_palette.png" type="Texture" id=22]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/zoom.png" type="Texture" id=23]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/horizontal_mirror_on.png" type="Texture" id=24]
[ext_resource path="res://src/Palette/PaletteContainer.gd" type="Script" id=25]
[ext_resource path="res://src/UI/BrushButton.tscn" type="PackedScene" id=26]
[ext_resource path="res://src/UI/Dialogs/SplashDialog.tscn" type="PackedScene" id=27]
[ext_resource path="res://src/UI/Dialogs/CreateNewImage.tscn" type="PackedScene" id=28]
[ext_resource path="res://src/UI/Dialogs/ImportSprites.tscn" type="PackedScene" id=29]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_Off.png" type="Texture" id=30]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/horizontal_mirror_off.png" type="Texture" id=30]
[ext_resource path="res://src/UI/Dialogs/ScaleImage.tscn" type="PackedScene" id=31]
[ext_resource path="res://src/UI/Dialogs/PreferencesDialog.tscn" type="PackedScene" id=32]
[ext_resource path="res://src/UI/Dialogs/OutlineDialog.tscn" type="PackedScene" id=33]
@ -39,10 +39,8 @@
[ext_resource path="res://src/Palette/PaletteImportFileDialog.tscn" type="PackedScene" id=37]
[ext_resource path="res://src/UI/Dialogs/RotateImage.tscn" type="PackedScene" id=38]
[ext_resource path="res://src/UI/Dialogs/ExportDialog.tscn" type="PackedScene" id=39]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Horizontal_Mirror_On.png" type="Texture" id=40]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_On.png" type="Texture" id=41]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Vertical_Mirror_Off.png" type="Texture" id=42]
[ext_resource path="res://Assets/Graphics/Dark Themes/Tools/Zoom.png" type="Texture" id=43]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/vertical_mirror_off.png" type="Texture" id=40]
[ext_resource path="res://Assets/Graphics/dark_themes/tools/vertical_mirror_on.png" type="Texture" id=41]
[ext_resource path="res://src/UI/Dialogs/HSVDialog.tscn" type="PackedScene" id=44]
[ext_resource path="res://src/UI/TransparentChecker.gd" type="Script" id=45]
[ext_resource path="res://src/UI/Dialogs/OpenLastProjectAlertDialog.tscn" type="PackedScene" id=46]
@ -264,7 +262,7 @@ margin_right = 32.0
margin_bottom = 68.0
mouse_default_cursor_shape = 2
button_mask = 3
texture_normal = ExtResource( 43 )
texture_normal = ExtResource( 23 )
[node name="ColorPicker" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools" groups=[
"UIButtons",
@ -274,7 +272,7 @@ margin_right = 32.0
margin_bottom = 104.0
mouse_default_cursor_shape = 2
button_mask = 3
texture_normal = ExtResource( 5 )
texture_normal = ExtResource( 8 )
[node name="Pencil" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools" groups=[
"UIButtons",
@ -294,7 +292,7 @@ margin_right = 32.0
margin_bottom = 176.0
mouse_default_cursor_shape = 2
button_mask = 3
texture_normal = ExtResource( 7 )
texture_normal = ExtResource( 5 )
[node name="Bucket" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools" groups=[
"UIButtons",
@ -304,7 +302,7 @@ margin_right = 32.0
margin_bottom = 212.0
mouse_default_cursor_shape = 2
button_mask = 3
texture_normal = ExtResource( 8 )
texture_normal = ExtResource( 9 )
[node name="LightenDarken" type="TextureButton" parent="MenuAndUI/UI/ToolPanel/Tools" groups=[
"UIButtons",
@ -314,7 +312,7 @@ margin_right = 32.0
margin_bottom = 248.0
mouse_default_cursor_shape = 2
button_mask = 3
texture_normal = ExtResource( 9 )
texture_normal = ExtResource( 7 )
[node name="CanvasAndTimeline" type="VSplitContainer" parent="MenuAndUI/UI"]
margin_left = 48.0
@ -964,7 +962,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource( 30 )
texture_pressed = ExtResource( 40 )
texture_pressed = ExtResource( 24 )
[node name="LeftVerticalMirroring" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/ColorAndToolOptions/ScrollContainer/ToolOptions/LeftToolOptions/LeftMirrorButtons" groups=[
"UIButtons",
@ -976,7 +974,7 @@ hint_tooltip = "Enable vertical mirrored drawing"
focus_mode = 0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource( 42 )
texture_normal = ExtResource( 40 )
texture_pressed = ExtResource( 41 )
[node name="VSeparator" type="VSeparator" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/ColorAndToolOptions/ScrollContainer/ToolOptions"]
@ -1377,7 +1375,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource( 30 )
texture_pressed = ExtResource( 40 )
texture_pressed = ExtResource( 24 )
[node name="RightVerticalMirroring" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/ColorAndToolOptions/ScrollContainer/ToolOptions/RightToolOptions/RightMirrorButtons" groups=[
"UIButtons",
@ -1389,7 +1387,7 @@ hint_tooltip = "Enable vertical mirrored drawing"
focus_mode = 0
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource( 42 )
texture_normal = ExtResource( 40 )
texture_pressed = ExtResource( 41 )
[node name="PaletteVBoxContainer" type="VBoxContainer" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit"]
@ -1427,7 +1425,7 @@ margin_left = 78.0
margin_right = 251.0
margin_bottom = 32.0
[node name="AddPalette" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[
[node name="AddPalette" type="Button" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[
"UIButtons",
]]
margin_right = 32.0
@ -1436,28 +1434,57 @@ rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Add a new palette"
focus_mode = 0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 21 )
texture_hover = ExtResource( 22 )
[node name="PopupMenu" type="PopupMenu" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette"]
margin_right = 12.0
margin_bottom = 20.0
margin_right = 115.0
margin_bottom = 54.0
items = [ "New Empty Palette", null, 0, false, false, 0, 0, null, "", false, "Import Palette", null, 0, false, false, 1, 0, null, "", false ]
__meta__ = {
"_edit_use_anchors_": false
}
[node name="EditPalette" type="TextureButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons/AddPalette"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -12.0
margin_right = 12.0
margin_bottom = 12.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 22 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="EditPalette" type="Button" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons" groups=[
"UIButtons",
]]
margin_left = 35.0
margin_right = 67.0
margin_bottom = 32.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Edit currently selected palette"
focus_mode = 0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 23 )
texture_hover = ExtResource( 24 )
[node name="TextureRect" type="TextureRect" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons/EditPalette"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -12.0
margin_right = 12.0
margin_bottom = 12.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 21 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PaletteOptionButton" type="OptionButton" parent="MenuAndUI/UI/RightPanel/PreviewAndPalettes/ToolAndPaletteVSplit/PaletteVBoxContainer/CenterContainer/PaletteButtons"]
margin_left = 70.0

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://src/Palette/EditPalettePopup.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/new_frame.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/remove_frame.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Palette/palette_button_fill.png" type="Texture" id=6]
[node name="EditPalettePopup" type="WindowDialog"]

View file

@ -12,7 +12,7 @@ func _ready() -> void:
# Select default palette "Default"
on_palette_select(current_palette)
var add_palette_menu : PopupMenu = Global.add_palette_button.get_child(0)
var add_palette_menu : PopupMenu = Global.add_palette_button.get_node("PopupMenu")
add_palette_menu.connect("id_pressed", self, "add_palette_menu_id_pressed")
@ -71,7 +71,7 @@ func on_palette_import_file_selected(path : String) -> void:
func _on_AddPalette_pressed() -> void:
Global.add_palette_button.get_child(0).popup(Rect2(Global.add_palette_button.rect_global_position, Vector2.ONE))
Global.add_palette_button.get_node("PopupMenu").popup(Rect2(Global.add_palette_button.rect_global_position, Vector2.ONE))
func on_new_palette_confirmed() -> void:

View file

@ -1,9 +1,7 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://src/UI/Dialogs/FrameTagDialog.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/new_frame.png" type="Texture" id=2]
[node name="FrameTagDialog" type="AcceptDialog"]
margin_right = 83.0

View file

@ -360,25 +360,32 @@ func change_theme(ID : int) -> void:
var last_backslash = button.texture_normal.resource_path.get_base_dir().find_last("/")
var button_category = button.texture_normal.resource_path.get_base_dir().right(last_backslash + 1)
var normal_file_name = button.texture_normal.resource_path.get_file()
button.texture_normal = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, normal_file_name])
button.texture_normal = load("res://Assets/Graphics/%s_themes/%s/%s" % [Global.theme_type.to_lower(), button_category, normal_file_name])
if button.texture_pressed:
var pressed_file_name = button.texture_pressed.resource_path.get_file()
button.texture_pressed = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, pressed_file_name])
button.texture_pressed = load("res://Assets/Graphics/%s_themes/%s/%s" % [Global.theme_type.to_lower(), button_category, pressed_file_name])
if button.texture_hover:
var hover_file_name = button.texture_hover.resource_path.get_file()
button.texture_hover = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, hover_file_name])
button.texture_hover = load("res://Assets/Graphics/%s_themes/%s/%s" % [Global.theme_type.to_lower(), button_category, hover_file_name])
if button.texture_disabled:
var disabled_file_name = button.texture_disabled.resource_path.get_file()
button.texture_disabled = load("res://Assets/Graphics/%s Themes/%s/%s" % [Global.theme_type, button_category, disabled_file_name])
button.texture_disabled = load("res://Assets/Graphics/%s_themes/%s/%s" % [Global.theme_type.to_lower(), button_category, disabled_file_name])
elif button is Button:
var theme_type := Global.theme_type
if theme_type == "Gold":
theme_type = "Light"
var texture : TextureRect = button.get_child(0)
var last_backslash = texture.texture.resource_path.get_base_dir().find_last("/")
var button_category = texture.texture.resource_path.get_base_dir().right(last_backslash + 1)
var normal_file_name = texture.texture.resource_path.get_file()
texture.texture = load("res://Assets/Graphics/%s Themes/%s/%s" % [theme_type, button_category, normal_file_name])
var texture : TextureRect
for child in button.get_children():
if child is TextureRect:
texture = child
break
if texture:
var last_backslash = texture.texture.resource_path.get_base_dir().find_last("/")
var button_category = texture.texture.resource_path.get_base_dir().right(last_backslash + 1)
var normal_file_name = texture.texture.resource_path.get_file()
texture.texture = load("res://Assets/Graphics/%s_themes/%s/%s" % [theme_type.to_lower(), button_category, normal_file_name])
# Make sure the frame text gets updated
Global.current_frame = Global.current_frame

View file

@ -1,46 +1,28 @@
[gd_scene load_steps=51 format=2]
[gd_scene load_steps=41 format=2]
[ext_resource path="res://src/UI/Timeline/AnimationTimeline.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/New_Layer_Hover.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Hover.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Delete_Layer_Disabled.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up.png" type="Texture" id=7]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Hover.png" type="Texture" id=8]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Up_Disabled.png" type="Texture" id=9]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down.png" type="Texture" id=10]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Hover.png" type="Texture" id=11]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Move_Down_Disabled.png" type="Texture" id=12]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer.png" type="Texture" id=13]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Clone_Layer_Hover.png" type="Texture" id=14]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down.png" type="Texture" id=15]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Hover.png" type="Texture" id=16]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Merge_Down_Disabled.png" type="Texture" id=17]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/new_layer.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/delete_layer_disabled.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/move_up_disabled.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/move_down_disabled.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/merge_down_disabled.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/clone_layer.png" type="Texture" id=7]
[ext_resource path="res://src/UI/Timeline/LayerButton.tscn" type="PackedScene" id=18]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/new_frame.png" type="Texture" id=19]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/remove_frame.png" type="Texture" id=20]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/go_to_first_frame.png" type="Texture" id=21]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/play.png" type="Texture" id=22]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/previous_frame.png" type="Texture" id=23]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/play_backwards.png" type="Texture" id=24]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/go_to_last_frame.png" type="Texture" id=25]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/next_frame.png" type="Texture" id=26]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/copy_frame.png" type="Texture" id=27]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/tag.png" type="Texture" id=28]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/onion_skinning_off.png" type="Texture" id=29]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/expandable.png" type="Texture" id=30]
[ext_resource path="res://Assets/Graphics/Dark Themes/Timeline/loop.png" type="Texture" id=31]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/new_frame.png" type="Texture" id=19]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/remove_frame.png" type="Texture" id=20]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/go_to_first_frame.png" type="Texture" id=21]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/play.png" type="Texture" id=22]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/previous_frame.png" type="Texture" id=23]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/play_backwards.png" type="Texture" id=24]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/go_to_last_frame.png" type="Texture" id=25]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/next_frame.png" type="Texture" id=26]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/copy_frame.png" type="Texture" id=27]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/tag.png" type="Texture" id=28]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/onion_skinning_off.png" type="Texture" id=29]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/expandable.png" type="Texture" id=30]
[ext_resource path="res://Assets/Graphics/dark_themes/timeline/loop.png" type="Texture" id=31]
[ext_resource path="res://src/UI/Dialogs/FrameTagDialog.tscn" type="PackedScene" id=42]
[sub_resource type="InputEventKey" id=1]
control = true
command = true
@ -142,86 +124,172 @@ custom_constants/vseparation = 4
custom_constants/hseparation = 4
columns = 2
[node name="AddLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="AddLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_right = 32.0
margin_bottom = 32.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Create a new layer"
focus_mode = 0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 2 )
texture_hover = ExtResource( 3 )
[node name="RemoveLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/AddLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -9.0
margin_top = -12.0
margin_right = 9.0
margin_bottom = 12.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RemoveLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_left = 36.0
margin_right = 68.0
margin_bottom = 32.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Remove current layer"
focus_mode = 0
mouse_default_cursor_shape = 8
disabled = true
texture_normal = ExtResource( 4 )
texture_hover = ExtResource( 5 )
texture_disabled = ExtResource( 6 )
[node name="MoveUpLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/RemoveLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -7.0
margin_top = -7.0
margin_right = 7.0
margin_bottom = 7.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MoveUpLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_top = 36.0
margin_right = 32.0
margin_bottom = 68.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Move up the current layer"
focus_mode = 0
mouse_default_cursor_shape = 8
disabled = true
texture_normal = ExtResource( 7 )
texture_hover = ExtResource( 8 )
texture_disabled = ExtResource( 9 )
[node name="MoveDownLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/MoveUpLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -7.0
margin_top = -8.0
margin_right = 7.0
margin_bottom = 8.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MoveDownLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_left = 36.0
margin_top = 36.0
margin_right = 68.0
margin_bottom = 68.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Move down the current layer"
focus_mode = 0
mouse_default_cursor_shape = 8
disabled = true
texture_normal = ExtResource( 10 )
texture_hover = ExtResource( 11 )
texture_disabled = ExtResource( 12 )
[node name="CloneLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/MoveDownLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -7.0
margin_top = -8.0
margin_right = 7.0
margin_bottom = 8.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CloneLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_top = 72.0
margin_right = 32.0
margin_bottom = 104.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Clone current layer"
focus_mode = 0
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 13 )
texture_hover = ExtResource( 14 )
[node name="MergeDownLayer" type="TextureButton" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/CloneLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -8.5
margin_top = -10.0
margin_right = 8.5
margin_bottom = 10.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 7 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MergeDownLayer" type="Button" parent="AnimationContainer/ForLayerButtons/LayerButtons" groups=[
"UIButtons",
]]
margin_left = 36.0
margin_top = 72.0
margin_right = 68.0
margin_bottom = 104.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Merge current layer with the one below"
focus_mode = 0
mouse_default_cursor_shape = 8
disabled = true
texture_normal = ExtResource( 15 )
texture_hover = ExtResource( 16 )
texture_disabled = ExtResource( 17 )
[node name="TextureRect" type="TextureRect" parent="AnimationContainer/ForLayerButtons/LayerButtons/MergeDownLayer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -6.0
margin_top = -12.0
margin_right = 6.0
margin_bottom = 12.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SpacerControl" type="Control" parent="AnimationContainer"]
margin_left = 72.0

View file

@ -15,27 +15,28 @@ func _ready() -> void:
linked_button = Global.find_node_by_name(self, "LinkButton")
label = Global.find_node_by_name(self, "Label")
line_edit = Global.find_node_by_name(self, "LineEdit")
var theme_type := Global.theme_type
if theme_type == "Gold":
theme_type = "Light"
if Global.layers[i][1]:
visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible.png" % Global.theme_type)
visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Visible_Hover.png" % Global.theme_type)
visibility_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/layer_visible.png" % theme_type.to_lower())
visibility_button.get_child(0).rect_size = Vector2(24, 14)
visibility_button.get_child(0).rect_position = Vector2(4, 9)
else:
visibility_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Layer_Invisible.png" % Global.theme_type)
visibility_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Layer_Invisible_Hover.png" % Global.theme_type)
visibility_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/layer_invisible.png" % theme_type.to_lower())
visibility_button.get_child(0).rect_size = Vector2(24, 8)
visibility_button.get_child(0).rect_position = Vector2(4, 12)
if Global.layers[i][2]:
lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Lock.png" % Global.theme_type)
lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Lock_Hover.png" % Global.theme_type)
lock_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/lock.png" % theme_type.to_lower())
else:
lock_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Unlock.png" % Global.theme_type)
lock_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Unlock_Hover.png" % Global.theme_type)
lock_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/unlock.png" % theme_type.to_lower())
if Global.layers[i][4]: # If new layers will be linked
linked_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Linked_Layer.png" % Global.theme_type)
linked_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Linked_Layer_Hover.png" % Global.theme_type)
linked_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/linked_layer.png" % theme_type.to_lower())
else:
linked_button.texture_normal = load("res://Assets/Graphics/%s Themes/Layers/Unlinked_Layer.png" % Global.theme_type)
linked_button.texture_hover = load("res://Assets/Graphics/%s Themes/Layers/Unlinked_Layer_Hover.png" % Global.theme_type)
linked_button.get_child(0).texture = load("res://Assets/Graphics/%s_themes/layers/unlinked_layer.png" % theme_type.to_lower())
func _input(event : InputEvent) -> void:

View file

@ -1,13 +1,9 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=5 format=2]
[ext_resource path="res://src/UI/Timeline/LayerButton.gd" type="Script" id=1]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible_Hover.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer.png" type="Texture" id=4]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Layer_Visible.png" type="Texture" id=5]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlock_Hover.png" type="Texture" id=6]
[ext_resource path="res://Assets/Graphics/Dark Themes/Layers/Unlinked_Layer_Hover.png" type="Texture" id=7]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/layer_visible.png" type="Texture" id=2]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/unlock.png" type="Texture" id=3]
[ext_resource path="res://Assets/Graphics/dark_themes/layers/unlinked_layer.png" type="Texture" id=4]
[node name="LayerContainer" type="Button"]
margin_right = 210.0
@ -34,42 +30,73 @@ __meta__ = {
margin_right = 104.0
margin_bottom = 36.0
[node name="VisibilityButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[
[node name="VisibilityButton" type="Button" parent="HBoxContainer/LayerButtons" groups=[
"UIButtons",
]]
margin_top = 2.0
margin_right = 32.0
margin_bottom = 34.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Toggle layer's visibility"
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
texture_normal = ExtResource( 5 )
texture_hover = ExtResource( 2 )
[node name="LockButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/VisibilityButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -7.0
margin_right = 12.0
margin_bottom = 7.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LockButton" type="Button" parent="HBoxContainer/LayerButtons" groups=[
"UIButtons",
]]
margin_left = 36.0
margin_top = 2.0
margin_right = 68.0
margin_bottom = 34.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Lock/unlock layer"
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
texture_normal = ExtResource( 3 )
texture_hover = ExtResource( 6 )
[node name="LinkButton" type="TextureButton" parent="HBoxContainer/LayerButtons" groups=[
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LockButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -10.0
margin_top = -12.0
margin_right = 10.0
margin_bottom = 12.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LinkButton" type="Button" parent="HBoxContainer/LayerButtons" groups=[
"UIButtons",
]]
margin_left = 72.0
margin_top = 2.0
margin_right = 104.0
margin_bottom = 34.0
rect_min_size = Vector2( 32, 32 )
hint_tooltip = "Enable/disable cel linking
Linked cels are being shared across multiple frames"
@ -77,8 +104,22 @@ focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 0
size_flags_vertical = 4
texture_normal = ExtResource( 4 )
texture_hover = ExtResource( 7 )
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/LayerButtons/LinkButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -12.0
margin_top = -4.0
margin_right = 12.0
margin_bottom = 4.0
size_flags_horizontal = 0
size_flags_vertical = 0
texture = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LayerName" type="HBoxContainer" parent="HBoxContainer"]
margin_left = 108.0