mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Cached MapInfos.rxdata and map_connections.dat, reduced usage of load_data
This commit is contained in:
@@ -8,6 +8,8 @@ class PokemonTemp
|
||||
attr_accessor :speciesShadowMovesets
|
||||
attr_accessor :moveToAnim
|
||||
attr_accessor :battleAnims
|
||||
attr_accessor :mapInfos
|
||||
attr_accessor :mapConnections
|
||||
end
|
||||
|
||||
def pbClearData
|
||||
@@ -18,15 +20,14 @@ def pbClearData
|
||||
$PokemonTemp.speciesShadowMovesets = nil
|
||||
$PokemonTemp.moveToAnim = nil
|
||||
$PokemonTemp.battleAnims = nil
|
||||
$PokemonTemp.mapInfos = nil
|
||||
$PokemonTemp.mapConnections = nil
|
||||
end
|
||||
MapFactoryHelper.clear
|
||||
$PokemonEncounters.setup($game_map.map_id) if $game_map && $PokemonEncounters
|
||||
if pbRgssExists?("Data/Tilesets.rxdata")
|
||||
$data_tilesets = load_data("Data/Tilesets.rxdata")
|
||||
end
|
||||
if pbRgssExists?("Data/Tilesets.rvdata")
|
||||
$data_tilesets = load_data("Data/Tilesets.rvdata")
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
@@ -95,3 +96,25 @@ def pbLoadBattleAnimations
|
||||
end
|
||||
return $PokemonTemp.battleAnims
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Method relating to map connections data.
|
||||
#===============================================================================
|
||||
def pbLoadMapConnections
|
||||
$PokemonTemp = PokemonTemp.new if !$PokemonTemp
|
||||
if !$PokemonTemp.mapConnections
|
||||
$PokemonTemp.mapConnections = load_data("Data/map_connections.dat") || []
|
||||
end
|
||||
return $PokemonTemp.mapConnections
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Method relating to map infos data.
|
||||
#===============================================================================
|
||||
def pbLoadMapInfos
|
||||
$PokemonTemp = PokemonTemp.new if !$PokemonTemp
|
||||
if !$PokemonTemp.mapInfos
|
||||
$PokemonTemp.mapInfos = load_data("Data/MapInfos.rxdata")
|
||||
end
|
||||
return $PokemonTemp.mapInfos
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user