mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Compare commits
1 commit
9f251c9e85
...
98b4b9a7ee
Author | SHA1 | Date | |
---|---|---|---|
98b4b9a7ee |
|
@ -673,7 +673,7 @@ class ProjectAPI:
|
|||
var old_current := project.current_layer
|
||||
project.current_layer = above_layer # temporary assignment
|
||||
if type >= 0 and type < Global.LayerTypes.size():
|
||||
Global.animation_timeline.on_add_layer_list_id_pressed(type)
|
||||
Global.animation_timeline.add_layer(type)
|
||||
if name != "":
|
||||
project.layers[above_layer + 1].name = name
|
||||
var l_idx := Global.layer_vbox.get_child_count() - (above_layer + 2)
|
||||
|
|
|
@ -12,7 +12,6 @@ var shape_aspect_ratio: AspectRatioContainer
|
|||
var swatches_button: Button
|
||||
## The internal container for the color sliders of the [ColorPicker] node.
|
||||
var color_sliders_vbox: VBoxContainer
|
||||
var _skip_color_picker_update := false
|
||||
@onready var color_picker := %ColorPicker as ColorPicker
|
||||
@onready var color_buttons := %ColorButtons as HBoxContainer
|
||||
@onready var left_color_rect := %LeftColorRect as ColorRect
|
||||
|
@ -106,7 +105,10 @@ func _on_color_picker_color_changed(color: Color) -> void:
|
|||
# So we're using this trick to convert the values back to how they are shown in
|
||||
# the color picker's UI.
|
||||
color = Color(color.to_html())
|
||||
_skip_color_picker_update = true
|
||||
if Tools.picking_color_for == MOUSE_BUTTON_RIGHT:
|
||||
right_color_rect.color = color
|
||||
else:
|
||||
left_color_rect.color = color
|
||||
Tools.assign_color(color, Tools.picking_color_for)
|
||||
|
||||
|
||||
|
@ -128,7 +130,7 @@ func reset_options() -> void:
|
|||
|
||||
func update_color(color_info: Dictionary, button: int) -> void:
|
||||
var color = color_info.get("color", Color.WHITE)
|
||||
if Tools.picking_color_for == button and not _skip_color_picker_update:
|
||||
if Tools.picking_color_for == button:
|
||||
color_picker.color = color
|
||||
if button == MOUSE_BUTTON_RIGHT:
|
||||
right_color_rect.color = color
|
||||
|
@ -137,7 +139,6 @@ func update_color(color_info: Dictionary, button: int) -> void:
|
|||
_average(left_color_rect.color, right_color_rect.color)
|
||||
Global.config_cache.set_value("color_picker", "color_mode", color_picker.color_mode)
|
||||
Global.config_cache.set_value("color_picker", "picker_shape", color_picker.picker_shape)
|
||||
_skip_color_picker_update = false
|
||||
|
||||
|
||||
func _on_ColorSwitch_pressed() -> void:
|
||||
|
|
|
@ -79,7 +79,7 @@ func _ready() -> void:
|
|||
cel_size_slider.min_value = min_cel_size
|
||||
cel_size_slider.max_value = max_cel_size
|
||||
cel_size_slider.value = cel_size
|
||||
add_layer_list.get_popup().id_pressed.connect(on_add_layer_list_id_pressed)
|
||||
add_layer_list.get_popup().id_pressed.connect(_on_add_layer_list_id_pressed)
|
||||
frame_scroll_bar.value_changed.connect(_frame_scroll_changed)
|
||||
animation_timer.wait_time = 1 / Global.current_project.fps
|
||||
fps_spinbox.value = Global.current_project.fps
|
||||
|
@ -853,7 +853,7 @@ func _on_add_layer_pressed() -> void:
|
|||
add_layer(layer, project)
|
||||
|
||||
|
||||
func on_add_layer_list_id_pressed(id: int) -> void:
|
||||
func _on_add_layer_list_id_pressed(id: int) -> void:
|
||||
if id == Global.LayerTypes.TILEMAP:
|
||||
new_tile_map_layer_dialog.popup_centered()
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue