mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Refactored phone/rematches code, added Phone.rematches_enabled/Phone.rematch_variant/map metadata flag "NoPhoneSignal", changed event layout, trainer contacts can use Common Events for their calls, etc.
This commit is contained in:
@@ -348,3 +348,35 @@ SaveData.register_conversion(:v20_convert_pokemon_markings) do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
SaveData.register_conversion(:v21_replace_phone_data) do
|
||||
essentials_version 21
|
||||
display_title "Updating Phone data format"
|
||||
to_value :global_metadata do |global|
|
||||
if !global.phone
|
||||
global.instance_eval do
|
||||
@phone = Phone.new
|
||||
@phoneTime = nil # Don't bother using this
|
||||
if @phoneNumbers
|
||||
@phoneNumbers.each do |contact|
|
||||
if contact.length > 4
|
||||
# Trainer
|
||||
# TODO: Is there any way to ensure the versions count is accurate?
|
||||
Phone.add_silent(contact[6], contact[7], contact[1], contact[2], 0, [contact[5], 3].max)
|
||||
new_contact = Phone.get(contact[1], contact[2], 0)
|
||||
new_contact.visible = contact[0]
|
||||
new_contact.version = contact[5]
|
||||
new_contact.rematch_flag = [contact[4] - 1, 0].max
|
||||
else
|
||||
# Non-trainer
|
||||
Phone.add_silent(contact[3], contact[2], contact[1])
|
||||
end
|
||||
end
|
||||
@phoneNumbers = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user