diff --git a/Data/Scripts/003_Game classes/011_MapFactory.rb b/Data/Scripts/003_Game classes/011_MapFactory.rb index 15bcf59b1..9a76f9072 100644 --- a/Data/Scripts/003_Game classes/011_MapFactory.rb +++ b/Data/Scripts/003_Game classes/011_MapFactory.rb @@ -462,7 +462,7 @@ module MapFactoryHelper # Add map to cache if can't be found if !@@MapDims[id] begin - map = pbLoadRxData(sprintf("Data/Map%03d", id)) + map = load_data(sprintf("Data/Map%03d.rxdata", id)) @@MapDims[id] = [map.width,map.height] rescue @@MapDims[id] = [0,0] diff --git a/Data/Scripts/006_Game processing/002_Scene_Map.rb b/Data/Scripts/006_Game processing/002_Scene_Map.rb index 4e802d355..b2fd8922f 100644 --- a/Data/Scripts/006_Game processing/002_Scene_Map.rb +++ b/Data/Scripts/006_Game processing/002_Scene_Map.rb @@ -48,7 +48,7 @@ class Scene_Map playingBGM = $game_system.playing_bgm playingBGS = $game_system.playing_bgs return if !playingBGM && !playingBGS - map = pbLoadRxData(sprintf("Data/Map%03d",mapid)) + map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) if playingBGM && map.autoplay_bgm if (PBDayNight.isNight? rescue false) pbBGMFade(0.8) if playingBGM.name!=map.bgm.name && playingBGM.name!=map.bgm.name+"_n" diff --git a/Data/Scripts/007_Events and files/003_Intl_Messages.rb b/Data/Scripts/007_Events and files/003_Intl_Messages.rb index 52ee6b1a2..64849829b 100644 --- a/Data/Scripts/007_Events and files/003_Intl_Messages.rb +++ b/Data/Scripts/007_Events and files/003_Intl_Messages.rb @@ -34,7 +34,7 @@ def pbSetTextMessages end # Must add messages because this code is used by both game system and Editor MessageTypes.addMessagesAsHash(MessageTypes::ScriptTexts,texts) - commonevents=pbLoadRxData("Data/CommonEvents") + commonevents = load_data("Data/CommonEvents.rxdata") items=[] choices=[] for event in commonevents.compact @@ -96,7 +96,7 @@ def pbSetTextMessages choices|=[] items.concat(choices) MessageTypes.setMapMessagesAsHash(0,items) - mapinfos = pbLoadRxData("Data/MapInfos") + mapinfos = load_data("Data/MapInfos.rxdata") mapnames=[] for id in mapinfos.keys mapnames[id]=mapinfos[id].name diff --git a/Data/Scripts/009_Objects and windows/002_MessageConfig.rb b/Data/Scripts/009_Objects and windows/002_MessageConfig.rb index f6b3a0507..99dd43f24 100644 --- a/Data/Scripts/009_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/009_Objects and windows/002_MessageConfig.rb @@ -77,7 +77,7 @@ module MessageConfig end def self.pbDefaultWindowskin - skin=load_data("Data/System.rxdata").windowskin_name rescue nil + skin=($data_system) ? $data_system.windowskin_name : nil if skin && skin!="" skin=pbResolveBitmap("Graphics/Windowskins/"+skin) || "" end diff --git a/Data/Scripts/009_Objects and windows/011_Messages.rb b/Data/Scripts/009_Objects and windows/011_Messages.rb index 5f9bd3fd8..5b2e0966c 100644 --- a/Data/Scripts/009_Objects and windows/011_Messages.rb +++ b/Data/Scripts/009_Objects and windows/011_Messages.rb @@ -343,7 +343,7 @@ end #=============================================================================== def pbGetBasicMapNameFromId(id) begin - map = pbLoadRxData("Data/MapInfos") + map = load_data("Data/MapInfos.rxdata") return "" if !map return map[id].name rescue diff --git a/Data/Scripts/010_Scenes/003_Scene_Intro.rb b/Data/Scripts/010_Scenes/003_Scene_Intro.rb index 824ad473c..d5a36855d 100644 --- a/Data/Scripts/010_Scenes/003_Scene_Intro.rb +++ b/Data/Scripts/010_Scenes/003_Scene_Intro.rb @@ -12,8 +12,7 @@ class IntroEventScene < EventScene @pic2 = addImage(0,0,"") # flashing "Press Enter" picture @pic2.setOpacity(0,0) @index = 0 - data_system = pbLoadRxData("Data/System") - pbBGMPlay(data_system.title_bgm) + pbBGMPlay($data_system.title_bgm) openPic(self,nil) end diff --git a/Data/Scripts/017_UI/013_PScreen_Load.rb b/Data/Scripts/017_UI/013_PScreen_Load.rb index f15c461d6..ccf3be064 100644 --- a/Data/Scripts/017_UI/013_PScreen_Load.rb +++ b/Data/Scripts/017_UI/013_PScreen_Load.rb @@ -262,9 +262,8 @@ class PokemonLoadScreen $game_system = Game_System.new $PokemonSystem = PokemonSystem.new if !$PokemonSystem savefile = RTP.getSaveFileName("Game.rxdata") - data_system = pbLoadRxData("Data/System") - mapfile = sprintf("Data/Map%03d.rxdata",data_system.start_map_id) - if data_system.start_map_id==0 || !pbRgssExists?(mapfile) + mapfile = sprintf("Data/Map%03d.rxdata", $data_system.start_map_id) + if $data_system.start_map_id == 0 || !pbRgssExists?(mapfile) pbMessage(_INTL("No starting position was set in the map editor.\1")) pbMessage(_INTL("The game cannot continue.")) @scene.pbEndScene @@ -431,7 +430,6 @@ class PokemonLoadScreen $PokemonStorage = PokemonStorage.new $PokemonEncounters = PokemonEncounters.new $PokemonTemp.begunNewGame = true - $data_system = pbLoadRxData("Data/System") $MapFactory = PokemonMapFactory.new($data_system.start_map_id) # calls setMapChanged $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh diff --git a/Data/Scripts/017_UI/025_PScreen_Mart.rb b/Data/Scripts/017_UI/025_PScreen_Mart.rb index c28270498..52f6b6d79 100644 --- a/Data/Scripts/017_UI/025_PScreen_Mart.rb +++ b/Data/Scripts/017_UI/025_PScreen_Mart.rb @@ -81,139 +81,6 @@ class PokemonMartAdapter end end -#=============================================================================== -# Abstraction layer for RPG Maker XP -# Won't be used if $PokemonBag exists -#=============================================================================== -class RpgxpMartAdapter - def getMoney - return $game_party.gold - end - - def getMoneyString - return pbGetGoldString - end - - def setMoney(value) - $game_party.gain_gold(-$game_party.gold) - $game_party.gain_gold(value) - end - - def getPrice(item, _selling = false) - return item.price - end - - def getItemIcon(item) - return nil if !item - if item == 0 - return sprintf("Graphics/Items/back") - elsif item.respond_to?("icon_index") - return "Graphics/System/IconSet" - else - return sprintf("Graphics/Icons/%s", item.icon_name) - end - end - - def getItemIconRect(item) - if item && item.respond_to?("icon_index") - ix = item.icon_index % 16 * 24 - iy = item.icon_index / 16 * 24 - return Rect.new(ix, iy, 24, 24) - end - return Rect.new(0, 0, 32, 32) - end - - def getInventory - data = [] - for i in 1...$data_items.size - data.push($data_items[i]) if getQuantity($data_items[i]) > 0 - end - for i in 1...$data_weapons.size - data.push($data_weapons[i]) if getQuantity($data_weapons[i]) > 0 - end - for i in 1...$data_armors.size - data.push($data_armors[i]) if getQuantity($data_armors[i]) > 0 - end - return data - end - - def canSell?(item) - return item ? item.price > 0 : false - end - - def getName(item) - return item ? item.name : "" - end - - def getDisplayName(item) - return item ? item.name : "" - end - - def getDescription(item) - return item ? item.description : "" - end - - def getDisplayPrice(item, _selling = false) - price = item.price - return price.to_s - end - - def addItem(item) - ret = (getQuantity(item) < 99) - if $game_party.respond_to?("gain_weapon") - case item - when RPG::Item - $game_party.gain_item(item.id, 1) if ret - when RPG::Weapon - $game_party.gain_weapon(item.id, 1) if ret - when RPG::Armor - $game_party.gain_armor(item.id, 1) if ret - end - else - $game_party.gain_item(item, 1) if ret - end - return ret - end - - def getQuantity(item) - ret = 0 - if $game_party.respond_to?("weapon_number") - case item - when RPG::Item - ret = $game_party.item_number(item.id) - when RPG::Weapon - ret = ($game_party.weapon_number(item.id)) - when RPG::Armor - ret = ($game_party.armor_number(item.id)) - end - else - return $game_party.item_number(item) - end - return ret - end - - def showQuantity?(_item) - return true - end - - def removeItem(item) - ret = (getQuantity(item) > 0) - if $game_party.respond_to?("lose_weapon") - case item - when RPG::Item - $game_party.lose_item(item.id, 1) if ret - when RPG::Weapon - $game_party.lose_weapon(item.id, 1) if ret - when RPG::Armor - $game_party.lose_armor(item.id, 1) if ret - end - else - $game_party.lose_item(item, 1) if ret - end - return ret - end -end - #=============================================================================== # Buy and Sell adapters #=============================================================================== @@ -661,7 +528,7 @@ class PokemonMartScreen def initialize(scene,stock) @scene=scene @stock=stock - @adapter=$PokemonBag ? PokemonMartAdapter.new : RpgxpMartAdapter.new + @adapter=PokemonMartAdapter.new end def pbConfirm(msg) diff --git a/Data/Scripts/020_System and utilities/002_PSystem_System.rb b/Data/Scripts/020_System and utilities/002_PSystem_System.rb index 7610465e3..669300296 100644 --- a/Data/Scripts/020_System and utilities/002_PSystem_System.rb +++ b/Data/Scripts/020_System and utilities/002_PSystem_System.rb @@ -8,10 +8,6 @@ def pbSafeLoad(file) return load_data(file) end -def pbLoadRxData(file) # :nodoc: - return load_data(file+".rxdata") -end - def pbChooseLanguage commands=[] for lang in LANGUAGES @@ -20,18 +16,6 @@ def pbChooseLanguage return pbShowCommands(nil,commands) end -if !respond_to?("pbSetResizeFactor") - def pbSetResizeFactor(dummy); end - - module Graphics - def self.snap_to_bitmap; return nil; end - end -end - - -############# -############# - def pbSetUpSystem begin diff --git a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb index 907a11fea..1ad39a7b4 100644 --- a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb +++ b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb @@ -48,41 +48,6 @@ def pbEachCombination(array,num) end while _pbNextComb(currentComb,array.length) end -def pbGetCDID() - sendString = proc { |x| - mciSendString = Win32API.new('winmm','mciSendString','%w(p,p,l,l)','l') - next "" if !mciSendString - buffer = "\0"*2000 - x = mciSendString.call(x,buffer,2000,0) - next (x==0) ? buffer.gsub(/\0/,"") : "" - } - sendString.call("open cdaudio shareable") - ret = "" - if sendString.call("status cdaudio media present")=="true" - ret = sendString.call("info cdaudio identity") - if ret=="" - ret = sendString.call("info cdaudio info identity") - end - end - sendString.call("close cdaudio") - return ret -end - -# Gets the path of the user's "My Documents" folder. -def pbGetMyDocumentsFolder() - csidl_personal = 0x0005 - shGetSpecialFolderLocation = Win32API.new("shell32.dll","SHGetSpecialFolderLocation","llp","i") - shGetPathFromIDList = Win32API.new("shell32.dll","SHGetPathFromIDList","lp","i") - return "." if !shGetSpecialFolderLocation || !shGetPathFromIDList - idl = [0].pack("V") - ret = shGetSpecialFolderLocation.call(0,csidl_personal,idl) - return "." if ret!=0 - path = "\0"*512 - ret = shGetPathFromIDList.call(idl.unpack("V")[0],path) - return "." if ret==0 - return path.gsub(/\0/,"") -end - # Returns a country ID # http://msdn.microsoft.com/en-us/library/dd374073%28VS.85%29.aspx? def pbGetCountry() @@ -181,359 +146,6 @@ end -#=============================================================================== -# Linear congruential random number generator -#=============================================================================== -class LinearCongRandom - def initialize(mul, add, seed=nil) - @s1 = mul - @s2 = add - @seed = seed - @seed = (Time.now.to_i&0xffffffff) if !@seed - @seed = (@seed+0xFFFFFFFF)+1 if @seed<0 - end - - def self.dsSeed - t = Time.now - seed = (((t.mon*t.mday+t.min+t.sec)&0xFF)<<24) | (t.hour << 16) | (t.year-2000) - seed = (seed+0xFFFFFFFF)+1 if seed<0 - return seed - end - - def self.pokemonRNG - self.new(0x41c64e6d,0x6073,self.dsSeed) - end - - def self.pokemonRNGInverse - self.new(0xeeb9eb65,0xa3561a1,self.dsSeed) - end - - def self.pokemonARNG - self.new(0x6C078965,0x01,self.dsSeed) - end - - def getNext16 # calculates @seed * @s1 + @s2 - @seed = ((((@seed&0x0000ffff)*(@s1&0x0000ffff))&0x0000ffff) | - (((((((@seed&0x0000ffff)*(@s1&0x0000ffff))&0xffff0000)>>16) + - ((((@seed&0xffff0000)>>16)*(@s1&0x0000ffff))&0x0000ffff) + - (((@seed&0x0000ffff)*((@s1&0xffff0000)>>16))&0x0000ffff)) & - 0x0000ffff)<<16)) + @s2 - r = (@seed>>16) - r = (r+0xFFFFFFFF)+1 if r<0 - return r - end - - def getNext - r = (getNext16()<<16) | (getNext16()) - r = (r+0xFFFFFFFF)+1 if r<0 - return r - end -end - - - -#=============================================================================== -# Json-related utilities -#=============================================================================== -# Returns true if the given string represents a valid object in JavaScript -# Object Notation, and false otherwise. -def pbIsJsonString(str) - return false if !str || str[/^[\s]*$/] - d = /(?:^|:|,)(?: ?\[)+/ - charEscapes = /\\[\"\\\/nrtubf]/ #" - stringLiterals = /"[^"\\\n\r\x00-\x1f\x7f-\x9f]*"/ #" - whiteSpace = /[\s]+/ - str = str.gsub(charEscapes,"@").gsub(stringLiterals,"true").gsub(whiteSpace," ") - # prevent cases like "truetrue" or "true true" or "true[true]" or "5-2" or "5true" - otherLiterals = /(true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)(?! ?[0-9a-z\-\[\{\"])/ #" - str = str.gsub(otherLiterals,"]").gsub(d,"") #" - return str[/^[\],:{} ]*$/] ? true : false -end - -# Returns a Ruby object that corresponds to the given string, which is encoded in -# JavaScript Object Notation (JSON). Returns nil if the string is not valid JSON. -def pbParseJson(str) - return nil if !pbIsJsonString(str) - stringRE = /(\"(\\[\"\'\\rntbf]|\\u[0-9A-Fa-f]{4,4}|[^\\\"])*\")/ #" - strings = [] - str = str.gsub(stringRE) { - sl = strings.length - ss = $1 - if ss.include?("\\u") - ss.gsub!(/\\u([0-9A-Fa-f]{4,4})/) { - codepoint = $1.to_i(16) - if codepoint<=0x7F - next sprintf("\\x%02X",codepoint) - elsif codepoint<=0x7FF - next sprintf("%s%s", - (0xC0|((codepoint>>6)&0x1F)).chr, - (0x80|(codepoint&0x3F)).chr) - else - next sprintf("%s%s%s", - (0xE0|((codepoint>>12)&0x0F)).chr, - (0x80|((codepoint>>6)&0x3F)).chr, - (0x80|(codepoint&0x3F)).chr) - end - } - end - strings.push(eval(ss)) - next sprintf("strings[%d]",sl) - } - str = str.gsub(/\:/,"=>") - str = str.gsub(/null/,"nil") - return eval("("+str+")") -end - - - -#=============================================================================== -# XML-related utilities -#=============================================================================== -# Represents XML content. -class MiniXmlContent - attr_reader :value - - def initialize(value) - @value = value - end -end - - - -# Represents an XML element. -class MiniXmlElement - attr_accessor :name,:attributes,:children - - def initialize(name) - @name = name - @attributes = {} - @children = [] - end - -# Gets the value of the attribute with the given name, or nil if it doesn't -# exist. - def a(name) - self.attributes[name] - end - -# Gets the entire text of this element. - def value - ret = "" - for c in @children - ret += c.value - end - return ret - end - -# Gets the first child of this element with the given name, or nil if it -# doesn't exist. - def e(name) - for c in @children - return c if c.is_a?(MiniXmlElement) && c.name==name - end - return nil - end - - def eachElementNamed(name) - for c in @children - yield c if c.is_a?(MiniXmlElement) && c.name==name - end - end -end - - - -# A small class for reading simple XML documents. Such documents must -# meet the following restrictions: -# They may contain comments and processing instructions, but they are -# ignored. -# They can't contain any entity references other than 'gt', 'lt', -# 'amp', 'apos', or 'quot'. -# They can't contain a DOCTYPE declaration or DTDs. -class MiniXmlReader - def initialize(data) - @root = nil - @elements = [] - @done = false - @data = data - @content = "" - end - - def createUtf8(codepoint) #:nodoc: - raise ArgumentError.new("Illegal character") if codepoint<9 || - codepoint==11 || codepoint==12 || (codepoint>=14 && codepoint<32) || - codepoint==0xFFFE || codepoint==0xFFFF || (codepoint>=0xD800 && codepoint<0xE000) - return codepoint.chr if codepoint<=0x7F - if codepoint<=0x7FF - str = (0xC0|((codepoint>>6)&0x1F)).chr - str += (0x80|(codepoint &0x3F)).chr - return str - elsif codepoint<=0xFFFF - str = (0xE0|((codepoint>>12)&0x0F)).chr - str += (0x80|((codepoint>>6)&0x3F)).chr - str += (0x80|(codepoint &0x3F)).chr - return str - elsif codepoint<=0x10FFFF - str = (0xF0|((codepoint>>18)&0x07)).chr - str += (0x80|((codepoint>>12)&0x3F)).chr - str += (0x80|((codepoint>>6)&0x3F)).chr - str += (0x80|(codepoint &0x3F)).chr - return str - else - raise ArgumentError.new("Illegal character") - end - end - - def unescape(attr) #:nodoc: - attr = attr.gsub(/\r(\n|$|(?=[^\n]))/,"\n") - raise ArgumentError.new("Attribute value contains '<'") if attr.include?("<") - attr = attr.gsub(/&(lt|gt|apos|quot|amp|\#([0-9]+)|\#x([0-9a-fA-F]+));|([\n\r\t])/) { - next " " if $4=="\n"||$4=="\r"||$4=="\t" - next "<" if $1=="lt" - next ">" if $1=="gt" - next "'" if $1=="apos" - next "\"" if $1=="quot" - next "&" if $1=="amp" - next createUtf8($2.to_i) if $2 - next createUtf8($3.to_i(16)) if $3 - } - return attr - end - - def readAttributes(attribs) #:nodoc: - ret = {} - while attribs.length>0 - if attribs[/(\s+([\w\-]+)\s*\=\s*\"([^\"]*)\")/] - attribs = attribs[$1.length,attribs.length] - name = $2; value = $3 - raise ArgumentError.new("Attribute already exists") if ret[name]!=nil - ret[name] = unescape(value) - elsif attribs[/(\s+([\w\-]+)\s*\=\s*\'([^\']*)\')/] - attribs = attribs[$1.length,attribs.length] - name = $2; value = $3 - raise ArgumentError.new("Attribute already exists") if ret[name]!=nil - ret[name] = unescape(value) - else - raise ArgumentError.new("Can't parse attributes") - end - end - return ret - end - -# Reads the entire contents of an XML document. Returns the root element of -# the document or raises an ArgumentError if an error occurs. - def read - if @data[/\A((\xef\xbb\xbf)?<\?xml\s+version\s*=\s*(\"1\.[0-9]\"|\'1\.[0-9]\')(\s+encoding\s*=\s*(\"[^\"]*\"|\'[^\']*\'))?(\s+standalone\s*=\s*(\"(yes|no)\"|\'(yes|no)\'))?\s*\?>)/] - # Ignore XML declaration - @data = @data[$1.length,@data.length] - end - while readOneElement(); end - return @root - end - - def readOneElement #:nodoc: - if @data[/\A\s*\z/] - @data = "" - if !@root - raise ArgumentError.new("Not an XML document.") - elsif !@done - raise ArgumentError.new("Unexpected end of document.") - end - return false - end - if @data[/\A(\s*<([\w\-]+)((?:\s+[\w\-]+\s*\=\s*(?:\"[^\"]*\"|\'[^\']*\'))*)\s*(\/>|>))/] - @data = @data[$1.length,@data.length] - elementName = $2 - attributes = $3 - endtag = $4 - raise ArgumentError.new("Element tag at end of document") if @done - if @content.length>0 && @elements.length>0 - @elements[@elements.length-1].children.push(MiniXmlContent.new(@content)) - @content = "" - end - element = MiniXmlElement.new(elementName) - element.attributes = readAttributes(attributes) - if !@root - @root = element - else - @elements[@elements.length-1].children.push(element) - end - if endtag==">" - @elements.push(element) - else - @done = true if @elements.length==0 - end - elsif @data[/\A()/] - # ignore comments - raise ArgumentError.new("Incorrect comment") if $2.include?("--") - @data = @data[$1.length,@data.length] - elsif @data[/\A(<\?([\w\-]+)\s+[\s\S]*?\?>)/] - # ignore processing instructions - @data = @data[$1.length,@data.length] - if $2.downcase=="xml" - raise ArgumentError.new("'xml' processing instruction not allowed") - end - elsif @data[/\A(<\?([\w\-]+)\?>)/] - # ignore processing instructions - @data = @data[$1.length,@data.length] - if $2.downcase=="xml" - raise ArgumentError.new("'xml' processing instruction not allowed") - end - elsif @data[/\A(\s*<\/([\w\-]+)>)/] - @data = @data[$1.length,@data.length] - elementName = $2 - raise ArgumentError.new("End tag at end of document") if @done - if @elements.length==0 - raise ArgumentError.new("Unexpected end tag") - elsif @elements[@elements.length-1].name!=elementName - raise ArgumentError.new("Incorrect end tag") - else - if @content.length>0 - @elements[@elements.length-1].children.push(MiniXmlContent.new(@content)) - @content = "" - end - @elements.pop() - @done = true if @elements.length==0 - end - else - if @elements.length>0 - # Parse content - if @data[/\A([^<&]+)/] - content = $1 - @data = @data[content.length,@data.length] - raise ArgumentError.new("Incorrect content") if content.include?("]]>") - content.gsub!(/\r(\n|\z|(?=[^\n]))/,"\n") - @content += content - elsif @data[/\A(<\!\[CDATA\[([\s\S]*?)\]\]>)/] - content = $2 - @data = @data[$1.length,@data.length] - content.gsub!(/\r(\n|\z|(?=[^\n]))/,"\n") - @content += content - elsif @data[/\A(&(lt|gt|apos|quot|amp|\#([0-9]+)|\#x([0-9a-fA-F]+));)/] - @data = @data[$1.length,@data.length] - content = "" - if $2=="lt"; content = "<" - elsif $2=="gt"; content = ">" - elsif $2=="apos"; content = "'" - elsif $2=="quot"; content = "\"" - elsif $2=="amp"; content = "&" - elsif $3; content = createUtf8($2.to_i) - elsif $4; content = createUtf8($3.to_i(16)) - end - @content += content - elsif !@data[/\A schema[b][0] } GameData::MapMetadata.each do |map_data| diff --git a/Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb index 9cef385bd..5b88fabcb 100644 --- a/Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/022_Compiler/004_Compiler_MapsAndEvents.rb @@ -14,7 +14,7 @@ module Compiler mapfiles[$1.to_i(10)] = true if map[/map(\d+)\.rxdata/i] end } - mapinfos = pbLoadRxData("Data/MapInfos") + mapinfos = load_data("Data/MapInfos.rxdata") maxOrder = 0 # Exclude maps found in mapinfos for id in mapinfos.keys @@ -239,9 +239,9 @@ module Compiler attr_reader :mapinfos def initialize - @mapinfos = pbLoadRxData("Data/MapInfos") - @system = pbLoadRxData("Data/System") - @tilesets = pbLoadRxData("Data/Tilesets") + @mapinfos = load_data("Data/MapInfos.rxdata") + @system = load_data("Data/System.rxdata") + @tilesets = load_data("Data/Tilesets.rxdata") @mapxy = [] @mapWidths = [] @mapHeights = [] @@ -1400,7 +1400,7 @@ module Compiler end changed = false Graphics.update - commonEvents = pbLoadRxData("Data/CommonEvents") + commonEvents = load_data("Data/CommonEvents.rxdata") pbSetWindowText(_INTL("Processing common events")) for key in 0...commonEvents.length newevent = fix_event_use(commonEvents[key],0,mapData) diff --git a/Data/Scripts/999_Main/999_Main.rb b/Data/Scripts/999_Main/999_Main.rb index 0f09d5f00..edd9b5ef6 100644 --- a/Data/Scripts/999_Main/999_Main.rb +++ b/Data/Scripts/999_Main/999_Main.rb @@ -29,10 +29,10 @@ def mainFunctionDebug begin Compiler.main pbSetUpSystem - $data_animations = pbLoadRxData("Data/Animations") - $data_tilesets = pbLoadRxData("Data/Tilesets") - $data_common_events = pbLoadRxData("Data/CommonEvents") - $data_system = pbLoadRxData("Data/System") + $data_animations = load_data("Data/Animations.rxdata") + $data_tilesets = load_data("Data/Tilesets.rxdata") + $data_common_events = load_data("Data/CommonEvents.rxdata") + $data_system = load_data("Data/System.rxdata") $game_system = Game_System.new Graphics.update Graphics.freeze