Merge branch 'master' into dev

This commit is contained in:
Maruno17
2021-08-12 20:37:25 +01:00
7 changed files with 20 additions and 8 deletions

View File

@@ -75,6 +75,11 @@ module SaveData
return @loaded
end
# Marks value as unloaded.
def mark_as_unloaded
@loaded = false
end
# Uses the {#from_old_format} proc to select the correct data from
# +old_format+ and return it.
# Returns nil if the proc is undefined.
@@ -221,6 +226,13 @@ module SaveData
load_values(save_data) { |value| !value.loaded? }
end
# Marks all values that aren't loaded on bootup as unloaded.
def self.mark_values_as_unloaded
@values.each do |value|
value.mark_as_unloaded unless value.load_in_bootup?
end
end
# Loads each value from the given save data that has
# been set to be loaded during bootup. Done when a save file exists.
# @param save_data [Hash] save data to load