Class: Battle::Visual
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00201 Trainer_transition.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00202 Show_player_choice.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00002 Transition/00100 RBYWild.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00002 Transition/00000 Transition.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00002 Transition/00100 RBYTrainer.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00203 Show_skill_or_target_choice.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00204 Show_item_or_pokemon_choice.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01001 HPAnimation.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00002 Transition/00200 Gen6Trainer.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01002 FakeHPAnimation.rb,
scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01000 IdlePokemonAnimation.rb
Overview
Class that manage all the thing that are visually seen on the screen
Defined Under Namespace
Modules: Transition Classes: FakeHPAnimation, HPAnimation, IdlePokemonAnimation
Constant Summary collapse
- BACKGROUND_NAMES =
Name of the background according to their processed zone_type
%w[back_building back_grass back_tall_grass back_taller_grass back_cave back_mount back_sand back_pond back_sea back_under_water back_ice back_snow]
- BAG_PARTY_POSITIONS =
Variable giving the position of the battlers to show from bank 0 in bag UI
0..5
Instance Attribute Summary collapse
-
#animations ⇒ Array
readonly
List of the animation.
-
#parallel_animations ⇒ Hash
readonly
List of the parallel animation.
-
#to_dispose ⇒ Array
readonly
The element to dispose on #dispose.
-
#viewport ⇒ Viewport
readonly
The viewport used to show the sprites.
-
#viewport_sub ⇒ Viewport
readonly
The viewport used to show some UI part.
Instance Method Summary collapse
-
#battler_sprite(bank, position) ⇒ BattleUI::PokemonSprite?
Retrieve the sprite of a battler.
-
#dispose
Dispose the visuals.
-
#hide_ability(target)
Hide the ability animation (no effect if no_go_out = false).
-
#hide_info_bar(pokemon)
Show a specific bar.
-
#hide_info_bars(no_animation = false, bank: nil)
Hide all the bars.
-
#hide_team_info
Hide team info.
-
#initialize(scene) ⇒ Visual
constructor
Create a new visual instance.
-
#lock
Lock the battle scene.
-
#locking? ⇒ Boolean
Tell if the visual are locking the battle update (for transition purpose).
-
#refresh_info_bar(pokemon)
Refresh a specific bar (when Pokemon loses HP or change state).
-
#scene_update_proc { ... }
Display animation & stuff like that by updating the scene.
-
#set_info_state(state, pokemon = nil)
Set the state info.
-
#show_ability(target, no_go_out = false)
Show the ability animation.
-
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation.
-
#show_exp_distribution(exp_data)
Show the exp distribution.
-
#show_hp_animations(targets, hps, effectiveness = [], &messages)
Show HP animations.
-
#show_info_bar(pokemon)
Show a specific bar.
-
#show_info_bars(bank: nil)
Show all the bars.
-
#show_item(target)
Show the item user animation.
-
#show_item_choice ⇒ PFM::ItemDescriptor::Wrapper?
Method that show the item choice.
-
#show_kos(targets)
Show KO animations.
-
#show_move_animation(user, targets, move)
Make a move animation.
-
#show_player_choice(pokemon_index) ⇒ Symbol, ...
Method that shows the trainer choice.
-
#show_pokemon_choice(forced = false) ⇒ PFM::PokemonBattler?
Method that show the pokemon choice.
-
#show_pre_transition
Method that show the pre_transition of the battle.
-
#show_rmxp_animation(target, id)
Show a dedicated animation.
-
#show_skill_choice(pokemon_index) ⇒ Boolean
Method that show the skill choice and store it inside an instance variable.
-
#show_switch_form_animation(target)
Show the pokemon switch form animation.
-
#show_target_choice ⇒ Array<PFM::PokemonBattler, Battle::Move, Integer(bank), Integer(position), Boolean(mega)>?
Method that show the target choice once the skill was choosen.
-
#show_team_info
Show team info.
-
#show_transition
Method that show the trainer transition of the battle.
-
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap.
-
#spc_show_message(pokemon_index)
Show the message “What will X do”.
-
#store_battler_sprite(bank, position, sprite)
Function storing a battler sprite in the battler Hash.
-
#to_s
(also: #inspect)
Safe to_s & inspect.
-
#unlock
Unlock the battle scene.
-
#update
Update the visuals.
-
#wait_for_animation
Wait for all animation to end (non parallel one).
Constructor Details
#initialize(scene) ⇒ Visual
Create a new visual instance
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 25 def initialize(scene) @scene = scene @screenshot = take_snapshot # All the battler by bank @battlers = {} # All the bars by bank @info_bars = {} # All the team info bar by bank @team_info = {} # All the ability bar by bank # @type [Hash{ Integer => Array<BattleUI::AbilityBar> }] @ability_bars = {} # All the item bar by bank # @type [Hash{ Integer => Array<BattleUI::ItemBar> }] @item_bars = {} # All the animation currently being processed (automatically removed) @animations = [] # All the animatable object @animatable = [] # All the parallel animations (manually removed) @parallel_animations = {} # All the thing to dispose on #dispose @to_dispose = [] # Is the visual locking the update of the battle @locking = false # Create all the sprites create_graphics create_battle_animation_handler @viewport&.sort_z end |
Instance Attribute Details
#animations ⇒ Array (readonly)
Returns List of the animation.
12 13 14 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 12 def animations @animations end |
#parallel_animations ⇒ Hash (readonly)
Returns List of the parallel animation.
9 10 11 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 9 def parallel_animations @parallel_animations end |
#to_dispose ⇒ Array (readonly)
Returns the element to dispose on #dispose.
21 22 23 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 21 def to_dispose @to_dispose end |
#viewport ⇒ Viewport (readonly)
Returns the viewport used to show the sprites.
15 16 17 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 15 def @viewport end |
#viewport_sub ⇒ Viewport (readonly)
Returns the viewport used to show some UI part.
18 19 20 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 18 def @viewport_sub end |
Instance Method Details
#battler_sprite(bank, position) ⇒ BattleUI::PokemonSprite?
Retrieve the sprite of a battler
41 42 43 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00201 Trainer_transition.rb', line 41 def battler_sprite(bank, position) @battlers.dig(bank, position) end |
#dispose
Dispose the visuals
76 77 78 79 80 81 82 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 76 def dispose @to_dispose.each(&:dispose) @animations.clear @parallel_animations.clear @viewport.dispose @viewport_sub.dispose end |
#hide_ability(target)
Hide the ability animation (no effect if no_go_out = false)
63 64 65 66 67 68 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 63 def hide_ability(target) = @ability_bars[target.bank][target.position] return unless || .no_go_out .go_out end |
#hide_info_bar(pokemon)
Show a specific bar
46 47 48 49 50 51 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 46 def (pokemon) # @type [BattleUI::InfoBar] = @info_bars.dig(pokemon.bank, pokemon.position) return log_error("No battle bar at position #{pokemon.bank}, #{pokemon.position}") unless .go_out unless .out? end |
#hide_info_bars(no_animation = false, bank: nil)
Hide all the bars
6 7 8 9 10 11 12 13 14 15 16 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 6 def (no_animation = false, bank: nil) enum = bank ? [@info_bars[bank]].each : @info_bars.each_value enum.each do || if no_animation .each { || .visible = false } else .each { || .go_out unless .out? } end end end |
#hide_team_info
Hide team info
89 90 91 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 89 def hide_team_info @team_info.each_value { |info| info.go_out unless info.out? } end |
#lock
Lock the battle scene
95 96 97 98 99 100 101 102 103 104 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 95 def lock if block_given? raise 'Race condition' if locking? @locking = true yield return @locking = false end @locking = true end |
#locking? ⇒ Boolean
Tell if the visual are locking the battle update (for transition purpose)
85 86 87 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 85 def locking? @locking end |
#refresh_info_bar(pokemon)
Refresh a specific bar (when Pokemon loses HP or change state)
55 56 57 58 59 60 61 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 55 def (pokemon) # @type [BattleUI::InfoBar] = @info_bars.dig(pokemon.bank, pokemon.position) @team_info[pokemon.bank]&.refresh return log_error("No battle bar at position #{pokemon.bank}, #{pokemon.position}") unless .refresh end |
#scene_update_proc { ... }
this function raise if the visual are not locked
Display animation & stuff like that by updating the scene
109 110 111 112 113 114 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 109 def scene_update_proc raise 'Unlocked visual while trying to update scene!' unless @locking yield @scene.update Graphics.update end |
#set_info_state(state, pokemon = nil)
Set the state info
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 66 def set_info_state(state, pokemon = nil) if state == :choice (bank: 1) (bank: 0) show_team_info elsif state == :move pokemon&.each { |target| (target) } elsif state == :move_animation hide_team_info end end |
#show_ability(target, no_go_out = false)
Show the ability animation
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 47 def show_ability(target, no_go_out = false) = @ability_bars[target.bank][target.position] = @item_bars[target.bank][target.position] return unless .data = target .go_in_ability(no_go_out) if ! || .done? .z = 0 else .z = .z + 1 end end |
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation
140 141 142 143 144 145 146 147 148 149 150 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 140 def show_catch_animation(target_pokemon, ball, nb_bounce, caught) origin = battler_sprite(0, 0) target = battler_sprite(target_pokemon.bank, target_pokemon.position) sprite = UI::ThrowingBallSprite.new(origin., ball) animation = create_throw_ball_animation(sprite, target, origin) create_move_ball_animation(animation, sprite, nb_bounce) caught ? create_caught_animation(animation, sprite) : create_break_animation(animation, sprite, target) animation.start @animations << animation wait_for_animation end |
#show_exp_distribution(exp_data)
Show the exp distribution
124 125 126 127 128 129 130 131 132 133 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 124 def show_exp_distribution(exp_data) lock do exp_ui = BattleUI::ExpDistribution.new(@viewport_sub, @scene, exp_data) @scene.(ext_text(8999, 21)) exp_ui.start_animation scene_update_proc { exp_ui.update } until exp_ui.done? exp_ui.dispose end exp_data.each_key { |pokemon| (pokemon) if pokemon.can_fight? } end |
#show_hp_animations(targets, hps, effectiveness = [], &messages)
Show HP animations
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 8 def show_hp_animations(targets, hps, effectiveness = [], &) lock do animations = targets.map.with_index do |target, index| (target) if hps[index] && hps[index] == 0 next Battle::Visual::FakeHPAnimation.new(@scene, target, effectiveness[index]) elsif hps[index] next Battle::Visual::HPAnimation.new(@scene, target, hps[index], effectiveness[index]) end end wait_for_animation scene_update_proc { animations.each(&:update) } until animations.all?(&:done?) &.call show_kos(targets) end end |
#show_info_bar(pokemon)
Show a specific bar
34 35 36 37 38 39 40 41 42 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 34 def (pokemon) # @type [BattleUI::InfoBar] = @info_bars.dig(pokemon.bank, pokemon.position) return log_error("No battle bar at position #{pokemon.bank}, #{pokemon.position}") unless .pokemon = pokemon return if pokemon.dead? .go_in unless .in? end |
#show_info_bars(bank: nil)
Show all the bars
20 21 22 23 24 25 26 27 28 29 30 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 20 def (bank: nil) enum = bank ? [@info_bars[bank]].each : @info_bars.each_value enum.each do || .each do || .pokemon = .pokemon next .visible = false unless .pokemon&.alive? .go_in unless .in? end end end |
#show_item(target)
Show the item user animation
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 72 def show_item(target) = @ability_bars[target.bank][target.position] = @item_bars[target.bank][target.position] return unless .data = target .go_in_ability .z = .z + 1 unless ! || .done? if ! || .done? .z = 0 else .z = .z + 1 end end |
#show_item_choice ⇒ PFM::ItemDescriptor::Wrapper?
Method that show the item choice
7 8 9 10 11 12 13 14 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00204 Show_item_or_pokemon_choice.rb', line 7 def show_item_choice data_to_return = nil GamePlay.open_battle_bag(retrieve_party) do |battle_bag_scene| data_to_return = battle_bag_scene.battle_item_wrapper end log_debug("show_item_choice returned #{data_to_return}") return data_to_return end |
#show_kos(targets)
Show KO animations
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 27 def show_kos(targets) targets = targets.select(&:dead?) return if targets.empty? play_ko_se # Start all animations targets.each do |target| battler_sprite(target.bank, target.position).go_out (target) end # Show messages targets.each do |target| @scene.(parse_text_with_pokemon(19, 0, target, PFM::Text::PKNICK[0] => target.given_name)) target.status = 0 end end |
#show_move_animation(user, targets, move)
Make a move animation
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 98 def show_move_animation(user, targets, move) return unless $options.show_animation $data_animations ||= load_data('Data/Animations.rxdata') id = move.id user_sprite = battler_sprite(user.bank, user.position) target_sprite = battler_sprite(targets.first.bank, targets.first.position) original_rect = @viewport.rect.clone @viewport.rect.height = Viewport::CONFIGS[:main][:height] lock { @move_animator.move_animation(user_sprite, target_sprite, id, user.bank != 0) } @viewport.rect = original_rect end |
#show_player_choice(pokemon_index) ⇒ Symbol, ...
Method that shows the trainer choice
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00202 Show_player_choice.rb', line 6 def show_player_choice(pokemon_index) if (pokemon = @scene.logic.battler(0, pokemon_index)).effects.has?(&:force_next_move?) # @type [Effects::ForceNextMove] effect = pokemon.effects.get(&:force_next_move?) return :action, effect.make_action end # return :try_next if spc_cannot_use_this_pokemon?(pokemon_index) show_player_choice_begin(pokemon_index) show_player_choice_loop show_player_choice_end(pokemon_index) return @player_choice_ui.result, @player_choice_ui.action end |
#show_pokemon_choice(forced = false) ⇒ PFM::PokemonBattler?
Method that show the pokemon choice
19 20 21 22 23 24 25 26 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00204 Show_item_or_pokemon_choice.rb', line 19 def show_pokemon_choice(forced = false) data_to_return = nil GamePlay.(party = retrieve_party, forced) do |scene| data_to_return = party[scene.return_data] if scene.pokemon_selected? end log_debug("show_pokemon_choice returned #{data_to_return}") return data_to_return end |
#show_pre_transition
Method that show the pre_transition of the battle
4 5 6 7 8 9 10 11 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00201 Trainer_transition.rb', line 4 def show_pre_transition # return if debug? && ARGV.includes?('skip_battle_transition') # @type [Battle::Visual::RBJ_WildTransition] @transition = battle_transition.new(@scene, @screenshot) @animations << @transition @transition.pre_transition @locking = true end |
#show_rmxp_animation(target, id)
Show a dedicated animation
114 115 116 117 118 119 120 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 114 def show_rmxp_animation(target, id) return unless $options.show_animation wait_for_animation $data_animations ||= load_data('Data/Animations.rxdata') lock { @move_animator.animation(battler_sprite(target.bank, target.position), id, target.bank != 0) } end |
#show_skill_choice(pokemon_index) ⇒ Boolean
Method that show the skill choice and store it inside an instance variable
6 7 8 9 10 11 12 13 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00203 Show_skill_or_target_choice.rb', line 6 def show_skill_choice(pokemon_index) return :try_next if spc_cannot_use_this_pokemon?(pokemon_index) show_skill_choice_begin(pokemon_index) show_skill_choice_loop show_skill_choice_end(pokemon_index) return @skill_choice_ui.result != :cancel end |
#show_switch_form_animation(target)
Show the pokemon switch form animation
89 90 91 92 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00206 Show_stuff.rb', line 89 def show_switch_form_animation(target) battler_sprite(target.bank, target.position)&.pokemon = target # TODO: Implement an animation for that & write the code end |
#show_target_choice ⇒ Array<PFM::PokemonBattler, Battle::Move, Integer(bank), Integer(position), Boolean(mega)>?
Method that show the target choice once the skill was choosen
17 18 19 20 21 22 23 24 25 26 27 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00203 Show_skill_or_target_choice.rb', line 17 def show_target_choice return stc_result if stc_cannot_choose_target? show_target_choice_begin show_target_choice_loop show_target_choice_end return stc_result(@target_selection_window.result) ensure @target_selection_window&.dispose @target_selection_window = nil end |
#show_team_info
Show team info
81 82 83 84 85 86 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00205 Info_Bars.rb', line 81 def show_team_info @team_info.each_value do |info| info.refresh info.go_in unless info.in? end end |
#show_transition
Method that show the trainer transition of the battle
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00201 Trainer_transition.rb', line 14 def show_transition # return show_debug_transition if debug? && ARGV.includes?('skip_battle_transition') # Load transtion (x/y, dpp, frlg) # store the transition loop # Show the message "issuing a battle" # store the enemy ball animation # Show the message "send x & y" # store the actor ball animation # show the message "send x & y" @animations << @transition @transition.transition @locking = true end |
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap
128 129 130 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 128 def snap_to_bitmaps return [@viewport, @viewport_sub].map(&:snap_to_bitmap) end |
#spc_show_message(pokemon_index)
Show the message “What will X do”
22 23 24 25 26 27 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00202 Show_player_choice.rb', line 22 def (pokemon_index) # pokemon = @scene.logic.battler(0, pokemon_index) @scene..wait_input = false # text_to_show = parse_text(18, 71, '[VAR 010C(0000)]' => pokemon.given_name) # @scene.display_message(text_to_show) if @scene.message_window.last_text != text_to_show end |
#store_battler_sprite(bank, position, sprite)
Function storing a battler sprite in the battler Hash
32 33 34 35 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00201 Trainer_transition.rb', line 32 def store_battler_sprite(bank, position, sprite) @battlers[bank] ||= {} @battlers[bank][position] = sprite end |
#to_s Also known as: inspect
Safe to_s & inspect
57 58 59 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 57 def to_s format('#<%<class>s:%<id>08X>', class: self.class, id: __id__) end |
#unlock
Unlock the battle scene
90 91 92 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 90 def unlock @locking = false end |
#update
Update the visuals
63 64 65 66 67 68 69 70 71 72 73 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 63 def update @animations.each(&:update) @animations.delete_if(&:done?) @parallel_animations.each_value(&:update) @gif_container&.update(@background.bitmap) update_battlers update_team_info end |
#wait_for_animation
Wait for all animation to end (non parallel one)
117 118 119 120 121 122 123 124 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00200 Visual.rb', line 117 def wait_for_animation # log_debug('Entring wait_for_animation') # uncomment for deep debug was_locked = @locking lock unless was_locked scene_update_proc { update } until @animations.all?(&:done?) && @animatable.all?(&:done?) unlock unless was_locked # log_debug('Leaving wait_for_animation') # uncomment for deep debug end |