Skip to content

Commit

Permalink
Serialize UniqueId properties + support setting default property valu…
Browse files Browse the repository at this point in the history
…e in patches (#437)
  • Loading branch information
Dekkonot authored Aug 16, 2024
1 parent 2b32623 commit 99b73cc
Show file tree
Hide file tree
Showing 13 changed files with 9,351 additions and 609 deletions.
19 changes: 11 additions & 8 deletions patches/instance.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
Change:
Instance:
# UniqueId properties might be random everytime Studio saves a place file
# and don't have a use right now outside of packages, which Rojo doesn't
# account for anyway. They generate diff noise, so we shouldn't serialize
# them until we have to.
# UniqueId is randomized per Studio load, but that's not a useful default.
# Rather than getting the default from Studio, we manually specify it here
# instead. The all-zero UniqueId can appear in files multiple times so it's
# the only default value that makes sense.
UniqueId:
Serialization:
Type: DoesNotSerialize
DefaultValue:
UniqueId: "00000000000000000000000000000000"
HistoryId:
Serialization:
Type: DoesNotSerialize
DefaultValue:
UniqueId: "00000000000000000000000000000000"

archivable:
AliasFor: Archivable
Archivable:
Serialization:
Type: SerializesAs
As: archivable
# Archivable has no default value recorded but we need it to be true
DefaultValue:
Bool: true

# Attributes serialize as a BinaryString with a strange name, but we want to
# refer to them with a different name.
Expand Down
9 changes: 6 additions & 3 deletions patches/lua-source-container.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Change:
LuaSourceContainer:
# ScriptGuid is randomly generated everytime a script is saved from Studio
# and it makes no sense for us to write it ourselves at this moment.
# which means that its default would change every time a database was
# generated. To get around this, we need to override the default. Roblox
# generates a new ScriptGuid if the one in a file is an empty string, so
# setting the default to be an empty string is a reasonable default.
ScriptGuid:
Serialization:
Type: DoesNotSerialize
DefaultValue:
String: ""

Script:
Source:
Expand Down
Loading

0 comments on commit 99b73cc

Please sign in to comment.