From f29da5fc8fb7b5b43fde2884b1c4764f0785f377 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 1 May 2021 17:13:27 +0100 Subject: [PATCH] Fixed crash when getting the length of an ogg file, fixed mispositioning of message in Hall of Fame, fixedMusic Vlume option not applying to newly played BGM, --- Data/Scripts/008_Audio/001_Audio.rb | 10 +++++----- .../016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb | 2 +- Data/Scripts/016_UI/015_UI_Options.rb | 1 - Data/Scripts/016_UI/023_UI_MysteryGift.rb | 1 - .../Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Data/Scripts/008_Audio/001_Audio.rb b/Data/Scripts/008_Audio/001_Audio.rb index f7ea60839..aafeda6d9 100644 --- a/Data/Scripts/008_Audio/001_Audio.rb +++ b/Data/Scripts/008_Audio/001_Audio.rb @@ -25,9 +25,9 @@ def getOggPage(file) return nil if dw != 0x5367674F header = file.read(22) bodysize = 0 - hdrbodysize = (file.read(1)[0] rescue 0) + hdrbodysize = (file.read(1)[0].ord rescue 0) hdrbodysize.times do - bodysize += (file.read(1)[0] rescue 0) + bodysize += (file.read(1)[0].ord rescue 0) end ret = [header, file.pos, bodysize, file.pos + bodysize] return ret @@ -69,7 +69,7 @@ def oggfiletime(file) if serial != curserial curserial = serial file.pos = page[1] - packtype = (file.read(1)[0] rescue 0) + packtype = (file.read(1)[0].ord rescue 0) string = file.read(6) return -1 if string != "vorbis" return -1 if packtype != 1 @@ -82,9 +82,9 @@ def oggfiletime(file) end ret = 0.0 for i in 0...pcmlengths.length - ret += pcmlengths[i].to_f / rates[i] + ret += pcmlengths[i].to_f / rates[i].to_f end - return ret + return ret * 256.0 end # Gets the length of an audio file in seconds. Supports WAV, MP3, and OGG files. diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index ea8f7cf48..e35ac9fa8 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -327,7 +327,7 @@ class HallOfFame_Scene overlay=@sprites["overlay"].bitmap overlay.clear pbDrawTextPositions(overlay,[[_INTL("Welcome to the Hall of Fame!"), - Graphics.width/2,Graphics.height-80,-4,BASECOLOR,SHADOWCOLOR]]) + Graphics.width/2,Graphics.height-80,2,BASECOLOR,SHADOWCOLOR]]) end def pbAnimationLoop diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index c9a33e221..e88bcac7f 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -310,7 +310,6 @@ class PokemonOption_Scene if $PokemonSystem.bgmvolume!=value $PokemonSystem.bgmvolume = value if $game_system.playing_bgm!=nil && !inloadscreen - $game_system.playing_bgm.volume = value playingBGM = $game_system.getPlayingBGM $game_system.bgm_pause $game_system.bgm_resume(playingBGM) diff --git a/Data/Scripts/016_UI/023_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb index 1ebd6a9c2..42d75c76e 100644 --- a/Data/Scripts/016_UI/023_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/023_UI_MysteryGift.rb @@ -4,7 +4,6 @@ #=============================================================================== # This url is the location of an example Mystery Gift file. # You should change it to your file's url once you upload it. -# NOTE: Essentials cannot handle https addresses. You must use a http address. #=============================================================================== module MysteryGift URL = "https://pastebin.com/raw/w6BqqUsm" diff --git a/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb b/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb index a86fb8e6c..be97f5dc1 100644 --- a/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb +++ b/Data/Scripts/021_Compiler/005_Compiler_SpriteRenamer.rb @@ -71,7 +71,7 @@ module Compiler shadow = "_shadow" if name[/_shadow/] if name[/egg/] prefix = "Eggs/" - crack = "_icon" if default_prefix == "Icons/" || default_prefix == "Icons shiny/" + crack = "_icon" if default_prefix == "Icons/" crack = "_cracks" if name[/eggCracks/] end end