Added support for all three Gen 4 location sign styles, minor tweaks to other code

This commit is contained in:
Maruno17
2024-10-28 23:18:57 +00:00
parent 3eb2724794
commit 35be8fcf67
13 changed files with 286 additions and 139 deletions

View File

@@ -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))
}
)