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

Synced all research tab buttons, fixes #290 #497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 4 additions & 0 deletions Source/Client/Syncing/Dict/SyncDictRimWorld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,10 @@ public static class SyncDictRimWorld
}
}, true // implicit
},
{
(ByteWriter _, ResearchManager _) => { },
(ByteReader _) => Find.ResearchManager
},
#endregion

#region Areas
Expand Down
9 changes: 9 additions & 0 deletions Source/Client/Syncing/Game/SyncMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ public static void Init()
SyncMethod.Register(typeof(AreaManager), nameof(AreaManager.TryMakeNewAllowed));
SyncMethod.Register(typeof(MainTabWindow_Research), nameof(MainTabWindow_Research.DoBeginResearch))
.TransformTarget(Serializer.SimpleReader(() => new MainTabWindow_Research()));
SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.StopProject));
// ResearchManager.SetCurrentProject changes the current project and is synced by
// MainTabWindow_Research.DoBeginResearch. It will still be called when selecting
// "Debug: Finish now". The issue with this is that when triggered by a player who
// can't execute debug-only methods it may change the current project to a research
// project which cannot be research due to prerequisites, allowing to research them.
SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.SetCurrentProject)).SetDebugOnly();
SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.FinishProject)).SetDebugOnly();
SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.ApplyTechprint)).SetDebugOnly();

SyncMethod.Register(typeof(DrugPolicyDatabase), nameof(DrugPolicyDatabase.MakeNewDrugPolicy));
SyncMethod.Register(typeof(DrugPolicyDatabase), nameof(DrugPolicyDatabase.TryDelete)).CancelIfAnyArgNull();
Expand Down
Loading