From 166a289a6048600547f55f46305aa49d33a94b80 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 7 Oct 2021 18:47:28 +0100 Subject: [PATCH] Fixed transitions in controls and credits screens, fixed slight text cropping in credits screen, fixed crash when changing the scene --- Data/Scripts/005_Sprites/007_Spriteset_Map.rb | 8 ++++--- .../001_Non-interactive UI/002_UI_Controls.rb | 3 +++ .../001_Non-interactive UI/007_UI_Credits.rb | 22 ++++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb index 1a8c9ca73..ccfc733fc 100644 --- a/Data/Scripts/005_Sprites/007_Spriteset_Map.rb +++ b/Data/Scripts/005_Sprites/007_Spriteset_Map.rb @@ -63,9 +63,11 @@ class Spriteset_Map end def dispose - $scene.map_renderer.remove_tileset(@map.tileset_name) - @map.autotile_names.each { |filename| $scene.map_renderer.remove_autotile(filename) } - $scene.map_renderer.remove_extra_autotiles(@map.tileset_id) + if $scne.is_a?(Scene_Map) + $scene.map_renderer.remove_tileset(@map.tileset_name) + @map.autotile_names.each { |filename| $scene.map_renderer.remove_autotile(filename) } + $scene.map_renderer.remove_extra_autotiles(@map.tileset_id) + end @panorama.dispose @fog.dispose for sprite in @character_sprites diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb b/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb index 4eba2a310..a3b7e9365 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb @@ -66,8 +66,11 @@ class ButtonEventScene < EventScene last_screen = [@label_screens.max, @key_screens.max].max if @current_screen >= last_screen # End scene + $game_temp.background_bitmap = Graphics.snap_to_bitmap Graphics.freeze + @viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black Graphics.transition(8, "fadetoblack") + $game_temp.background_bitmap.dispose scene.dispose else # Next screen diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb index 34b2b7b6d..4f9e4ed26 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb @@ -134,6 +134,8 @@ _END_ #------------------------------- # Make background and text sprites #------------------------------- + viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) + viewport.z = 99999 text_viewport = Viewport.new(0, @trim, Graphics.width, Graphics.height - (@trim * 2)) text_viewport.z = 99999 @background_sprite = IconSprite.new(0, 0) @@ -143,7 +145,7 @@ _END_ lines_per_bitmap = @bitmap_height / 32 num_bitmaps = (credit_lines.size.to_f / lines_per_bitmap).ceil for i in 0...num_bitmaps - credit_bitmap = Bitmap.new(Graphics.width, @bitmap_height) + credit_bitmap = Bitmap.new(Graphics.width, @bitmap_height + 16) pbSetSystemFont(credit_bitmap) for j in 0...lines_per_bitmap line = credit_lines[i * lines_per_bitmap + j] @@ -159,18 +161,18 @@ _END_ linewidth = Graphics.width / 2 - 20 end credit_bitmap.font.color = TEXT_SHADOW_COLOR - credit_bitmap.draw_text(xpos, j * 32 + 8, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos, j * 32 + 12, linewidth, 32, line[k], align) credit_bitmap.font.color = TEXT_OUTLINE_COLOR - credit_bitmap.draw_text(xpos + 2, j * 32 - 2, linewidth, 32, line[k], align) - credit_bitmap.draw_text(xpos, j * 32 - 2, linewidth, 32, line[k], align) - credit_bitmap.draw_text(xpos - 2, j * 32 - 2, linewidth, 32, line[k], align) - credit_bitmap.draw_text(xpos + 2, j * 32, linewidth, 32, line[k], align) - credit_bitmap.draw_text(xpos - 2, j * 32, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos + 2, j * 32 + 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos, j * 32 + 2, linewidth, 32, line[k], align) credit_bitmap.draw_text(xpos - 2, j * 32 + 2, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos + 2, j * 32 + 4, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos - 2, j * 32 + 4, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos + 2, j * 32 + 6, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos, j * 32 + 6, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos - 2, j * 32 + 6, linewidth, 32, line[k], align) credit_bitmap.font.color = TEXT_BASE_COLOR - credit_bitmap.draw_text(xpos, j * 32, linewidth, 32, line[k], align) + credit_bitmap.draw_text(xpos, j * 32 + 4, linewidth, 32, line[k], align) end end credit_sprite = Sprite.new(text_viewport) @@ -197,11 +199,15 @@ _END_ break if $scene != self end pbBGMFade(2.0) + $game_temp.background_bitmap = Graphics.snap_to_bitmap Graphics.freeze + viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black Graphics.transition(8, "fadetoblack") + $game_temp.background_bitmap.dispose @background_sprite.dispose @credit_sprites.each { |s| s.dispose if s } text_viewport.dispose + viewport.dispose $PokemonGlobal.creditsPlayed = true pbBGMPlay(previousBGM) end