Cached MapInfos.rxdata and map_connections.dat, reduced usage of load_data

This commit is contained in:
Maruno17
2021-02-26 23:00:27 +00:00
parent c9903c59c8
commit b281734312
16 changed files with 65 additions and 41 deletions

View File

@@ -422,7 +422,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
# roaming
curmap = $PokemonGlobal.roamPosition[index]
if curmap
mapinfos = load_data("Data/MapInfos.rxdata")
mapinfos = pbLoadMapInfos
status = "[ROAMING][#{curmap}: #{mapinfos[curmap].name}]"
else
status = "[ROAMING][map not set]"
@@ -771,7 +771,7 @@ end
def pbDebugFixInvalidTiles
num_errors = 0
num_error_maps = 0
@tilesets = load_data("Data/Tilesets.rxdata")
@tilesets = $data_tilesets
mapData = MapData.new
t = Time.now.to_i
Graphics.update

View File

@@ -4,7 +4,7 @@
# Main editor method for editing wild encounters. Lists all defined encounter
# sets, and edits them.
def pbEncountersEditor
map_infos = load_data("Data/MapInfos.rxdata")
map_infos = pbLoadMapInfos
commands = []
maps = []
list = pbListWindow([])
@@ -122,7 +122,7 @@ end
# Lists the map ID, version number and defined encounter types for the given
# encounter data (a GameData::Encounter instance), and edits them.
def pbEncounterMapVersionEditor(enc_data)
map_infos = load_data("Data/MapInfos.rxdata")
map_infos = pbLoadMapInfos
commands = []
enc_types = []
list = pbListWindow([])
@@ -720,7 +720,7 @@ def pbMetadataScreen(map_id = 0)
end
def pbEditMetadata(map_id = 0)
mapinfos = load_data("Data/MapInfos.rxdata")
mapinfos = pbLoadMapInfos
data = []
if map_id == 0 # Global metadata
map_name = _INTL("Global Metadata")

View File

@@ -59,7 +59,7 @@ def pbAllocateAnimation(animations,name)
end
def pbMapTree
mapinfos = load_data("Data/MapInfos.rxdata")
mapinfos = pbLoadMapInfos
maplevels = []
retarray = []
for i in mapinfos.keys

View File

@@ -285,6 +285,7 @@ class MapScreenScene
def serializeConnectionData
conndata=generateConnectionData()
save_data(conndata, "Data/map_connections.dat")
$PokemonTemp.mapConnections = nil
Compiler.write_connections
@mapconns=conndata
end
@@ -330,7 +331,7 @@ class MapScreenScene
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(_INTL("F: Help"),
0, 600 - 64, 800, 64, @viewport)
@sprites["title"].z = 2
@mapinfos=load_data("Data/MapInfos.rxdata")
@mapinfos=pbLoadMapInfos
conns=MapFactoryHelper.getMapConnections
@mapconns=[]
for c in conns