mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Added support for all three Gen 4 location sign styles, minor tweaks to other code
This commit is contained in:
@@ -319,23 +319,27 @@ EventHandlers.add(:on_map_or_spriteset_change, :show_darkness,
|
||||
}
|
||||
)
|
||||
|
||||
# Show location signpost.
|
||||
EventHandlers.add(:on_map_or_spriteset_change, :show_location_window,
|
||||
# Show location sign.
|
||||
EventHandlers.add(:on_map_or_spriteset_change, :show_location_sign,
|
||||
proc { |scene, map_changed|
|
||||
next if !scene || !scene.spriteset
|
||||
next if !map_changed || !$game_map.metadata&.announce_location
|
||||
nosignpost = false
|
||||
no_sign = false
|
||||
if $PokemonGlobal.mapTrail[1]
|
||||
(Settings::NO_SIGNPOSTS.length / 2).times do |i|
|
||||
nosignpost = true if Settings::NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_SIGNPOSTS[(2 * i) + 1] == $game_map.map_id
|
||||
nosignpost = true if Settings::NO_SIGNPOSTS[(2 * i) + 1] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_SIGNPOSTS[2 * i] == $game_map.map_id
|
||||
break if nosignpost
|
||||
(Settings::NO_LOCATION_SIGNS.length / 2).times do |i|
|
||||
no_sign = true if Settings::NO_LOCATION_SIGNS[2 * i] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_LOCATION_SIGNS[(2 * i) + 1] == $game_map.map_id
|
||||
no_sign = true if Settings::NO_LOCATION_SIGNS[(2 * i) + 1] == $PokemonGlobal.mapTrail[1] &&
|
||||
Settings::NO_LOCATION_SIGNS[2 * i] == $game_map.map_id
|
||||
break if no_sign
|
||||
end
|
||||
nosignpost = true if $game_map.name == pbGetMapNameFromId($PokemonGlobal.mapTrail[1])
|
||||
no_sign = true if $game_map.name == pbGetMapNameFromId($PokemonGlobal.mapTrail[1])
|
||||
end
|
||||
scene.spriteset.addUserSprite(LocationWindow.new($game_map.name)) if !nosignpost
|
||||
next if no_sign
|
||||
map_name = $game_map.name
|
||||
location_sign_graphic = $game_map.metadata&.location_sign || Settings::DEFAULT_LOCATION_SIGN_GRAPHIC
|
||||
location_sign_graphic = Settings::DEFAULT_LOCATION_SIGN_GRAPHIC
|
||||
scene.spriteset.addUserSprite(LocationWindow.new(map_name, location_sign_graphic))
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user