Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register sync methods directly rather than using API #500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/Client/Syncing/Game/SyncMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ public static void Init()
.AllNotNull();

foreach (var method in methods)
MP.RegisterSyncMethod(method);
Sync.RegisterSyncMethod(method);

// This OnRenamed method will create a storage group, which needs to be synced.
// No other vanilla rename dialogs need syncing OnRenamed, but modded ones potentially could need it.
MP.RegisterSyncMethod(typeof(Dialog_RenameBuildingStorage_CreateNew), nameof(Dialog_RenameBuildingStorage_CreateNew.OnRenamed))
SyncMethod.Register(typeof(Dialog_RenameBuildingStorage_CreateNew), nameof(Dialog_RenameBuildingStorage_CreateNew.OnRenamed))
.TransformTarget(Serializer.New(
(Dialog_RenameBuildingStorage_CreateNew dialog) => dialog.building,
(IStorageGroupMember member) => new Dialog_RenameBuildingStorage_CreateNew(member)));
Expand Down
Loading