mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-06-25 11:54:44 -04:00
Enchanced Layer Opacity UI- Added Spinbox next to Slider
This commit is contained in:
parent
ed2e757c11
commit
ba4ee3418d
4 changed files with 38 additions and 4 deletions
|
@ -190,6 +190,7 @@ var move_up_layer_button : BaseButton
|
|||
var move_down_layer_button : BaseButton
|
||||
var merge_down_layer_button : BaseButton
|
||||
var layer_opacity_slider : HSlider
|
||||
var layer_opacity_spinbox : SpinBox
|
||||
|
||||
var add_palette_button : TextureButton
|
||||
var remove_palette_button : TextureButton
|
||||
|
@ -294,6 +295,7 @@ func _ready() -> void:
|
|||
merge_down_layer_button = find_node_by_name(layer_buttons, "MergeDownLayer")
|
||||
|
||||
layer_opacity_slider = find_node_by_name(layer_stuff_container, "OpacitySlider")
|
||||
layer_opacity_spinbox = find_node_by_name(layer_stuff_container, "OpacitySpinBox")
|
||||
vbox_layer_container = find_node_by_name(layer_stuff_container, "VBoxLayerContainer")
|
||||
|
||||
add_palette_button = find_node_by_name(root, "AddPalette")
|
||||
|
|
|
@ -47,6 +47,7 @@ func changed_selection() -> void:
|
|||
child.currently_selected = true
|
||||
child.pressed = true
|
||||
Global.layer_opacity_slider.value = Global.canvas.layers[child.i][4] * 100
|
||||
Global.layer_opacity_spinbox.value = Global.canvas.layers[child.i][4] * 100
|
||||
|
||||
if Global.canvas.current_layer_index < Global.canvas.layers.size() - 1:
|
||||
Global.move_up_layer_button.disabled = false
|
||||
|
|
|
@ -1130,6 +1130,8 @@ func _on_RightVerticalMirroring_toggled(button_pressed) -> void:
|
|||
|
||||
func _on_OpacitySlider_value_changed(value) -> void:
|
||||
Global.canvas.layers[Global.canvas.current_layer_index][4] = value / 100
|
||||
Global.layer_opacity_slider.value = value
|
||||
Global.layer_opacity_spinbox.value = value
|
||||
|
||||
func _on_QuitDialog_confirmed() -> void:
|
||||
# Darken the UI to denote that the application is currently exiting
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue