Renamed some more global variables

This commit is contained in:
Maruno17
2021-10-20 23:13:30 +01:00
parent e49cd8d498
commit 5e51f702b3
17 changed files with 62 additions and 59 deletions

View File

@@ -46,7 +46,7 @@ module Game
$PokemonTemp.begunNewGame = true
$scene = Scene_Map.new
SaveData.load_new_game_values
$MapFactory = PokemonMapFactory.new($data_system.start_map_id)
$map_factory = PokemonMapFactory.new($data_system.start_map_id)
$game_player.moveto($data_system.start_x, $data_system.start_y)
$game_player.refresh
$PokemonEncounters = PokemonEncounters.new
@@ -70,20 +70,20 @@ module Game
# Loads and validates the map. Called when loading a saved game.
def self.load_map
$game_map = $MapFactory.map
$game_map = $map_factory.map
magic_number_matches = ($game_system.magic_number == $data_system.magic_number)
if !magic_number_matches || $PokemonGlobal.safesave
if pbMapInterpreterRunning?
pbMapInterpreter.setup(nil, 0)
end
begin
$MapFactory.setup($game_map.map_id)
$map_factory.setup($game_map.map_id)
rescue Errno::ENOENT
if $DEBUG
pbMessage(_INTL('Map {1} was not found.', $game_map.map_id))
map = pbWarpToMap
exit unless map
$MapFactory.setup(map[0])
$map_factory.setup(map[0])
$game_player.moveto(map[1], map[2])
else
raise _INTL('The map was not found. The game cannot continue.')
@@ -91,7 +91,7 @@ module Game
end
$game_player.center($game_player.x, $game_player.y)
else
$MapFactory.setMapChanged($game_map.map_id)
$map_factory.setMapChanged($game_map.map_id)
end
if $game_map.events.nil?
raise _INTL('The map is corrupt. The game cannot continue.')

View File

@@ -19,18 +19,18 @@ class Scene_Map
@map_renderer = TilemapRenderer.new(Spriteset_Map.viewport)
@spritesetGlobal = Spriteset_Global.new
@spritesets = {}
for map in $MapFactory.maps
for map in $map_factory.maps
@spritesets[map.map_id] = Spriteset_Map.new(map)
end
$MapFactory.setSceneStarted(self)
$map_factory.setSceneStarted(self)
updateSpritesets
end
def createSingleSpriteset(map)
temp = $scene.spriteset.getAnimations
@spritesets[map] = Spriteset_Map.new($MapFactory.maps[map])
@spritesets[map] = Spriteset_Map.new($map_factory.maps[map])
$scene.spriteset.restoreAnimations(temp)
$MapFactory.setSceneStarted(self)
$map_factory.setSceneStarted(self)
updateSpritesets
end
@@ -74,7 +74,7 @@ class Scene_Map
pbBridgeOff
@spritesetGlobal.playersprite.clearShadows
if $game_map.map_id!=$game_temp.player_new_map_id
$MapFactory.setup($game_temp.player_new_map_id)
$map_factory.setup($game_temp.player_new_map_id)
end
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
case $game_temp.player_new_direction
@@ -132,17 +132,17 @@ class Scene_Map
end
def updateMaps
for map in $MapFactory.maps
for map in $map_factory.maps
map.update
end
$MapFactory.updateMaps(self)
$map_factory.updateMaps(self)
end
def updateSpritesets
@spritesets = {} if !@spritesets
keys = @spritesets.keys.clone
for i in keys
if !$MapFactory.hasMap?(i)
if !$map_factory.hasMap?(i)
@spritesets[i].dispose if @spritesets[i]
@spritesets[i] = nil
@spritesets.delete(i)
@@ -151,7 +151,7 @@ class Scene_Map
end
end
@spritesetGlobal.update
for map in $MapFactory.maps
for map in $map_factory.maps
@spritesets[map.map_id] = Spriteset_Map.new(map) if !@spritesets[map.map_id]
end
pbDayNightTint(@map_renderer)

View File

@@ -92,7 +92,7 @@ class Interpreter
end
# If this interpreter's map isn't the current map or connected to it,
# forget this interpreter's event ID
if $game_map.map_id != @map_id && !$MapFactory.areConnected?($game_map.map_id, @map_id)
if $game_map.map_id != @map_id && !$map_factory.areConnected?($game_map.map_id, @map_id)
@event_id = 0
end
# Update child interpreter if one exists
@@ -312,8 +312,8 @@ class Interpreter
mapid = @map_id if mapid < 0
old_value = $game_self_switches[[mapid, eventid, switch_name]]
$game_self_switches[[mapid, eventid, switch_name]] = value
if value != old_value && $MapFactory.hasMap?(mapid)
$MapFactory.getMap(mapid, false).need_refresh = true
if value != old_value && $map_factory.hasMap?(mapid)
$map_factory.getMap(mapid, false).need_refresh = true
end
end

View File

@@ -73,7 +73,7 @@ module Events
# Parameters:
# e[0] - Event that just left the tile.
# e[1] - Map ID where the tile is located (not necessarily
# the current map). Use "$MapFactory.getMap(e[1])" to
# the current map). Use "$map_factory.getMap(e[1])" to
# get the Game_Map object corresponding to that map.
# e[2] - X-coordinate of the tile
# e[3] - Y-coordinate of the tile