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,

This commit is contained in:
Maruno17
2021-05-01 17:13:27 +01:00
parent 748ea472ba
commit f29da5fc8f
5 changed files with 7 additions and 9 deletions

View File

@@ -25,9 +25,9 @@ def getOggPage(file)
return nil if dw != 0x5367674F return nil if dw != 0x5367674F
header = file.read(22) header = file.read(22)
bodysize = 0 bodysize = 0
hdrbodysize = (file.read(1)[0] rescue 0) hdrbodysize = (file.read(1)[0].ord rescue 0)
hdrbodysize.times do hdrbodysize.times do
bodysize += (file.read(1)[0] rescue 0) bodysize += (file.read(1)[0].ord rescue 0)
end end
ret = [header, file.pos, bodysize, file.pos + bodysize] ret = [header, file.pos, bodysize, file.pos + bodysize]
return ret return ret
@@ -69,7 +69,7 @@ def oggfiletime(file)
if serial != curserial if serial != curserial
curserial = serial curserial = serial
file.pos = page[1] file.pos = page[1]
packtype = (file.read(1)[0] rescue 0) packtype = (file.read(1)[0].ord rescue 0)
string = file.read(6) string = file.read(6)
return -1 if string != "vorbis" return -1 if string != "vorbis"
return -1 if packtype != 1 return -1 if packtype != 1
@@ -82,9 +82,9 @@ def oggfiletime(file)
end end
ret = 0.0 ret = 0.0
for i in 0...pcmlengths.length for i in 0...pcmlengths.length
ret += pcmlengths[i].to_f / rates[i] ret += pcmlengths[i].to_f / rates[i].to_f
end end
return ret return ret * 256.0
end end
# Gets the length of an audio file in seconds. Supports WAV, MP3, and OGG files. # Gets the length of an audio file in seconds. Supports WAV, MP3, and OGG files.

View File

@@ -327,7 +327,7 @@ class HallOfFame_Scene
overlay=@sprites["overlay"].bitmap overlay=@sprites["overlay"].bitmap
overlay.clear overlay.clear
pbDrawTextPositions(overlay,[[_INTL("Welcome to the Hall of Fame!"), 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 end
def pbAnimationLoop def pbAnimationLoop

View File

@@ -310,7 +310,6 @@ class PokemonOption_Scene
if $PokemonSystem.bgmvolume!=value if $PokemonSystem.bgmvolume!=value
$PokemonSystem.bgmvolume = value $PokemonSystem.bgmvolume = value
if $game_system.playing_bgm!=nil && !inloadscreen if $game_system.playing_bgm!=nil && !inloadscreen
$game_system.playing_bgm.volume = value
playingBGM = $game_system.getPlayingBGM playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause $game_system.bgm_pause
$game_system.bgm_resume(playingBGM) $game_system.bgm_resume(playingBGM)

View File

@@ -4,7 +4,6 @@
#=============================================================================== #===============================================================================
# This url is the location of an example Mystery Gift file. # This url is the location of an example Mystery Gift file.
# You should change it to your file's url once you upload it. # 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 module MysteryGift
URL = "https://pastebin.com/raw/w6BqqUsm" URL = "https://pastebin.com/raw/w6BqqUsm"

View File

@@ -71,7 +71,7 @@ module Compiler
shadow = "_shadow" if name[/_shadow/] shadow = "_shadow" if name[/_shadow/]
if name[/egg/] if name[/egg/]
prefix = "Eggs/" prefix = "Eggs/"
crack = "_icon" if default_prefix == "Icons/" || default_prefix == "Icons shiny/" crack = "_icon" if default_prefix == "Icons/"
crack = "_cracks" if name[/eggCracks/] crack = "_cracks" if name[/eggCracks/]
end end
end end