[Ace] Yanfly Battle Engine - Damage popup stays on screen

Yanfly Battle Engine has built-in damage popup. It stays on screen for a couple seconds and fades away.


The problem is that the last damage popup may not have time to fade out when battle ends, and it will remain on screen:


<removed>


There's this method that handles when to remove popups, I feel like this is where a fix could be made:

Code:
  def update_popups
    for popup in @popups
      popup.update
      next unless popup.opacity <= 0
      popup.bitmap.dispose
      popup.dispose
      @popups.delete(popup)
      popup = nil
    end
    @popup_flags = [] if @popups == [] && @popup_flags != []
    return unless SceneManager.scene_is?(Scene_Battle)
    if @current_active_battler != SceneManager.scene.subject
      @current_active_battler = SceneManager.scene.subject
      @popup_flags = []
    end
  end
I've moved this thread to RGSSx Script Support . Please be sure to post your threads in the correct forum next time. Thank you.
I encountered this issue a long time ago. 


Try to put this snippet right below Yanfly's Battle Engine:

Spoiler
Code:
class Scene_Battle < Scene_Base

  alias fix_pops7715 terminate
  def terminate
    ary = @spriteset.actor_sprites + @spriteset.enemy_sprites
    abs_wait(1) while ary.any? {|sp| sp.popups != [] }
    fix_pops7715
  end
  
end

This makes sure that all popups disappear before exiting the battle scene.
I encountered this issue a long time ago. 


Try to put this snippet right below Yanfly's Battle Engine:

Spoiler
Code:
class Scene_Battle < Scene_Base

  alias fix_pops7715 terminate
  def terminate
    ary = @spriteset.actor_sprites + @spriteset.enemy_sprites
    abs_wait(1) while ary.any? {|sp| sp.popups != [] }
    fix_pops7715
  end
  
end

This makes sure that all popups disappear before exiting the battle scene.



Thank you, works like a charm

Original thread: https://forums.rpgmakerweb.com/threads/ace-yanfly-battle-engine-damage-popup-stays-on-screen.70543/