From 25f85a9a8b0a31457d550841192fdb8a1ec54df4 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 14 Oct 2023 16:28:37 +0100 Subject: [PATCH] Added mp3 support back in, changed layout of townmapgen.html, screenshots now go in Screenshots folder, added "NoName" flag for trainer types --- .../001_Technical/002_Files/001_FileTests.rb | 8 +- .../015_Trainers and player/001_Trainer.rb | 3 +- Data/Scripts/019_Utilities/001_Utilities.rb | 11 ++- .../005_AnimEditor_Functions.rb | 2 +- .../003_Debug_MenuExtraCode.rb | 2 +- Data/Scripts/020_Debug/003_Editor_Listers.rb | 7 +- townmapgen.html | 97 +++++++++++++------ 7 files changed, 90 insertions(+), 40 deletions(-) diff --git a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb index 68977e097..d753bdae8 100644 --- a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb +++ b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb @@ -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) diff --git a/Data/Scripts/015_Trainers and player/001_Trainer.rb b/Data/Scripts/015_Trainers and player/001_Trainer.rb index 8a33185b8..a78515d0c 100644 --- a/Data/Scripts/015_Trainers and player/001_Trainer.rb +++ b/Data/Scripts/015_Trainers and player/001_Trainer.rb @@ -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 #============================================================================= diff --git a/Data/Scripts/019_Utilities/001_Utilities.rb b/Data/Scripts/019_Utilities/001_Utilities.rb index 8d94094f3..39df7ce43 100644 --- a/Data/Scripts/019_Utilities/001_Utilities.rb +++ b/Data/Scripts/019_Utilities/001_Utilities.rb @@ -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 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 42d794da0..560bd0b97 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 @@ -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! diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index 12d2feb2c..6fd27602f 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -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 }) diff --git a/Data/Scripts/020_Debug/003_Editor_Listers.rb b/Data/Scripts/020_Debug/003_Editor_Listers.rb index 802d0c620..b34487c49 100644 --- a/Data/Scripts/020_Debug/003_Editor_Listers.rb +++ b/Data/Scripts/020_Debug/003_Editor_Listers.rb @@ -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 } diff --git a/townmapgen.html b/townmapgen.html index 804d2282b..6bffe3fc6 100644 --- a/townmapgen.html +++ b/townmapgen.html @@ -1,49 +1,80 @@ -
- +
+ Town Map Generator
-
- Map Filename (in Graphics/Pictures/):   -
- Square width:   - Square height:   -
- Region Name:   - -
-
-
-
- - + + + + - + + - - + + + - - + + + + +
Current Position:Filename:Name of the region graphic (in Graphics/UI/Town Map/)
Name: + Name of the region
Point of Interest: + Square width:Width of each point in the Town Map (in pixels)
Fly Destination: + Square height:Height of each point in the Town Map (in pixels)
+
+
+
+ Edit point properties
+ Click on a point in the Town Map to edit its properties. +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + - +
Co-ordinates:X and Y co-ordinates of this point in the Town Map (click in the map above)
Name:Name of this location
Landmark:Name of a landmark found in this location
Fly destination:Map ID, X and Y tile co-ordinates the player will appear at when Flying to this location
Switch: + Number of a Game Switch that needs to be ON to see this point's name/landmark and to Fly to this location

- Single section from townmap.txt (without section heading):
+
+ PBS file "town_map.txt" text for this region

- (To load data into the editor)
- Copy the data above into townmap.txt when you're done. +   + Apply the data in this box to the map above
+ When you're done, copy this text into "town_map.txt". Remember that it needs a section line (a number in square brackets).