mirror of
https://github.com/litruv/PNGTuber-Plus.git
synced 2026-07-24 02:26:02 +10:00
Fixed up edit menu. now is more modular + uses extensive use of v+hbox's !build
This commit is contained in:
@@ -5,16 +5,23 @@ extends Node2D
|
||||
|
||||
@onready var parentSpin = $SubViewportContainer2/SubViewport/Node3D/Sprite3D
|
||||
|
||||
@onready var spriteRotDisplay = $RotationalLimits/RotBack/SpriteDisplay
|
||||
@onready var spriteRotDisplay = $VBoxContainer/RotationalLimitsSection/RotBack/SpriteDisplay
|
||||
|
||||
|
||||
@onready var coverCollider = $Area2D/CollisionShape2D
|
||||
@onready var wobbleSyncControl = null # Will be assigned in _ready()
|
||||
@onready var blendModeDropdown = $Opacity/blendModeDropdown
|
||||
@onready var blendModeDropdown = $VBoxContainer/RenderingSection/blendModeContainer/blendModeDropdown
|
||||
|
||||
## Slider management system
|
||||
var slider_manager: SliderManager = null
|
||||
|
||||
func _ready():
|
||||
Global.spriteEdit = self
|
||||
|
||||
# Initialize slider management system
|
||||
slider_manager = SliderManager.new(self)
|
||||
_setup_slider_components()
|
||||
|
||||
# Find the wobble sync control node
|
||||
wobbleSyncControl = find_child("WobbleSyncControl")
|
||||
if wobbleSyncControl == null:
|
||||
@@ -22,6 +29,115 @@ func _ready():
|
||||
|
||||
# Set up blend mode dropdown
|
||||
setupBlendModeDropdown()
|
||||
|
||||
## Set up all slider components
|
||||
func _setup_slider_components():
|
||||
# Initialize all the new slider components and add them to the manager
|
||||
_setup_drag_slider()
|
||||
_setup_wobble_sliders()
|
||||
_setup_rotation_sliders()
|
||||
_setup_limit_sliders()
|
||||
_setup_animation_sliders()
|
||||
_setup_opacity_slider()
|
||||
|
||||
## Set up drag slider
|
||||
func _setup_drag_slider():
|
||||
var drag_slider = $VBoxContainer/PhysicsSection/DragSlider
|
||||
if drag_slider:
|
||||
slider_manager.add_slider(drag_slider)
|
||||
drag_slider.value_changed.connect(_on_drag_slider_value_changed)
|
||||
|
||||
## Set up wobble sliders
|
||||
func _setup_wobble_sliders():
|
||||
var wobble_sliders = [
|
||||
$VBoxContainer/WobbleSection/xFrqSlider,
|
||||
$VBoxContainer/WobbleSection/xAmpSlider,
|
||||
$VBoxContainer/WobbleSection/yFrqSlider,
|
||||
$VBoxContainer/WobbleSection/yAmpSlider,
|
||||
$VBoxContainer/WobbleSection/rFrqSlider,
|
||||
$VBoxContainer/WobbleSection/rAmpSlider
|
||||
]
|
||||
|
||||
for slider in wobble_sliders:
|
||||
if slider:
|
||||
slider_manager.add_slider(slider)
|
||||
slider.value_changed.connect(_on_wobble_slider_changed)
|
||||
|
||||
## Set up rotation sliders
|
||||
func _setup_rotation_sliders():
|
||||
var rotation_sliders = [
|
||||
$VBoxContainer/PhysicsSection/rDragSlider,
|
||||
$VBoxContainer/PhysicsSection/squashSlider
|
||||
]
|
||||
|
||||
for slider in rotation_sliders:
|
||||
if slider:
|
||||
slider_manager.add_slider(slider)
|
||||
slider.value_changed.connect(_on_rotation_slider_changed)
|
||||
|
||||
## Set up rotational limit sliders
|
||||
func _setup_limit_sliders():
|
||||
var limit_sliders = [
|
||||
$VBoxContainer/RotationalLimitsSection/rotLimitMinSlider,
|
||||
$VBoxContainer/RotationalLimitsSection/rotLimitMaxSlider
|
||||
]
|
||||
|
||||
for slider in limit_sliders:
|
||||
if slider:
|
||||
slider_manager.add_slider(slider)
|
||||
slider.value_changed.connect(_on_limit_slider_changed)
|
||||
|
||||
## Set up animation sliders
|
||||
func _setup_animation_sliders():
|
||||
var animation_sliders = [
|
||||
$VBoxContainer/AnimationSection/animFramesSlider,
|
||||
$VBoxContainer/AnimationSection/animSpeedSlider
|
||||
]
|
||||
|
||||
for slider in animation_sliders:
|
||||
if slider:
|
||||
slider_manager.add_slider(slider)
|
||||
slider.value_changed.connect(_on_animation_slider_changed)
|
||||
|
||||
## Set up opacity slider
|
||||
func _setup_opacity_slider():
|
||||
var opacity_slider = $VBoxContainer/RenderingSection/opacitySlider
|
||||
if opacity_slider:
|
||||
slider_manager.add_slider(opacity_slider)
|
||||
opacity_slider.value_changed.connect(_on_opacity_slider_changed)
|
||||
|
||||
## Generic slider change handlers
|
||||
func _on_drag_slider_value_changed(value: float):
|
||||
if Global.heldSprite:
|
||||
Global.heldSprite.dragSpeed = value
|
||||
|
||||
func _on_wobble_slider_changed(value: float):
|
||||
# Wobble sliders handle their own parameter updates
|
||||
# Just update the wobble sync control if needed
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
func _on_rotation_slider_changed(value: float):
|
||||
# Rotation sliders handle their own parameter updates
|
||||
if Global.heldSprite:
|
||||
changeRotLimit() # Update the rotation limit display
|
||||
|
||||
func _on_limit_slider_changed(value: float):
|
||||
# Limit sliders handle their own parameter updates
|
||||
if Global.heldSprite:
|
||||
changeRotLimit() # Update the rotation limit display
|
||||
|
||||
func _on_animation_slider_changed(value: float):
|
||||
# Animation sliders handle their own parameter updates
|
||||
if Global.heldSprite:
|
||||
# Special handling for frames slider
|
||||
var frames_slider = $VBoxContainer/AnimationSection/animFramesSlider
|
||||
if frames_slider and frames_slider.value != Global.heldSprite.frames:
|
||||
spriteSpin.hframes = Global.heldSprite.frames
|
||||
|
||||
func _on_opacity_slider_changed(value: float):
|
||||
# Opacity slider handles its own parameter updates via sprite_property
|
||||
pass
|
||||
|
||||
func setImage():
|
||||
if Global.heldSprite == null:
|
||||
@@ -36,58 +152,28 @@ func setImage():
|
||||
var displaySize = Global.heldSprite.imageData.get_size().y
|
||||
spriteRotDisplay.scale = Vector2(1,1) * (150.0/displaySize)
|
||||
|
||||
$Slider/Label.text = "drag: " + str(Global.heldSprite.dragSpeed)
|
||||
$Slider/DragSlider.value = Global.heldSprite.dragSpeed
|
||||
# Update all slider components with the current sprite
|
||||
if slider_manager:
|
||||
slider_manager.update_all_sliders(Global.heldSprite)
|
||||
|
||||
# Update individual sliders with current values
|
||||
_update_all_slider_values()
|
||||
|
||||
$WobbleControl/xFrqLabel.text = "x frequency: " + str(Global.heldSprite.xFrq)
|
||||
$WobbleControl/xAmpLabel.text = "x amplitude: " + str(Global.heldSprite.xAmp)
|
||||
$Position/fileTitle.text = Global.heldSprite.path.replace("user://", "")
|
||||
|
||||
$WobbleControl/xFrq.value = Global.heldSprite.xFrq
|
||||
$WobbleControl/xAmp.value = Global.heldSprite.xAmp
|
||||
|
||||
$WobbleControl/yFrqLabel.text = "y frequency: " + str(Global.heldSprite.yFrq)
|
||||
$WobbleControl/yAmpLabel.text = "y amplitude: " + str(Global.heldSprite.yAmp)
|
||||
|
||||
$WobbleControl/yFrq.value = Global.heldSprite.yFrq
|
||||
$WobbleControl/yAmp.value = Global.heldSprite.yAmp
|
||||
$VBoxContainer/PhysicsSection/BounceVelocity.button_pressed = Global.heldSprite.ignoreBounce
|
||||
$VBoxContainer/RenderingSection/ClipLinked.button_pressed = Global.heldSprite.clipped
|
||||
|
||||
$WobbleControl/rFrqLabel.text = "rotation frequency: " + str(Global.heldSprite.rFrq)
|
||||
$WobbleControl/rAmpLabel.text = "rotation percentage: " + str(Global.heldSprite.rAmp) + "%"
|
||||
|
||||
$WobbleControl/rFrq.value = Global.heldSprite.rFrq
|
||||
$WobbleControl/rAmp.value = Global.heldSprite.rAmp
|
||||
$VBoxContainer/Buttons/SpeakingWrapper/Speaking.frame = Global.heldSprite.showOnTalk
|
||||
$VBoxContainer/Buttons/BlinkingWrapper/Blinking.frame = Global.heldSprite.showOnBlink
|
||||
|
||||
$Rotation/rDragLabel.text = "rotational drag: " + str(Global.heldSprite.rdragStr)
|
||||
$Rotation/rDrag.value = Global.heldSprite.rdragStr
|
||||
$VBoxContainer/RenderingSection/affectChildrenCheck.button_pressed = Global.heldSprite.affectChildrenOpacity
|
||||
$VBoxContainer/RenderingSection/blendModeContainer/blendModeDropdown.selected = Global.heldSprite.blendMode
|
||||
|
||||
$Buttons/Speaking.frame = Global.heldSprite.showOnTalk
|
||||
$Buttons/Blinking.frame = Global.heldSprite.showOnBlink
|
||||
|
||||
$RotationalLimits/rotLimitMin.value = Global.heldSprite.rLimitMin
|
||||
$RotationalLimits/RotLimitMin.text = "rotational limit min: " + str(Global.heldSprite.rLimitMin)
|
||||
$RotationalLimits/rotLimitMax.value = Global.heldSprite.rLimitMax
|
||||
$RotationalLimits/RotLimitMax.text = "rotational limit max: " + str(Global.heldSprite.rLimitMax)
|
||||
|
||||
$Rotation/squashlabel.text = "squash: " + str(Global.heldSprite.stretchAmount)
|
||||
$Rotation/squash.value = Global.heldSprite.stretchAmount
|
||||
|
||||
$Position/fileTitle.text = Global.heldSprite.path
|
||||
|
||||
$Buttons/CheckBox.button_pressed = Global.heldSprite.ignoreBounce
|
||||
$Buttons/ClipLinked.button_pressed = Global.heldSprite.clipped
|
||||
|
||||
$Animation/animSpeedLabel.text = "animation speed: " + str(Global.heldSprite.animSpeed)
|
||||
$Animation/animSpeed.value = Global.heldSprite.animSpeed
|
||||
|
||||
$Animation/animFramesLabel.text = "sprite frames: " + str(Global.heldSprite.frames)
|
||||
$Animation/animFrames.value = Global.heldSprite.frames
|
||||
|
||||
$Opacity/opacityLabel.text = "opacity: " + str(int(Global.heldSprite.spriteOpacity * 100)) + "%"
|
||||
$Opacity/opacitySlider.value = Global.heldSprite.spriteOpacity
|
||||
$Opacity/affectChildrenCheck.button_pressed = Global.heldSprite.affectChildrenOpacity
|
||||
$Opacity/blendModeDropdown.selected = Global.heldSprite.blendMode
|
||||
|
||||
$VisToggle/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
$VBoxContainer/BoxContainer/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
|
||||
changeRotLimit()
|
||||
|
||||
@@ -104,10 +190,10 @@ func setImage():
|
||||
updateWobbleControlStates()
|
||||
|
||||
if Global.heldSprite.parentId == null:
|
||||
$Buttons/Unlink.visible = false
|
||||
$VBoxContainer/Buttons/UnlinkWrapper/Unlink.visible = false
|
||||
parentSpin.visible = false
|
||||
else:
|
||||
$Buttons/Unlink.visible = true
|
||||
$VBoxContainer/Buttons/UnlinkWrapper/Unlink.visible = true
|
||||
|
||||
var nodes = get_tree().get_nodes_in_group(str(Global.heldSprite.parentId))
|
||||
|
||||
@@ -119,29 +205,91 @@ func setImage():
|
||||
parentSpin.hframes = nodes[0].frames
|
||||
parentSpin.visible = true
|
||||
|
||||
## Update all slider components with current sprite values
|
||||
func _update_all_slider_values():
|
||||
if not Global.heldSprite:
|
||||
return
|
||||
|
||||
# Update drag slider
|
||||
var drag_slider = $VBoxContainer/PhysicsSection/DragSlider
|
||||
if drag_slider:
|
||||
drag_slider.set_value(Global.heldSprite.dragSpeed)
|
||||
|
||||
# Update wobble sliders
|
||||
var wobble_sliders = {
|
||||
$VBoxContainer/WobbleSection/xFrqSlider: Global.heldSprite.xFrq,
|
||||
$VBoxContainer/WobbleSection/xAmpSlider: Global.heldSprite.xAmp,
|
||||
$VBoxContainer/WobbleSection/yFrqSlider: Global.heldSprite.yFrq,
|
||||
$VBoxContainer/WobbleSection/yAmpSlider: Global.heldSprite.yAmp,
|
||||
$VBoxContainer/WobbleSection/rFrqSlider: Global.heldSprite.rFrq,
|
||||
$VBoxContainer/WobbleSection/rAmpSlider: Global.heldSprite.rAmp
|
||||
}
|
||||
|
||||
for slider in wobble_sliders:
|
||||
if slider:
|
||||
slider.set_value(wobble_sliders[slider])
|
||||
|
||||
# Update rotation sliders
|
||||
var rotation_sliders = {
|
||||
$VBoxContainer/PhysicsSection/rDragSlider: Global.heldSprite.rdragStr,
|
||||
$VBoxContainer/PhysicsSection/squashSlider: Global.heldSprite.stretchAmount
|
||||
}
|
||||
|
||||
for slider in rotation_sliders:
|
||||
if slider:
|
||||
slider.set_value(rotation_sliders[slider])
|
||||
|
||||
# Update limit sliders
|
||||
var limit_sliders = {
|
||||
$VBoxContainer/RotationalLimitsSection/rotLimitMinSlider: Global.heldSprite.rLimitMin,
|
||||
$VBoxContainer/RotationalLimitsSection/rotLimitMaxSlider: Global.heldSprite.rLimitMax
|
||||
}
|
||||
|
||||
for slider in limit_sliders:
|
||||
if slider:
|
||||
slider.set_value(limit_sliders[slider])
|
||||
|
||||
# Update animation sliders
|
||||
var animation_sliders = {
|
||||
$VBoxContainer/AnimationSection/animFramesSlider: Global.heldSprite.frames,
|
||||
$VBoxContainer/AnimationSection/animSpeedSlider: Global.heldSprite.animSpeed
|
||||
}
|
||||
|
||||
for slider in animation_sliders:
|
||||
if slider:
|
||||
slider.set_value(animation_sliders[slider])
|
||||
|
||||
# Update opacity slider
|
||||
var opacity_slider = $VBoxContainer/RenderingSection/opacitySlider
|
||||
if opacity_slider:
|
||||
opacity_slider.set_value(Global.heldSprite.spriteOpacity)
|
||||
|
||||
## Update wobble control states based on sync status
|
||||
func updateWobbleControlStates():
|
||||
if Global.heldSprite == null:
|
||||
return
|
||||
|
||||
var isSynced = Global.heldSprite.isSynced()
|
||||
# Use slider manager if available
|
||||
if slider_manager:
|
||||
slider_manager.update_wobble_control_states(Global.heldSprite)
|
||||
|
||||
# Keep wobble controls enabled even when synced (they edit group settings)
|
||||
$WobbleControl/xFrq.editable = true
|
||||
$WobbleControl/xAmp.editable = true
|
||||
$WobbleControl/yFrq.editable = true
|
||||
$WobbleControl/yAmp.editable = true
|
||||
$WobbleControl/rFrq.editable = true
|
||||
$WobbleControl/rAmp.editable = true
|
||||
# Also update individual wobble sliders for visual feedback
|
||||
var is_synced = Global.heldSprite.isSynced()
|
||||
var tint = Color(1.0, 1.0, 0.9) if is_synced else Color.WHITE
|
||||
|
||||
# Visual feedback for sync state - slight tint to indicate group editing
|
||||
var tint = Color(1.0, 1.0, 0.9) if isSynced else Color.WHITE
|
||||
$WobbleControl/xFrq.modulate = tint
|
||||
$WobbleControl/xAmp.modulate = tint
|
||||
$WobbleControl/yFrq.modulate = tint
|
||||
$WobbleControl/yAmp.modulate = tint
|
||||
$WobbleControl/rFrq.modulate = tint
|
||||
$WobbleControl/rAmp.modulate = tint
|
||||
var wobble_sliders = [
|
||||
$VBoxContainer/WobbleSection/xFrqSlider,
|
||||
$VBoxContainer/WobbleSection/xAmpSlider,
|
||||
$VBoxContainer/WobbleSection/yFrqSlider,
|
||||
$VBoxContainer/WobbleSection/yAmpSlider,
|
||||
$VBoxContainer/WobbleSection/rFrqSlider,
|
||||
$VBoxContainer/WobbleSection/rAmpSlider
|
||||
]
|
||||
|
||||
for slider in wobble_sliders:
|
||||
if slider and slider.has_method("set_modulate_color"):
|
||||
slider.set_modulate_color(tint)
|
||||
slider.set_editable(true) # Keep enabled even when synced
|
||||
|
||||
func _process(delta):
|
||||
|
||||
@@ -155,9 +303,9 @@ func _process(delta):
|
||||
spriteSpin.rotate_y(delta*4.0)
|
||||
parentSpin.rotate_y(delta*4.0)
|
||||
|
||||
$Position/Label.text = "position X : "+str(obj.position.x)+" Y: " + str(obj.position.y)
|
||||
$Position/Label2.text = "offset X : "+str(obj.offset.x)+" Y: " + str(obj.offset.y)
|
||||
$Position/Label3.text = "layer : "+str(obj.z)
|
||||
$VBoxContainer/InfoSection/PositionLabel.text = "position X : "+str(obj.position.x)+" Y: " + str(obj.position.y)
|
||||
$VBoxContainer/InfoSection/OffsetLabel.text = "offset X : "+str(obj.offset.x)+" Y: " + str(obj.offset.y)
|
||||
$VBoxContainer/InfoSection/LayerLabel.text = "layer : "+str(obj.z)
|
||||
|
||||
#Sprite Rotational Limit Display
|
||||
|
||||
@@ -165,85 +313,22 @@ func _process(delta):
|
||||
var minimum = Global.heldSprite.rLimitMin
|
||||
|
||||
spriteRotDisplay.rotation_degrees = sin(Global.animationTick*0.05)*(size/2.0)+(minimum+(size/2.0))
|
||||
$RotationalLimits/RotBack/RotLineDisplay3.rotation_degrees = spriteRotDisplay.rotation_degrees
|
||||
|
||||
|
||||
func _on_drag_slider_value_changed(value):
|
||||
if Global.heldSprite != null:
|
||||
$Slider/Label.text = "drag: " + str(value)
|
||||
Global.heldSprite.dragSpeed = value
|
||||
|
||||
|
||||
func _on_x_frq_value_changed(value):
|
||||
print("DEBUG: _on_x_frq_value_changed called with value: ", value)
|
||||
$WobbleControl/xFrqLabel.text = "x frequency: " + str(value)
|
||||
Global.heldSprite.updateWobbleParameter("xFrq", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
|
||||
func _on_x_amp_value_changed(value):
|
||||
print("DEBUG: _on_x_amp_value_changed called with value: ", value)
|
||||
$WobbleControl/xAmpLabel.text = "x amplitude: " + str(value)
|
||||
Global.heldSprite.updateWobbleParameter("xAmp", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
|
||||
func _on_y_frq_value_changed(value):
|
||||
print("DEBUG: _on_y_frq_value_changed called with value: ", value)
|
||||
$WobbleControl/yFrqLabel.text = "y frequency: " + str(value)
|
||||
Global.heldSprite.updateWobbleParameter("yFrq", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
func _on_y_amp_value_changed(value):
|
||||
print("DEBUG: _on_y_amp_value_changed called with value: ", value)
|
||||
$WobbleControl/yAmpLabel.text = "y amplitude: " + str(value)
|
||||
Global.heldSprite.updateWobbleParameter("yAmp", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
|
||||
func _on_r_frq_value_changed(value):
|
||||
print("DEBUG: _on_r_frq_value_changed called with value: ", value)
|
||||
$WobbleControl/rFrqLabel.text = "rotation frequency: " + str(value)
|
||||
Global.heldSprite.updateWobbleParameter("rFrq", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
func _on_r_amp_value_changed(value):
|
||||
print("DEBUG: _on_r_amp_value_changed called with value: ", value)
|
||||
$WobbleControl/rAmpLabel.text = "rotation amplitude: " + str(value) + "%"
|
||||
Global.heldSprite.updateWobbleParameter("rAmp", value)
|
||||
# Refresh wobble sync control after parameter change
|
||||
if wobbleSyncControl:
|
||||
wobbleSyncControl.updateUI()
|
||||
|
||||
|
||||
func _on_r_drag_value_changed(value):
|
||||
$Rotation/rDragLabel.text = "rotational drag: " + str(value)
|
||||
Global.heldSprite.rdragStr = value
|
||||
$VBoxContainer/RotationalLimitsSection/RotBack/RotLineDisplay3.rotation_degrees = spriteRotDisplay.rotation_degrees
|
||||
|
||||
|
||||
func _on_speaking_pressed():
|
||||
var f = $Buttons/Speaking.frame
|
||||
var f = $VBoxContainer/Buttons/SpeakingWrapper/Speaking.frame
|
||||
f = (f+1) % 3
|
||||
|
||||
$Buttons/Speaking.frame = f
|
||||
$VBoxContainer/Buttons/SpeakingWrapper/Speakingaking.frame = f
|
||||
Global.heldSprite.showOnTalk = f
|
||||
|
||||
|
||||
func _on_blinking_pressed():
|
||||
var f = $Buttons/Blinking.frame
|
||||
var f = $VBoxContainer/Buttons/BlinkingWrapper/Blinking.frame
|
||||
f = (f+1) % 3
|
||||
|
||||
$Buttons/Blinking.frame = f
|
||||
$VBoxContainer/Buttons/BlinkingWrapper/Blinking.frame = f
|
||||
Global.heldSprite.showOnBlink = f
|
||||
|
||||
|
||||
@@ -264,38 +349,26 @@ func _on_unlink_pressed():
|
||||
setImage()
|
||||
|
||||
|
||||
func _on_rot_limit_min_value_changed(value):
|
||||
$RotationalLimits/RotLimitMin.text = "rotational limit min: " + str(value)
|
||||
Global.heldSprite.rLimitMin = value
|
||||
|
||||
changeRotLimit()
|
||||
|
||||
func _on_rot_limit_max_value_changed(value):
|
||||
$RotationalLimits/RotLimitMax.text = "rotational limit max: " + str(value)
|
||||
Global.heldSprite.rLimitMax = value
|
||||
|
||||
changeRotLimit()
|
||||
|
||||
func changeRotLimit():
|
||||
$RotationalLimits/RotBack/rotLimitBar.value = Global.heldSprite.rLimitMax - Global.heldSprite.rLimitMin
|
||||
$RotationalLimits/RotBack/rotLimitBar.rotation_degrees = Global.heldSprite.rLimitMin + 90
|
||||
$VBoxContainer/RotationalLimitsSection/RotBack/rotLimitBar.value = Global.heldSprite.rLimitMax - Global.heldSprite.rLimitMin
|
||||
$VBoxContainer/RotationalLimitsSection/RotBack/rotLimitBar.rotation_degrees = Global.heldSprite.rLimitMin + 90
|
||||
|
||||
$RotationalLimits/RotBack/RotLineDisplay.rotation_degrees = Global.heldSprite.rLimitMin
|
||||
$RotationalLimits/RotBack/RotLineDisplay2.rotation_degrees = Global.heldSprite.rLimitMax
|
||||
$VBoxContainer/RotationalLimitsSection/RotBack/RotLineDisplay.rotation_degrees = Global.heldSprite.rLimitMin
|
||||
$VBoxContainer/RotationalLimitsSection/RotBack/RotLineDisplay2.rotation_degrees = Global.heldSprite.rLimitMax
|
||||
|
||||
func setLayerButtons():
|
||||
var a = Global.heldSprite.costumeLayers.duplicate()
|
||||
|
||||
$Layers/Layer1.frame = 1-a[0]
|
||||
$Layers/Layer2.frame = 1-a[1]
|
||||
$Layers/Layer3.frame = 1-a[2]
|
||||
$Layers/Layer4.frame = 1-a[3]
|
||||
$Layers/Layer5.frame = 1-a[4]
|
||||
$Layers/Layer6.frame = 1-a[5]
|
||||
$Layers/Layer7.frame = 1-a[6]
|
||||
$Layers/Layer8.frame = 1-a[7]
|
||||
$Layers/Layer9.frame = 1-a[8]
|
||||
$Layers/Layer10.frame = 1-a[9]
|
||||
$VBoxContainer/LayersSection/HBoxContainer/Layer1Container/Layer1.frame = 1-a[0]
|
||||
$VBoxContainer/LayersSection/HBoxContainer/Layer2Container/Layer2.frame = 1-a[1]
|
||||
$VBoxContainer/LayersSection/HBoxContainer/Layer3Container/Layer3.frame = 1-a[2]
|
||||
$VBoxContainer/LayersSection/HBoxContainer/Layer4Container/Layer4.frame = 1-a[3]
|
||||
$VBoxContainer/LayersSection/HBoxContainer/Layer5Container/Layer5.frame = 1-a[4]
|
||||
$VBoxContainer/LayersSection/HBoxContainer2/Layer6Container/Layer6.frame = 1-a[5]
|
||||
$VBoxContainer/LayersSection/HBoxContainer2/Layer7Container/Layer7.frame = 1-a[6]
|
||||
$VBoxContainer/LayersSection/HBoxContainer2/Layer8Container/Layer8.frame = 1-a[7]
|
||||
$VBoxContainer/LayersSection/HBoxContainer2/Layer9Container/Layer9.frame = 1-a[8]
|
||||
$VBoxContainer/LayersSection/HBoxContainer2/Layer10Container/Layer10.frame = 1-a[9]
|
||||
|
||||
var nodes = get_tree().get_nodes_in_group("saved")
|
||||
for sprite in nodes:
|
||||
@@ -386,70 +459,48 @@ func layerSelected():
|
||||
var newPos = Vector2.ZERO
|
||||
match Global.main.costume:
|
||||
1:
|
||||
newPos = $Layers/Layer1.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer/Layer1Container/Layer1.position
|
||||
2:
|
||||
newPos = $Layers/Layer2.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer/Layer2Container/Layer2.position
|
||||
3:
|
||||
newPos = $Layers/Layer3.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer/Layer3Container/Layer3.position
|
||||
4:
|
||||
newPos = $Layers/Layer4.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer/Layer4Container/Layer4.position
|
||||
5:
|
||||
newPos = $Layers/Layer5.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer/Layer5Container/Layer5.position
|
||||
6:
|
||||
newPos = $Layers/Layer6.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer2/Layer6Container/Layer6.position
|
||||
7:
|
||||
newPos = $Layers/Layer7.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer2/Layer7Container/Layer7.position
|
||||
8:
|
||||
newPos = $Layers/Layer8.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer2/Layer8Container/Layer8.position
|
||||
9:
|
||||
newPos = $Layers/Layer9.position
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer2/Layer9Container/Layer9.position
|
||||
10:
|
||||
newPos = $Layers/Layer10.position
|
||||
$Layers/Select.position = newPos
|
||||
|
||||
|
||||
func _on_squash_value_changed(value):
|
||||
$Rotation/squashlabel.text = "squash: " + str(value)
|
||||
Global.heldSprite.stretchAmount = value
|
||||
|
||||
|
||||
func _on_check_box_toggled(button_pressed):
|
||||
Global.heldSprite.ignoreBounce = button_pressed
|
||||
|
||||
|
||||
func _on_anim_speed_value_changed(value):
|
||||
$Animation/animSpeedLabel.text = "animation speed: " + str(value)
|
||||
Global.heldSprite.animSpeed = value
|
||||
|
||||
func _on_anim_frames_value_changed(value):
|
||||
$Animation/animFramesLabel.text = "sprite frames: " + str(value)
|
||||
Global.heldSprite.frames = value
|
||||
spriteSpin.hframes = Global.heldSprite.frames
|
||||
Global.heldSprite.changeFrames()
|
||||
newPos = $VBoxContainer/LayersSection/HBoxContainer2/Layer10Container/Layer10.position
|
||||
|
||||
|
||||
func _on_clip_linked_toggled(button_pressed):
|
||||
Global.heldSprite.setClip(button_pressed)
|
||||
|
||||
|
||||
func _on_check_box_toggled(button_pressed):
|
||||
Global.heldSprite.ignoreBounce = button_pressed
|
||||
|
||||
|
||||
func _on_delete_pressed():
|
||||
Global.heldSprite.toggle = "null"
|
||||
$VisToggle/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
$VBoxContainer/BoxContainer/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
Global.heldSprite.makeVis()
|
||||
|
||||
func _on_set_toggle_pressed():
|
||||
$VisToggle/setToggle/Label.text = "toggle: AWAITING INPUT"
|
||||
$VBoxContainer/BoxContainer/setToggle/Labelbel.text = "toggle: AWAITING INPUT"
|
||||
await Global.main.fatfuckingballs
|
||||
|
||||
var keys = await Global.main.spriteVisToggles
|
||||
var key = keys[0]
|
||||
Global.heldSprite.toggle = key
|
||||
$VisToggle/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
|
||||
func _on_opacity_slider_value_changed(value):
|
||||
$Opacity/opacityLabel.text = "opacity: " + str(int(value * 100)) + "%"
|
||||
Global.heldSprite.spriteOpacity = value
|
||||
Global.heldSprite.updateOpacity()
|
||||
$VBoxContainer/BoxContainer/setToggle/Label.text = "toggle: \"" + Global.heldSprite.toggle + "\""
|
||||
|
||||
func _on_affect_children_check_toggled(button_pressed):
|
||||
Global.heldSprite.affectChildrenOpacity = button_pressed
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
15017
ui_scenes/spriteEditMenu/sprite_viewer.tscn19865666400.tmp
Normal file
15017
ui_scenes/spriteEditMenu/sprite_viewer.tscn19865666400.tmp
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user