Anim Editor: bug fixes relating to deleting particles, added some animations

This commit is contained in:
Maruno17
2024-04-22 23:50:54 +01:00
parent 23a8c552d6
commit 99aec45c5c
10 changed files with 389 additions and 103 deletions

View File

@@ -560,7 +560,7 @@ AnimationEditor::SidePanes.add_property(:particle_pane, :foe_invert_y, {
AnimationEditor::SidePanes.add_property(:particle_pane, :foe_flip, {
:new => proc { |pane, editor|
pane.add_labelled_checkbox(:foe_flip, _INTL("Flip Sprite"), false)
pane.add_labelled_checkbox(:foe_flip, _INTL("Flip sprite"), false)
},
:refresh_value => proc { |control, editor|
focus = editor.anim[:particles][editor.particle_index][:focus]
@@ -610,6 +610,7 @@ AnimationEditor::SidePanes.add_property(:particle_pane, :delete, {
AnimationEditor::ParticleDataHelper.delete_particle(editor.anim[:particles], p_index)
editor.components[:particle_list].delete_particle(p_index)
editor.components[:particle_list].set_particles(editor.anim[:particles])
p_index = editor.particle_index
editor.components[:particle_list].keyframe = 0 if editor.anim[:particles][p_index][:name] == "SE"
editor.refresh
end

View File

@@ -200,7 +200,7 @@ class AnimationEditor::ParticleList < UIControls::BaseControl
end
def particle_index
return -1 if @row_index < 0
return -1 if @row_index < 0 || @row_index >= @particle_list.length
ret = @particle_list[@row_index]
return (ret.is_a?(Array)) ? ret[0] : ret
end
@@ -335,6 +335,7 @@ class AnimationEditor::ParticleList < UIControls::BaseControl
@particle_list.push([i, property]) if value.is_a?(Array)
end
end
@row_index = @particle_list.length - 1 if @row_index >= @particle_list.length
# Dispose of and clear all existing list/commands sprites
dispose_listed_sprites
# Create new sprites for each particle (1x list and 2x commands)