Added mp3 support back in, changed layout of townmapgen.html, screenshots now go in Screenshots folder, added "NoName" flag for trainer types

This commit is contained in:
Maruno17
2023-10-14 16:28:37 +01:00
parent d267956c6e
commit 25f85a9a8b
7 changed files with 90 additions and 40 deletions

View File

@@ -108,8 +108,8 @@ end
def pbResolveAudioSE(file)
return nil if !file
if RTP.exists?("Audio/SE/" + file, ["", ".wav", ".ogg"]) # ".mp3"
return RTP.getPath("Audio/SE/" + file, ["", ".wav", ".ogg"]) # ".mp3"
if RTP.exists?("Audio/SE/" + file, ["", ".wav", ".ogg", ".mp3", ".wma"])
return RTP.getPath("Audio/SE/" + file, ["", ".wav", ".ogg", ".mp3", ".wma"])
end
return nil
end
@@ -197,7 +197,7 @@ module RTP
end
def self.getAudioPath(filename)
return self.getPath(filename, ["", ".wav", ".wma", ".mid", ".ogg", ".midi"]) # ".mp3"
return self.getPath(filename, ["", ".wav", ".ogg", ".mp3", ".midi", ".mid", ".wma"])
end
def self.getPath(filename, extensions = [])
@@ -261,7 +261,7 @@ end
#===============================================================================
module FileTest
IMAGE_EXTENSIONS = [".png", ".gif"] # ".jpg", ".jpeg", ".bmp",
AUDIO_EXTENSIONS = [".mid", ".midi", ".ogg", ".wav", ".wma"] # ".mp3"
AUDIO_EXTENSIONS = [".wav", ".ogg", ".mp3", ".midi", ".mid", ".wma"]
def self.audio_exist?(filename)
return RTP.exists?(filename, AUDIO_EXTENSIONS)

View File

@@ -16,7 +16,8 @@ class Trainer
end
def full_name
return _INTL("{1} {2}", trainer_type_name, @name)
return @name if has_flag?("NoName")
return "#{trainer_type_name} #{@name}"
end
#=============================================================================

View File

@@ -611,7 +611,14 @@ end
def pbScreenCapture
t = Time.now
filestart = t.strftime("[%Y-%m-%d] %H_%M_%S.%L")
capturefile = RTP.getSaveFileName(sprintf("%s.png", filestart))
Graphics.screenshot(capturefile)
begin
folder_name = "Screenshots"
Dir.create(folder_name) if !Dir.safe?(folder_name)
capturefile = folder_name + "/" + sprintf("%s.png", filestart)
Graphics.screenshot(capturefile)
rescue
capturefile = RTP.getSaveFileName(sprintf("%s.png", filestart))
Graphics.screenshot(capturefile)
end
pbSEPlay("Pkmn exp full") if FileTest.audio_exist?("Audio/SE/Pkmn exp full")
end

View File

@@ -508,8 +508,8 @@ module BattleAnimationEditor
ret = false
pbRgssChdir(File.join("Audio", "SE", "Anim")) do
animfiles.concat(Dir.glob("*.wav"))
# animfiles.concat(Dir.glob("*.mp3"))
animfiles.concat(Dir.glob("*.ogg"))
animfiles.concat(Dir.glob("*.mp3"))
animfiles.concat(Dir.glob("*.wma"))
end
animfiles.uniq!

View File

@@ -613,7 +613,7 @@ def pbImportAllAnimations
Graphics.update
audios = []
files = Dir.glob(folder + "/*.*")
["wav", "ogg", "mid", "wma"].each do |ext| # mp3
["wav", "ogg", "mp3", "midi", "mid", "wma"].each do |ext|
upext = ext.upcase
audios.concat(files.find_all { |f| f[f.length - 3, 3] == ext })
audios.concat(files.find_all { |f| f[f.length - 3, 3] == upext })

View File

@@ -213,11 +213,12 @@ class MusicFileLister
folder = (@bgm) ? "Audio/BGM/" : "Audio/ME/"
@commands.clear
Dir.chdir(folder) do
# Dir.glob("*.mp3") { |f| @commands.push(f) }
Dir.glob("*.ogg") { |f| @commands.push(f) }
Dir.glob("*.wav") { |f| @commands.push(f) }
Dir.glob("*.mid") { |f| @commands.push(f) }
Dir.glob("*.ogg") { |f| @commands.push(f) }
Dir.glob("*.mp3") { |f| @commands.push(f) }
Dir.glob("*.midi") { |f| @commands.push(f) }
Dir.glob("*.mid") { |f| @commands.push(f) }
Dir.glob("*.wma") { |f| @commands.push(f) }
end
@commands.uniq!
@commands.sort! { |a, b| a.downcase <=> b.downcase }