From 76639c4ba56d95e5a0f85ebac0b3baab01cd8c0e Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 20 Jun 2022 08:44:18 +0100 Subject: [PATCH] Fixed duplicate files listed in BGM/ME pickers in PBS file editors --- .../002_Animation editor/005_AnimEditor_Functions.rb | 3 ++- Data/Scripts/020_Debug/003_Editor_Listers.rb | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb index 8a99522f9..2f0914bbc 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -514,7 +514,8 @@ def pbSelectSE(canvas, audio) animfiles.concat(Dir.glob("*.ogg")) animfiles.concat(Dir.glob("*.wma")) } - animfiles.sort! { |a, b| a.upcase <=> b.upcase } + animfiles.uniq! + animfiles.sort! { |a, b| a.downcase <=> b.downcase } animfiles = [_INTL("[Play user's cry]")] + animfiles cmdwin = pbListWindow(animfiles, 320) cmdwin.height = 480 diff --git a/Data/Scripts/020_Debug/003_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb index a097262f4..e00f0fb40 100644 --- a/Data/Scripts/020_Debug/003_Editor_Listers.rb +++ b/Data/Scripts/020_Debug/003_Editor_Listers.rb @@ -224,17 +224,13 @@ class MusicFileLister @commands.clear Dir.chdir(folder) { # Dir.glob("*.mp3") { |f| @commands.push(f) } -# Dir.glob("*.MP3") { |f| @commands.push(f) } Dir.glob("*.ogg") { |f| @commands.push(f) } - Dir.glob("*.OGG") { |f| @commands.push(f) } Dir.glob("*.wav") { |f| @commands.push(f) } - Dir.glob("*.WAV") { |f| @commands.push(f) } Dir.glob("*.mid") { |f| @commands.push(f) } - Dir.glob("*.MID") { |f| @commands.push(f) } Dir.glob("*.midi") { |f| @commands.push(f) } - Dir.glob("*.MIDI") { |f| @commands.push(f) } } - @commands.sort! + @commands.uniq! + @commands.sort! { |a, b| a.downcase <=> b.downcase } @commands.length.times do |i| @index = i if @commands[i] == @setting end