Changed: TilemapXP --- Left +++ Right @@ -330,4 +330,5 @@ next if !@autotileInfo[i] frame=autotileFrame(i) + @autotileInfo[i].clear bltAutotile(@autotileInfo[i],0,0,i,frame) end Changed: PokemonOption --- Left +++ Right @@ -208,4 +208,117 @@ # Stores game options # + + +$SpeechFrames=[ +MessageConfig::TextSkinName, # Default text skin +"rstextskin", +"frlgtextskin", +"emtextskin", +"textbox0", +"textbox1", +"textbox2", +"textbox3", +"textbox4", +"textbox5", +"textbox6", +"textbox7", +"textbox8", +"textbox9", +"textbox10", +"textbox11", +"textbox12", +"textbox13", +"textbox14", +"textbox15", +"textbox16", +"textbox17", +"textbox18", +"textbox19" +] + +$TextFrames=[ +"Graphics/Windowskins/"+MessageConfig::ChoiceSkinName, +"Graphics/Windowskins/skin2", +"Graphics/Windowskins/skin3", +"Graphics/Windowskins/skin4", +"Graphics/Windowskins/skin5", +"Graphics/Windowskins/skin6", +"Graphics/Windowskins/skin7", +"Graphics/Windowskins/skin8", +"Graphics/Windowskins/skin9", +"Graphics/Windowskins/skin10", +"Graphics/Windowskins/skin11", +"Graphics/Windowskins/skin12", +"Graphics/Windowskins/skin13", +"Graphics/Windowskins/skin14", +"Graphics/Windowskins/skin15", +"Graphics/Windowskins/skin16", +"Graphics/Windowskins/skin17", +"Graphics/Windowskins/skin18", +"Graphics/Windowskins/skin19", +"Graphics/Windowskins/skin20", +"Graphics/Windowskins/skin21", +"Graphics/Windowskins/skin22", +"Graphics/Windowskins/skin23", +"Graphics/Windowskins/skin24", +"Graphics/Windowskins/skin25", +"Graphics/Windowskins/skin26", +"Graphics/Windowskins/skin27", +"Graphics/Windowskins/skin28" +] + +$VersionStyles=[ + [MessageConfig::FontName], # Default font style + ["Power Red and Blue"], + ["Power Red and Green"], + ["Power Clear"], + ["Power Red and Blue Intl"] +] + +def pbSettingToTextSpeed(speed) + return 3 if speed==0 + return 2 if speed==1 + return 1 if speed==2 + return -2 if speed==3 + return MessageConfig::TextSpeed if MessageConfig::TextSpeed + return ((Graphics.frame_rate>40) ? -2 : 1) +end +def pbTextSpeedToSetting(speed) + return 0 if speed==3 + return 1 if speed==2 + return 2 if speed==1 + return 0 +end + +module MessageConfig + def self.pbDefaultSystemFrame + if !$PokemonSystem + return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::ChoiceSkinName)||"" + else + return pbResolveBitmap($TextFrames[$PokemonSystem.frame])||"" + end + end + def self.pbDefaultSpeechFrame + if !$PokemonSystem + return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::TextSkinName)||"" + else + return pbResolveBitmap("Graphics/Windowskins/"+$SpeechFrames[$PokemonSystem.frame])||"" + end + end + def self.pbDefaultSystemFontName + if !$PokemonSystem + return MessageConfig.pbTryFonts(MessageConfig::FontName,"Arial Narrow","Arial") + else + return MessageConfig.pbTryFonts($VersionStyles[$PokemonSystem.font][0],"Arial Narrow","Arial") + end + end + def self.pbDefaultTextSpeed + return pbSettingToTextSpeed($PokemonSystem ? $PokemonSystem.textspeed : nil) + end + def pbGetSystemTextSpeed + return $PokemonSystem ? $PokemonSystem.textspeed : ((Graphics.frame_rate>40) ? 2 : 3) + end +end + class PokemonSystem attr_accessor :textspeed @@ -225,5 +338,5 @@ end def initialize - # Default window frame (see also $TextFrames in script SpriteWindow) + # Default window frame (see also $TextFrames) @frame=0 # Battle style (0=shift, 1=set) @@ -235,5 +348,5 @@ # Screen size (0=240x160, 1=480x320, 2=320x240, 3=640x480) @screensize=1 - # Font (see also $VersionStyles in script SpriteWindow) + # Font (see also $VersionStyles) @font=0 @tilemap=1 @@ -264,5 +377,8 @@ EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")], proc { $PokemonSystem.textspeed }, # Getter - proc {|value| $PokemonSystem.textspeed=value } # Setter + proc {|value| + $PokemonSystem.textspeed=value + MessageConfig.pbSetTextSpeed(pbSettingToTextSpeed(value)) + } # Setter ), EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")], @@ -276,9 +392,15 @@ EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")], proc { $PokemonSystem.font }, - proc {|value| $PokemonSystem.font=value } + proc {|value| + $PokemonSystem.font=value + MessageConfig.pbSetSystemFontName($VersionStyles[value]) + } ), NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length, proc { $PokemonSystem.frame }, - proc {|value| $PokemonSystem.frame=value } + proc {|value| + $PokemonSystem.frame=value + MessageConfig.pbSetSystemFrame($TextFrames[value]) + } ), EnumOption2.new(_INTL("SCREEN SIZE"),[_INTL("240x160"),_INTL("480x320"),_INTL("320x240"),_INTL("640x480")], @@ -307,5 +429,7 @@ NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length, proc { $PokemonSystem.textskin }, - proc {|value| $PokemonSystem.textskin=value } + proc {|value| $PokemonSystem.textskin=value; + MessageConfig.pbSetSpeechFrame( + "Graphics/Windowskins/"+$SpeechFrames[value]) } ) ] Changed: PBAnimation --- Left +++ Right @@ -442,5 +442,5 @@ if i.frame==frame if i.name!="" && i.name - pbSEPlay(RPG::AudioFile.new(i.name,i.volume,i.pitch)) + pbSEPlay(i.name,i.volume,i.pitch) end if sprite Changed: Pokegear_Radio --- Left +++ Right @@ -110,15 +110,15 @@ when 0 pbPlayDecisionSE() - pbBGMPlay(RPG::AudioFile.new("Radio - March", 100, 100)) + pbBGMPlay("Radio - March", 100, 100) $PokemonMap.whiteFluteUsed=true if $PokemonMap $PokemonMap.blackFluteUsed=false if $PokemonMap when 1 pbPlayDecisionSE() - pbBGMPlay(RPG::AudioFile.new("Radio - Lullaby", 100, 100)) + pbBGMPlay("Radio - Lullaby", 100, 100) $PokemonMap.blackFluteUsed=true if $PokemonMap $PokemonMap.whiteFluteUsed=false if $PokemonMap when 2 pbPlayDecisionSE() - pbBGMPlay(RPG::AudioFile.new("Radio - Oak", 100, 100)) + pbBGMPlay("Radio - Oak", 100, 100) $PokemonMap.whiteFluteUsed=false if $PokemonMap $PokemonMap.blackFluteUsed=false if $PokemonMap Changed: PokemonMessages --- Left +++ Right @@ -142,21 +142,4 @@ ######### - -module PokemonSkins - @defaultTextSkin=nil - def self.getDefaultTextSkin - textSkin=MessageConfig::TextSkinName - if textSkin==nil - if !@defaultTextSkin - skin=load_data("Data/System.rxdata").windowskin_name rescue nil - skin="../System/Window" if !skin - @defaultTextSkin=skin - end - return @defaultTextSkin - end - end -end - - def pbCsvField!(str) ret="" @@ -724,5 +707,5 @@ @messageSkin=value end - def messageSkin + def messageSkin # Set the full path for the message's window skin @messageSkin end @@ -1042,6 +1025,6 @@ msgwindow.letterbyletter=false pbBottomLeftLines(msgwindow,2) - skinfile=PokemonSkins.getDefaultTextSkin - msgwindow.setSkin("Graphics/Windowskins/#{skinfile}") + skinfile=MessageConfig.pbGetSpeechFrame() + msgwindow.setSkin(skinfile) return msgwindow end @@ -1060,6 +1043,6 @@ $game_temp.message_window_showing=true if $game_temp $game_message.visible=true if $game_message - skin=PokemonSkins.getDefaultTextSkin if !skin - msgwindow.setSkin("Graphics/Windowskins/#{skin}") + skin=MessageConfig.pbGetSpeechFrame() if !skin + msgwindow.setSkin(skin) return msgwindow end @@ -1071,53 +1054,4 @@ end -def isDarkBackground(background,rect=nil) - if !background || background.disposed? - return true - end - rect=background.rect if !rect - if rect.width<=0 || rect.height<=0 - return true - end - xSeg=(rect.width/16) - xLoop=(xSeg==0) ? 1 : 16 - xStart=(xSeg==0) ? rect.x+(rect.width/2) : rect.x+xSeg/2 - ySeg=(rect.height/16) - yLoop=(ySeg==0) ? 1 : 16 - yStart=(ySeg==0) ? rect.y+(rect.height/2) : rect.y+ySeg/2 - count=0 - y=yStart - r=0; g=0; b=0 - yLoop.times { - x=xStart - xLoop.times { - clr=background.get_pixel(x,y) - if clr.alpha!=0 - r+=clr.red; g+=clr.green; b+=clr.blue - count+=1 - end - x+=xSeg - } - y+=ySeg - } - return true if count==0 - r/=count - g/=count - b/=count - return (r*0.299+g*0.587+b*0.114)<128 -end - -def isDarkWindowskin(windowskin) - if !windowskin || windowskin.disposed? - return true - end - if windowskin.width==192 && windowskin.height==128 - return isDarkBackground(windowskin,Rect.new(0,0,128,128)) - elsif windowskin.width==128 && windowskin.height==128 - return isDarkBackground(windowskin,Rect.new(0,0,64,64)) - else - clr=windowskin.get_pixel(windowskin.width/2, windowskin.height/2) - return (clr.red*0.299+clr.green*0.587+clr.blue*0.114)<128 - end -end class FaceWindowVX < SpriteWindow_Base Changed: PokemonEntry --- Left +++ Right @@ -1173,4 +1173,5 @@ @sprites["entry2"].viewport=@viewport @sprites["entry2"].visible=true + @sprites["entry2"].x=(Graphics.width/2)-(@sprites["entry2"].width/2) end if minlength==0 Changed: SpriteWindow --- Left +++ Right @@ -4,11 +4,108 @@ module MessageConfig FontName="Power Green" - # in Graphics/Windowskins/ (specify nil to use - # the default windowskin) - TextSkinName=nil - #TextSkinName="001-Blue01" - # full path to file + # in Graphics/Windowskins/ (specify empty string to use the default windowskin) + TextSkinName="frlgtextskin" ChoiceSkinName="skin1" WindowOpacity=255 + TextSpeed=nil # can be positive to wait frames or negative to show multiple + # characters in a single frame + FontSubstitutes={ + "Power Clear"=>"Pokemon DP", + "Power Red and Blue"=>"Pokemon RS", + "Power Red and Green"=>"Pokemon FireLeaf", + "Power Green"=>"Pokemon Emerald", + "Power Green Narrow"=>"Pokemon Emerald Narrow", + "Power Green Small"=>"Pokemon Emerald Small" + } + @@systemFrame=nil + @@defaultTextSkin=nil + @@systemFont=nil + @@textSpeed=nil + def self.pbTryFonts(*args) + for a in args + if a && a.is_a?(String) + return a if Font.exist?(a) + a=MessageConfig::FontSubstitutes[a] || a + return a if Font.exist?(a) + elsif a && a.is_a?(Array) + for aa in a + ret=MessageConfig.pbTryFonts(aa) + return ret if ret!="" + end + end + end + return "" + end + def self.pbDefaultTextSpeed + return TextSpeed ? TextSpeed : (Graphics.width >= 400) ? -2 : 1 + end + def self.pbDefaultSystemFrame + return "" if !MessageConfig::ChoiceSkinName + return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::ChoiceSkinName)||"" + end + def self.pbDefaultSpeechFrame + return "" if !MessageConfig::TextSkinName + return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::TextSkinName)||"" + end + def self.pbDefaultSystemFontName + return MessageConfig.pbTryFonts(MessageConfig::FontName,"Arial Narrow","Arial") + end + def self.pbDefaultWindowskin + skin=load_data("Data/System.rxdata").windowskin_name rescue nil + if skin && skin!="" + skin=pbResolveBitmap("Graphics/Windowskins/"+skin) || "" + end + if !skin || skin=="" + skin=pbResolveBitmap("Graphics/System/Window") + end + if !skin || skin=="" + skin=pbResolveBitmap("Graphics/Windowskins/001-Blue01") + end + return skin || "" + end + def self.pbGetSpeechFrame + if !@@defaultTextSkin + skin=MessageConfig.pbDefaultSpeechFrame() + if !skin || skin=="" + skin=MessageConfig.pbDefaultWindowskin() + end + @@defaultTextSkin=skin || "" + end + return @@defaultTextSkin + end + def self.pbGetTextSpeed + if !@@textSpeed + @@textSpeed=pbDefaultTextSpeed() + end + return @@textSpeed + end + def self.pbGetSystemFontName + if !@@systemFont + @@systemFont=pbDefaultSystemFontName() + end + return @@systemFont + end + def self.pbGetSystemFrame + if !@@systemFrame + skin=MessageConfig.pbDefaultSystemFrame() + if !skin || skin=="" + skin=MessageConfig.pbDefaultWindowskin() + end + @@systemFrame=skin || "" + end + return @@systemFrame + end + def self.pbSetSystemFrame(value) + @@systemFrame=pbResolveBitmap(value)||"" + end + def self.pbSetSpeechFrame(value) + @@defaultTextSkin=pbResolveBitmap(value)||"" + end + def self.pbSetSystemFontName(value) + @@systemFont=MessageConfig.pbTryFonts(value,"Arial Narrow","Arial") + end + def self.pbSetTextSpeed(value) + @@textSpeed=value + end end @@ -23,69 +120,4 @@ -$VersionStyles=[ - [MessageConfig::FontName], - ["Power Red and Blue"], - ["Power Red and Green"], - ["Power Clear"], - ["Power Red and Blue Intl"] -] - -$TextFrames=[ -"Graphics/Windowskins/"+MessageConfig::ChoiceSkinName, -"Graphics/Windowskins/skin2", -"Graphics/Windowskins/skin3", -"Graphics/Windowskins/skin4", -"Graphics/Windowskins/skin5", -"Graphics/Windowskins/skin6", -"Graphics/Windowskins/skin7", -"Graphics/Windowskins/skin8", -"Graphics/Windowskins/skin9", -"Graphics/Windowskins/skin10", -"Graphics/Windowskins/skin11", -"Graphics/Windowskins/skin12", -"Graphics/Windowskins/skin13", -"Graphics/Windowskins/skin14", -"Graphics/Windowskins/skin15", -"Graphics/Windowskins/skin16", -"Graphics/Windowskins/skin17", -"Graphics/Windowskins/skin18", -"Graphics/Windowskins/skin19", -"Graphics/Windowskins/skin20", -"Graphics/Windowskins/skin21", -"Graphics/Windowskins/skin22", -"Graphics/Windowskins/skin23", -"Graphics/Windowskins/skin24", -"Graphics/Windowskins/skin25", -"Graphics/Windowskins/skin26", -"Graphics/Windowskins/skin27", -"Graphics/Windowskins/skin28" -] -$SpeechFrames=[ -nil, # Default text skin, leave as nil -"rstextskin", -"frlgtextskin", -"emtextskin", -"textbox0", -"textbox1", -"textbox2", -"textbox3", -"textbox4", -"textbox5", -"textbox6", -"textbox7", -"textbox8", -"textbox9", -"textbox10", -"textbox11", -"textbox12", -"textbox13", -"textbox14", -"textbox15", -"textbox16", -"textbox17", -"textbox18", -"textbox19" -] - ############################# ############################# @@ -266,8 +298,8 @@ def self.exists?(filename,extensions=[]) return false if !filename || filename=="" - eachPath {|path| - return true if FileTest.exist?(path+filename) + eachPathFor(filename) {|path| + return true if FileTest.exist?(path) for ext in extensions - return true if FileTest.exist?(path+filename+ext) + return true if FileTest.exist?(path+ext) end } @@ -275,15 +307,15 @@ end def self.getImagePath(filename) - return self.getPath(filename,["",".png",".jpg",".gif",".bmp"]) + return self.getPath(filename,["",".png",".jpg",".gif",".bmp",".jpeg"]) end def self.getAudioPath(filename) - return self.getPath(filename,["",".mp3",".wav",".wma",".mid",".ogg"]) + return self.getPath(filename,["",".mp3",".wav",".wma",".mid",".ogg",".midi"]) end def self.getPath(filename,extensions=[]) return filename if !filename || filename=="" - eachPath {|path| - return path+filename if FileTest.exist?(path+filename) + eachPathFor(filename) {|path| + return path if FileTest.exist?(path) for ext in extensions - file=path+filename+ext + file=path+ext return file if FileTest.exist?(file) end @@ -291,4 +323,17 @@ return filename end + # Gets the absolute RGSS paths for the given + # file name + def self.eachPathFor(filename) + return if !filename + if filename[/^[A-Za-z]\:[\/\\]/] || filename[/^[\/\\]/] + # filename is already absolute + yield filename + else + # relative path + RTP.eachPath {|path| yield path+filename } + end + end + # Gets all RGSS search paths def self.eachPath yield Dir.pwd.gsub(/\//,"\\").gsub(/[\/\\]$/,"")+"\\" @@ -652,23 +697,4 @@ end -############################# -############################# - - -def pbGetSystemFrame - return $PokemonSystem ? $PokemonSystem.frame : 0 -end -def pbGetSystemFont - return $PokemonSystem ? $PokemonSystem.font : 0 -end - -def pbGetSystemTextSpeed - return $PokemonSystem ? $PokemonSystem.textspeed : ((Graphics.frame_rate>40) ? 2 : 3) -end -def pbSetSystemTextSpeed(speed) - $PokemonSystem.textspeed=speed if $PokemonSystem -end - - ######################## ######################## @@ -707,4 +733,5 @@ end end + return str end @@ -909,4 +936,55 @@ end + +def isDarkBackground(background,rect=nil) + if !background || background.disposed? + return true + end + rect=background.rect if !rect + if rect.width<=0 || rect.height<=0 + return true + end + xSeg=(rect.width/16) + xLoop=(xSeg==0) ? 1 : 16 + xStart=(xSeg==0) ? rect.x+(rect.width/2) : rect.x+xSeg/2 + ySeg=(rect.height/16) + yLoop=(ySeg==0) ? 1 : 16 + yStart=(ySeg==0) ? rect.y+(rect.height/2) : rect.y+ySeg/2 + count=0 + y=yStart + r=0; g=0; b=0 + yLoop.times { + x=xStart + xLoop.times { + clr=background.get_pixel(x,y) + if clr.alpha!=0 + r+=clr.red; g+=clr.green; b+=clr.blue + count+=1 + end + x+=xSeg + } + y+=ySeg + } + return true if count==0 + r/=count + g/=count + b/=count + return (r*0.299+g*0.587+b*0.114)<128 +end + +def isDarkWindowskin(windowskin) + if !windowskin || windowskin.disposed? + return true + end + if windowskin.width==192 && windowskin.height==128 + return isDarkBackground(windowskin,Rect.new(0,0,128,128)) + elsif windowskin.width==128 && windowskin.height==128 + return isDarkBackground(windowskin,Rect.new(0,0,64,64)) + else + clr=windowskin.get_pixel(windowskin.width/2, windowskin.height/2) + return (clr.red*0.299+clr.green*0.587+clr.blue*0.114)<128 + end +end + def getDefaultTextColors(windowskin) if !windowskin || windowskin.disposed? || @@ -1185,13 +1263,15 @@ noext=x.gsub(/\.(bmp|png|gif|jpg|jpeg)$/,"") filename=nil - RTP.eachPath{|path| - filename=pbTryString(path+x) if !filename - filename=pbTryString(path+"#{noext}.png") if !filename - filename=pbTryString(path+"#{x}.gif") if !filename - filename=pbTryString(path+"#{noext}.gif") if !filename - filename=pbTryString(path+"#{noext}.jpg") if !filename - filename=pbTryString(path+"#{noext}.jpeg") if !filename - filename=pbTryString(path+"#{noext}.bmp") if !filename + RTP.eachPathFor(x) {|path| + filename=pbTryString(path) if !filename + filename=pbTryString(path+".gif") if !filename } + RTP.eachPathFor(noext) {|path| + filename=pbTryString(path+".gif") if !filename + filename=pbTryString(path+".jpg") if !filename + filename=pbTryString(path+".jpeg") if !filename + filename=pbTryString(path+".bmp") if !filename + filename=pbTryString(path+".png") if !filename + } return filename end @@ -1230,27 +1310,13 @@ end -FontSubstitutes={ -"Power Clear"=>"Pokemon DP", -"Power Red and Blue"=>"Pokemon RS", -"Power Red and Green"=>"Pokemon FireLeaf", -"Power Green"=>"Pokemon Emerald", -"Power Green Narrow"=>"Pokemon Emerald Narrow", -"Power Green Small"=>"Pokemon Emerald Small" -} - -def pbSystemFontName() - fontname=$VersionStyles[pbGetSystemFont][0] - if !Font.exist?(fontname) - fontname=FontSubstitutes[fontname] || fontname - return [fontname,"Arial Narrow","Arial"].find{|n| Font.exist?(n) } || "Arial" - else - return fontname - end -end - def pbSetSystemFont(bitmap) - bitmap.font.name=pbSystemFontName() - if pbGetSystemFont==2 + fontname=MessageConfig.pbGetSystemFontName() + bitmap.font.name=fontname + if fontname=="Pokemon FireLeaf" || + fontname=="Power Red and Green" bitmap.font.size=29 + elsif fontname=="Pokemon Emerald Small" || + fontname=="Power Green Small" + bitmap.font.size=25 else bitmap.font.size=31 @@ -1258,10 +1324,10 @@ end def pbSmallFontName() - return ["Power Green Small","Pokemon Emerald Small", - "Arial Narrow","Arial"].find{|n| Font.exist?(n) } || "Arial" + return MessageConfig.pbTryFonts("Power Green Small","Pokemon Emerald Small", + "Arial Narrow","Arial") end def pbNarrowFontName() - return ["Power Green Narrow","Pokemon Emerald Narrow", - "Arial Narrow","Arial"].find{|n| Font.exist?(n) } || "Arial" + return MessageConfig.pbTryFonts("Power Green Narrow","Pokemon Emerald Narrow", + "Arial Narrow","Arial") end def pbSetSmallFont(bitmap) @@ -2475,7 +2541,7 @@ self.height = height self.z = 100 - @curframe=pbGetSystemFrame - @curfont=pbGetSystemFont - @sysframe=AnimatedBitmap.new($TextFrames[pbGetSystemFrame] || "") + @curframe=MessageConfig.pbGetSystemFrame() + @curfont=MessageConfig.pbGetSystemFontName() + @sysframe=AnimatedBitmap.new(@curframe) @customskin=nil __setWindowskin(@sysframe.bitmap) @@ -2495,5 +2561,5 @@ if self.skinformat==1 if !@resolvedFrame - @resolvedFrame=pbResolveBitmap($TextFrames[pbGetSystemFrame])||"" + @resolvedFrame=MessageConfig.pbGetSystemFrame() @resolvedFrame.sub!(/\.[^\.\/\\]+$/,"") end @@ -2522,5 +2588,5 @@ super if self.windowskin - if @customskin + if @customskin if @customskin.totalFrames>1 @customskin.update @@ -2534,9 +2600,9 @@ end end - if @curframe!=pbGetSystemFrame - @curframe=pbGetSystemFrame + if @curframe!=MessageConfig.pbGetSystemFrame() + @curframe=MessageConfig.pbGetSystemFrame() if @sysframe && !@customskin @sysframe.dispose if @sysframe - @sysframe=AnimatedBitmap.new($TextFrames[pbGetSystemFrame]) + @sysframe=AnimatedBitmap.new(@curframe) @resolvedFrame=nil __setWindowskin(@sysframe.bitmap) @@ -2548,6 +2614,6 @@ end end - if @curfont!=pbGetSystemFont - @curfont=pbGetSystemFont + if @curfont!=MessageConfig.pbGetSystemFontName() + @curfont=MessageConfig.pbGetSystemFontName() if self.contents && !self.contents.disposed? pbSetSystemFont(self.contents) @@ -3362,5 +3428,5 @@ @fmtchars=[] @frameskipChanged=false - @frameskip=[3,2,1,-2][pbGetSystemTextSpeed] + @frameskip=MessageConfig.pbGetTextSpeed() super(0,0,33,33) @pausesprite=nil Changed: Game_Map_ --- Left +++ Right @@ -93,7 +93,6 @@ FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n") # Checks whether a BGM file with the filename [normal BGM]n exists - pbCueBGM( - RPG::AudioFile.new(@map.bgm.name+"n", - @map.bgm.volume,@map.bgm.pitch),1.0) # Plays it + pbCueBGM(@map.bgm.name+"n",1.0, + @map.bgm.volume,@map.bgm.pitch) # Plays it else pbCueBGM(@map.bgm,1.0) # Plays the normal BGM @@ -109,6 +108,6 @@ FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n") # Checks whether a BGM file with the filename [normal BGM]n exists - pbBGMPlay(RPG::AudioFile.new(@map.bgm.name+"n", - @map.bgm.volume,@map.bgm.pitch)) # Plays it + pbBGMPlay(@map.bgm.name+"n", + @map.bgm.volume,@map.bgm.pitch) # Plays it else pbBGMPlay(@map.bgm) # Plays the normal BGM Changed: PokemonSystem --- Left +++ Right @@ -19,6 +19,6 @@ # a menu displays the available languages and a "Language" option appears on # the main menu. - # Uncomment to add entries to the array # Name of language in native language, message file in Data folder + # Remove the "#" symbol before the lines below to add entries to the array # ["English","english.dat"], # ["Deutsch","deutsch.dat"] Changed: PokemonUtilities --- Left +++ Right @@ -1239,5 +1239,5 @@ music=pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1246,5 +1246,5 @@ music=pbGetMetadata(0,MetadataWildBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1288,5 +1288,5 @@ ret=nil if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end if !ret && $game_map @@ -1294,5 +1294,5 @@ music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1301,5 +1301,5 @@ music=pbGetMetadata(0,MetadataTrainerBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1321,5 +1321,5 @@ ret=nil if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end if !ret && $game_map @@ -1327,5 +1327,5 @@ music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1334,5 +1334,5 @@ music=pbGetMetadata(0,MetadataTrainerBattleBGM) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1363,5 +1363,5 @@ ret=nil if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end if !ret && $game_map @@ -1369,5 +1369,5 @@ music=pbGetMetadata($game_map.map_id,MetadataMapTrainerVictoryME) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1376,5 +1376,5 @@ music=pbGetMetadata(0,MetadataTrainerVictoryME) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1393,5 +1393,5 @@ music=pbGetMetadata($game_map.map_id,MetadataMapWildVictoryME) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end @@ -1400,5 +1400,5 @@ music=pbGetMetadata(0,MetadataWildVictoryME) if music && music!="" - ret=pbStringToAudioFile("#{music}") + ret=pbStringToAudioFile(music) end end Changed: PokeBattle_Battle --- Left +++ Right @@ -756,6 +756,8 @@ end end + oldmoney=self.pbPlayer.money self.pbPlayer.money+=maxlevel - if maxlevel>0 + moneygained=self.pbPlayer.money-oldmoney + if moneygained>0 pbDisplayPaused(_INTL("{1} got ${2}\r\nfor winning!",self.pbPlayer.name,maxlevel)) end Changed: PokemonStorage --- Left +++ Right @@ -2130,5 +2130,4 @@ msgwindow.visible=true msgwindow.letterbyletter=false - msgwindow.windowskin=BitmapWrapper.new($TextFrames[$PokemonSystem.frame]) msgwindow.resizeHeightToFit(message,Graphics.width-160) msgwindow.text=message Changed: PokemonAnimEditor --- Left +++ Right @@ -2298,5 +2298,5 @@ def pbRgssChdir(dir) - RTP.eachPath{|path| Dir.chdir(path+dir) { yield } } + RTP.eachPathFor(dir){|path| Dir.chdir(path) { yield } } end Changed: AudioUtilities --- Left +++ Right @@ -1,3 +1,4 @@ + =begin This script contains various utility functions and classes for dealing @@ -1263,4 +1264,4 @@ end - +#Audio.sine(140,SoundEnvelope.initial(6400).change(140,11400),50) Changed: PokemonEditor --- Left +++ Right @@ -603,4 +603,34 @@ end + +def createMinimap2(mapid) + map=load_data(sprintf("Data/Map%03d.rxdata",mapid)) rescue nil + return BitmapWrapper.new(32,32) if !map + bitmap=BitmapWrapper.new(map.width*4,map.height*4) + black=Color.new(0,0,0) + bigmap=(map.width>40 && map.height>40) + tilesets=load_data("Data/Tilesets.rxdata") + tileset=tilesets[map.tileset_id] + return bitmap if !tileset + helper=TileDrawingHelper.fromTileset(tileset) + for y in 0...map.height + for x in 0...map.width + if bigmap + next if (x>8 && x<=map.width-8 && y>8 && y<=map.height-8) + end + for z in 0..2 + id=map.data[x,y,z] + next if id==0 || !id + helper.bltSmallTile(bitmap,x*4,y*4,4,4,id) + end + end + end + bitmap.fill_rect(0,0,bitmap.width,1,black) + bitmap.fill_rect(0,bitmap.height-1,bitmap.width,1,black) + bitmap.fill_rect(0,0,1,bitmap.height,black) + bitmap.fill_rect(bitmap.width-1,0,1,bitmap.height,black) + return bitmap +end + def createMinimap(mapid) map=load_data(sprintf("Data/Map%03d.rxdata",mapid)) rescue nil @@ -614,7 +644,5 @@ for y in 0...map.height for x in 0...map.width - terrain=0 - passable=true - for z in [0,1,2] + for z in 0..2 id=map.data[x,y,z] id=0 if !id Changed: PokemonField --- Left +++ Right @@ -486,17 +486,4 @@ end -module PokemonSkins - # Overrides "getDefaultTextSkin" in the script PokemonMessages - def self.getDefaultTextSkin - skin=$PokemonSystem ? $PokemonSystem.textskin : nil - if !skin || !$SpeechFrames[skin] - skinfile=pbGetMetadata(0,MetadataTextSkin) - return skinfile ? skinfile : "frlgtextskin" - else - return $SpeechFrames[skin] - end - end -end - def pbIsPassableWaterTag?(tag) return tag==PBTerrain::DeepWater|| @@ -533,5 +520,5 @@ pbBGMPlay(bgm) else - pbBGMPlay(RPG::AudioFile.new("002-Battle02",100,100)) + pbBGMPlay(pbGetWildBattleBGM(0)) end viewport=Viewport.new(0,0,Graphics.width,Graphics.height) @@ -1248,9 +1235,7 @@ } -def pbCueBGM(bgm,seconds) +def pbCueBGM(bgm,seconds,volume=nil,pitch=nil) return if !bgm - if bgm.is_a?(String) - bgm=RPG::AudioFile.new(bgm,100,100) - end + bgm=pbResolveAudioFile(bgm,volume,pitch) playingBGM=$game_system.playing_bgm if !playingBGM || playingBGM.name!=bgm.name || playingBGM.pitch!=bgm.pitch @@ -1592,13 +1577,13 @@ case $ItemData[item][ITEMPOCKET] when 1 - Kernel.pbMessage(_INTL("{1} put the {2} in the Items Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Items Pocket.",$Trainer.name,itemname)) when 2 - Kernel.pbMessage(_INTL("{1} put the {2} in the Poke Balls Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Poke Balls Pocket.",$Trainer.name,itemname)) when 3 - Kernel.pbMessage(_INTL("{1} put the {2} in the TMs/HMs Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the TMs/HMs Pocket.",$Trainer.name,itemname)) when 4 - Kernel.pbMessage(_INTL("{1} put the {2} in the Berries Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Berries Pocket.",$Trainer.name,itemname)) when 5 - Kernel.pbMessage(_INTL("{1} put the {2} in the Key Items Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Key Items Pocket.",$Trainer.name,itemname)) end return true @@ -1616,13 +1601,13 @@ case $ItemData[item][ITEMPOCKET] when 1 - Kernel.pbMessage(_INTL("{1} put the {2}\nin the Items Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Items Pocket.",$Trainer.name,itemname)) when 2 - Kernel.pbMessage(_INTL("{1} put the {2}\nin the Poke Balls Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Poke Balls Pocket.",$Trainer.name,itemname)) when 3 - Kernel.pbMessage(_INTL("{1} put the {2}\nin the TMs/HMs Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the TMs/HMs Pocket.",$Trainer.name,itemname)) when 4 - Kernel.pbMessage(_INTL("{1} put the {2}\nin the Berries Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Berries Pocket.",$Trainer.name,itemname)) when 5 - Kernel.pbMessage(_INTL("{1} put the {2}\nin the Key Items Pocket.",$Trainer.name,itemname)) + Kernel.pbMessage(_INTL("{1} put the {2}\r\nin the Key Items Pocket.",$Trainer.name,itemname)) end return true Changed: PokemonMart --- Left +++ Right @@ -362,6 +362,4 @@ window.visible=true window.letterbyletter=false - window.baseColor=Color.new(72,72,72) - window.shadowColor=Color.new(208,208,208) end Changed: PokeBattle_ActualScene --- Left +++ Right @@ -1162,5 +1162,5 @@ msgwindow.baseColor=MENUBASECOLOR msgwindow.shadowColor=MENUSHADOWCOLOR - msgwindow.windowskin=@spriteskin + msgwindow.opacity=255 msgwindow.x=0 msgwindow.width=Graphics.width @@ -1170,5 +1170,5 @@ msgwindow.baseColor=MESSAGEBASECOLOR msgwindow.shadowColor=MESSAGESHADOWCOLOR - msgwindow.windowskin=nil + msgwindow.opacity=0 msgwindow.x=16 msgwindow.width=Graphics.width-32 @@ -1502,5 +1502,4 @@ @showingenemy=true @yoffset=(Graphics.height-320) - @spriteskin=BitmapWrapper.new($TextFrames[$PokemonSystem.frame]) pbBackdrop pbAddSprite("partybase1",-400,80+@yoffset,"Graphics/Pictures/pbarrow",@viewport) @@ -1706,5 +1705,4 @@ pbBGMFade(1.0) pbFadeOutAndHide(@sprites) - @spriteskin.dispose pbDisposeSprites end Changed: PokemonLoad --- Left +++ Right @@ -111,6 +111,5 @@ end def self.pbResolveFont(name) - RTP.eachPath {|path| - file=path+Source+name + RTP.eachPathFor(Source+name) {|file| return file if FileTest.exist?(file) } Changed: PokemonBugContest --- Left +++ Right @@ -374,5 +374,4 @@ battle.ballcount=pbBugContestState.ballcount battle.internalbattle=true - wildbgm=pbGetWildBattleBGM(species) decision=0 pbBattleAnimation(pbGetWildBattleBGM(species)) {