Expand character customization assets
This commit is contained in:
parent
23cf53fa14
commit
df2a4d7d77
31 changed files with 2423 additions and 215 deletions
|
|
@ -46,7 +46,7 @@ const PlayerBottleMessageStateType = preload(
|
|||
"res://messages/player_bottle_message_state.gd"
|
||||
)
|
||||
|
||||
const SAVE_VERSION: int = 12
|
||||
const SAVE_VERSION: int = 13
|
||||
const LEGACY_SAVE_FILENAME := "player_save.json"
|
||||
const ARCHIVE_EXTENSION := ".nfsave"
|
||||
const BASIC_ROD_ID: StringName = &"basic_fishing_rod"
|
||||
|
|
@ -370,21 +370,21 @@ func _character_data_from_save(save_data: Dictionary) -> Dictionary:
|
|||
if typeof(save_data.get("character")) != TYPE_DICTIONARY:
|
||||
return {}
|
||||
var character: Dictionary = save_data["character"]
|
||||
var appearance_value: Variant = character.get("appearance")
|
||||
if (
|
||||
not NetworkProfilePreferencesType.validate_save_data(
|
||||
character.get("profile")
|
||||
)
|
||||
or typeof(character.get("appearance")) != TYPE_DICTIONARY
|
||||
or not CharacterCustomizationCatalog.validate_snapshot(
|
||||
character.get("appearance")
|
||||
)
|
||||
or typeof(appearance_value) != TYPE_DICTIONARY
|
||||
or not CharacterCustomizationCatalog.validate_snapshot(appearance_value)
|
||||
):
|
||||
return {}
|
||||
var appearance := CharacterCustomizationCatalog.sanitized_snapshot(
|
||||
appearance_value
|
||||
)
|
||||
return {
|
||||
"profile": (character["profile"] as Dictionary).duplicate(true),
|
||||
"appearance": CharacterCustomizationCatalog.sanitized_snapshot(
|
||||
character["appearance"]
|
||||
),
|
||||
"appearance": appearance,
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1610,6 +1610,8 @@ func _migrate_save(
|
|||
migrated = _migrate_version_10_to_11(migrated)
|
||||
11:
|
||||
migrated = _migrate_version_11_to_12(migrated)
|
||||
12:
|
||||
migrated = _migrate_version_12_to_13(migrated)
|
||||
_:
|
||||
return {}
|
||||
if migrated.is_empty():
|
||||
|
|
@ -1883,6 +1885,23 @@ func _migrate_version_11_to_12(data: Dictionary) -> Dictionary:
|
|||
return migrated
|
||||
|
||||
|
||||
func _migrate_version_12_to_13(data: Dictionary) -> Dictionary:
|
||||
var migrated: Dictionary = data.duplicate(true)
|
||||
if typeof(migrated.get("character")) == TYPE_DICTIONARY:
|
||||
var character: Dictionary = (
|
||||
migrated["character"] as Dictionary
|
||||
).duplicate(true)
|
||||
if typeof(character.get("appearance")) == TYPE_DICTIONARY:
|
||||
character["appearance"] = (
|
||||
CharacterCustomizationCatalog.sanitized_snapshot(
|
||||
character["appearance"]
|
||||
)
|
||||
)
|
||||
migrated["character"] = character
|
||||
migrated["save_version"] = 13
|
||||
return migrated
|
||||
|
||||
|
||||
func _mark_dirty() -> void:
|
||||
if (
|
||||
_is_restoring
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue