From afe91dc23fe60e1e1d62862326248800d8c175fd Mon Sep 17 00:00:00 2001
From: lc-crowdin <152034210+lc-crowdin@users.noreply.github.com>
Date: Thu, 29 Feb 2024 16:48:49 -0800
Subject: [PATCH] New translations v2-migration.md (Thai)
---
.../th_TH/docs/dev/apis/csync/v2-migration.md | 48 +++++++++++++++++++
1 file changed, 48 insertions(+)
create mode 100644 translations/th_TH/docs/dev/apis/csync/v2-migration.md
diff --git a/translations/th_TH/docs/dev/apis/csync/v2-migration.md b/translations/th_TH/docs/dev/apis/csync/v2-migration.md
new file mode 100644
index 00000000000..49bbcbe41f6
--- /dev/null
+++ b/translations/th_TH/docs/dev/apis/csync/v2-migration.md
@@ -0,0 +1,48 @@
+---
+prev: false
+next: false
+description: Guide to migrating from CSync v1 to v2.
+---
+
+# v2.0.0 Migration Guide
+
+The boilerplate from previous versions is now redundant as **CSync** will handle things itself.
+This means Steps 3 and 4 of the outdated guide are no longer necessary.
+
+To begin updating, replace `SyncedInstance` with `SyncedConfig`.
+
+```cs
+MyConfig : SyncedInstance // [!code --]
+MyConfig : SyncedConfig // [!code ++]
+```
+
+We will now register our config with **CSync** through `ConfigManager` instead of `InitInstance(this)`.
+Notice how we specify our mod's GUID through `base()` to ensure it doesn't overlap with others behind the scenes.
+
+```cs
+public ExampleConfig(ConfigFile cfg) : base("MyModName") {
+ InitInstance(this); // [!code --]
+ ConfigManager.Register(this); // [!code ++]
+
+ EXAMPLE_VAR = cfg.BindSyncedEntry("General", "bExampleVar", true, "This is an example variable that will be synced.");
+}
+```
+
+**We are all done!** If you previously had join/leave patches and request/receiver methods, you should remove these to prevent any possible issues.
+
+**OPTIONAL**
+This update also provides the `SyncComplete` event that you can hook into if desired.
+
+```cs
+public ExampleConfig(ConfigFile cfg) : base("MyModName") {
+ ConfigManager.Register(this);
+
+ EXAMPLE_VAR = cfg.BindSyncedEntry("General", "bExampleVar", true, "This is an example variable that will be synced.");
+
+ SyncComplete += DoSomethingAfterSync; // [!code ++]
+}
+
+public void DoSomethingAfterSync(object sender, EventArgs args) { // [!code ++]
+ // Run some logic here // [!code ++]
+} // [!code ++]
+```