Skip to content

Commit 9c36c77

Browse files
committed
more steam sync options/logic
1 parent cae88c6 commit 9c36c77

File tree

12 files changed

+439
-180
lines changed

12 files changed

+439
-180
lines changed

Assemblies/ModSwitch.dll

5.5 KB
Binary file not shown.

Languages/English/Keyed/Keyed.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,34 @@
5454

5555
<ModSwitch.Error.InvalidChars>Contains invalid characters</ModSwitch.Error.InvalidChars>
5656
<ModSwitch.Error.TargetExists>Target already exists</ModSwitch.Error.TargetExists>
57+
<ModSwitch.Error.NotValid>Not a valid mod path</ModSwitch.Error.NotValid>
5758

5859
<ModSwitch.CopyLocal.Result.Copy>Copied mod {0} to {1}.</ModSwitch.CopyLocal.Result.Copy>>
5960
<ModSwitch.CopyLocal.Result.Settings>Copied {0} settings file(s).</ModSwitch.CopyLocal.Result.Settings>>
6061
<ModSwitch.CopyLocal.Result.Skipped>Skipped copying settings.</ModSwitch.CopyLocal.Result.Skipped>>
62+
<ModSwitch.CopyLocal.Result.TimestampUnknown><![CDATA[<b>Warning</b>: Last upload time of the Steam original is unknown - sync support will be degraded.]]></ModSwitch.CopyLocal.Result.TimestampUnknown>
63+
6164

6265
<ModSwitch.MoveTo>Move to...</ModSwitch.MoveTo>
6366
<ModSwitch.MoveTo.Top>Top</ModSwitch.MoveTo.Top>
6467
<ModSwitch.MoveTo.Bottom>Bottom</ModSwitch.MoveTo.Bottom>
6568

69+
<ModSwitch.OpenFolder>Open folder</ModSwitch.OpenFolder>
70+
71+
<ModSwitch.Sync>Sync with Steam original</ModSwitch.Sync>
72+
<ModSwitch.Sync.Identical>identical</ModSwitch.Sync.Identical>
73+
<ModSwitch.Sync.Message><![CDATA[The mod {0} will be updated to the current Steam version.
74+
(Last) copied from Steam at an upload date of: {1}
75+
Current upload date on Steam: {2}
76+
77+
Do you want to keep your existing settings from the local copy or replace them with the version of Steam?]]></ModSwitch.Sync.Message>
78+
<ModSwitch.Sync.UnknownTimestamp>Unknown</ModSwitch.Sync.UnknownTimestamp>
79+
<ModSwitch.Sync.Choice.KeepSettings>Keep existing</ModSwitch.Sync.Choice.KeepSettings>
80+
<ModSwitch.Sync.Choice.CopySteam>Replace with Steam</ModSwitch.Sync.Choice.CopySteam>
81+
82+
<ModSwitch.Search.Watermark>Search...</ModSwitch.Search.Watermark>
83+
84+
<ModSwitch.Source.SteamCopy>Local Steam copy</ModSwitch.Source.SteamCopy>
85+
6686

6787
</LanguageData>

Source/ModSwitch/LanguageKeys.Generated.cs

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Diagnostics.CodeAnalysis;
1212

1313
namespace DoctorVanGogh.ModSwitch {
14-
[GeneratedCode("DefGenerator.tt","0.1")]
14+
[GeneratedCode("DefGenerator.tt","0.2")]
1515
[SuppressMessage("ReSharper", "InconsistentNaming")]
1616
[SuppressMessage("ReSharper", "UnusedMember.Global")]
1717
public static partial class LanguageKeys {
@@ -77,7 +77,7 @@ public static class @keyed {
7777
/// </summary>
7878
public const string @ModSwitch_MissingMods_Choice_Ignore_Tip = "ModSwitch.MissingMods.Choice.Ignore.Tip";
7979
/// <summary>
80-
/// Get's the translation key for '<em>Cancel & Open workshop</em>'
80+
/// Get's the translation key for '<em>Cancel &amp; Open workshop</em>'
8181
/// </summary>
8282
public const string @ModSwitch_MissingMods_Choice_Workshop = "ModSwitch.MissingMods.Choice.Workshop";
8383
/// <summary>
@@ -161,11 +161,11 @@ public static class @keyed {
161161
/// </summary>
162162
public const string @ModSwitch_ExistingSettings = "ModSwitch.ExistingSettings";
163163
/// <summary>
164-
/// Get's the translation key for '<em>Overwrite.</em>'
164+
/// Get's the translation key for '<em>Overwrite</em>'
165165
/// </summary>
166166
public const string @ModSwitch_ExistingSettings_Choice_Overwrite = "ModSwitch.ExistingSettings.Choice.Overwrite";
167167
/// <summary>
168-
/// Get's the translation key for '<em>Skip.</em>'
168+
/// Get's the translation key for '<em>Skip</em>'
169169
/// </summary>
170170
public const string @ModSwitch_ExistingSettings_Choice_Skip = "ModSwitch.ExistingSettings.Choice.Skip";
171171
/// <summary>
@@ -177,6 +177,10 @@ public static class @keyed {
177177
/// </summary>
178178
public const string @ModSwitch_Error_TargetExists = "ModSwitch.Error.TargetExists";
179179
/// <summary>
180+
/// Get's the translation key for '<em>Not a valid mod path</em>'
181+
/// </summary>
182+
public const string @ModSwitch_Error_NotValid = "ModSwitch.Error.NotValid";
183+
/// <summary>
180184
/// Get's the translation key for '<em>Copied mod {0} to {1}.</em>'
181185
/// </summary>
182186
public const string @ModSwitch_CopyLocal_Result_Copy = "ModSwitch.CopyLocal.Result.Copy";
@@ -189,6 +193,10 @@ public static class @keyed {
189193
/// </summary>
190194
public const string @ModSwitch_CopyLocal_Result_Skipped = "ModSwitch.CopyLocal.Result.Skipped";
191195
/// <summary>
196+
/// Get's the translation key for '<em>&lt;b&gt;Warning&lt;/b&gt;: Last upload time of the Steam original is unknown - sync support will be degraded.</em>'
197+
/// </summary>
198+
public const string @ModSwitch_CopyLocal_Result_TimestampUnknown = "ModSwitch.CopyLocal.Result.TimestampUnknown";
199+
/// <summary>
192200
/// Get's the translation key for '<em>Move to...</em>'
193201
/// </summary>
194202
public const string @ModSwitch_MoveTo = "ModSwitch.MoveTo";
@@ -200,6 +208,42 @@ public static class @keyed {
200208
/// Get's the translation key for '<em>Bottom</em>'
201209
/// </summary>
202210
public const string @ModSwitch_MoveTo_Bottom = "ModSwitch.MoveTo.Bottom";
211+
/// <summary>
212+
/// Get's the translation key for '<em>Open folder</em>'
213+
/// </summary>
214+
public const string @ModSwitch_OpenFolder = "ModSwitch.OpenFolder";
215+
/// <summary>
216+
/// Get's the translation key for '<em>Sync with Steam original</em>'
217+
/// </summary>
218+
public const string @ModSwitch_Sync = "ModSwitch.Sync";
219+
/// <summary>
220+
/// Get's the translation key for '<em>identical</em>'
221+
/// </summary>
222+
public const string @ModSwitch_Sync_Identical = "ModSwitch.Sync.Identical";
223+
/// <summary>
224+
/// Get's the translation key for '<em>The mod {0} will be updated to the current Steam version.<br /> (Last) copied from Steam at an upload date of: {1}<br /> Current upload date on Steam: {2}<br /><br />Do you want to keep your existing settings from the local copy or replace them with the version of Steam?</em>'
225+
/// </summary>
226+
public const string @ModSwitch_Sync_Message = "ModSwitch.Sync.Message";
227+
/// <summary>
228+
/// Get's the translation key for '<em>Unknown</em>'
229+
/// </summary>
230+
public const string @ModSwitch_Sync_UnknownTimestamp = "ModSwitch.Sync.UnknownTimestamp";
231+
/// <summary>
232+
/// Get's the translation key for '<em>Keep existing</em>'
233+
/// </summary>
234+
public const string @ModSwitch_Sync_Choice_KeepSettings = "ModSwitch.Sync.Choice.KeepSettings";
235+
/// <summary>
236+
/// Get's the translation key for '<em>Replace with Steam</em>'
237+
/// </summary>
238+
public const string @ModSwitch_Sync_Choice_CopySteam = "ModSwitch.Sync.Choice.CopySteam";
239+
/// <summary>
240+
/// Get's the translation key for '<em>Search...</em>'
241+
/// </summary>
242+
public const string @ModSwitch_Search_Watermark = "ModSwitch.Search.Watermark";
243+
/// <summary>
244+
/// Get's the translation key for '<em>Local Steam copy</em>'
245+
/// </summary>
246+
public const string @ModSwitch_Source_SteamCopy = "ModSwitch.Source.SteamCopy";
203247
}
204248
}
205249
}

Source/ModSwitch/LanguageKeys.Generated.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using System.Diagnostics.CodeAnalysis;
3737
namespace <#= _namespace #> {
3838
<# }
3939
#>
40-
[GeneratedCode("DefGenerator.tt","0.1")]
40+
[GeneratedCode("DefGenerator.tt","0.2")]
4141
[SuppressMessage("ReSharper", "InconsistentNaming")]
4242
[SuppressMessage("ReSharper", "UnusedMember.Global")]
4343
public static partial class LanguageKeys {
@@ -52,7 +52,7 @@ namespace <#= _namespace #> {
5252
foreach (XmlNode element in doc.SelectNodes(@"/*/*")) {
5353
#>
5454
/// <summary>
55-
/// Get's the translation key for '<em><#= element.InnerText ?? String.Empty#></em>'
55+
/// Get's the translation key for '<em><#= System.Security.SecurityElement.Escape(element.InnerText ?? String.Empty).Replace("\r\n", "<br />") #></em>'
5656
/// </summary>
5757
public const string <#= SanitizeIdentifier(element.Name) #> = "<#= element.Name #>";
5858
<#

Source/ModSwitch/ModSwitch.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Harmony;
77
using UnityEngine;
88
using Verse;
9+
using Verse.Steam;
910

1011
namespace DoctorVanGogh.ModSwitch {
1112

@@ -24,7 +25,7 @@ public ModSwitch(ModContentPack content) : base(content) {
2425

2526
Log.Message("Initialized ModSwitch patches...");
2627

27-
_settings = GetSettings<Settings>();
28+
_settings = GetSettings<Settings>();
2829
}
2930

3031
public override string SettingsCategory() {

Source/ModSwitch/Model/ModAttributes.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ class ModAttributes : IExposable {
1919
/// <summary>
2020
/// For mods copied from a steam source: last uploaded TS at time of copy
2121
/// </summary>
22-
public uint? SteamOriginTS;
22+
// HACK: shoulds be <c>uint</c>, but RW can't deserialize uints....
23+
public long? SteamOriginTS;
2324

2425
/// <summary>
2526
/// For steam mods: last uploaded TS
2627
/// </summary>
2728
/// <remarks>NOT SERIALIZED</remarks>
28-
public uint? LastUpdateTS;
29+
// HACK: shoulds be <c>uint</c>, but RW can't deserialize uints....
30+
public long? LastUpdateTS;
2931

3032
public void ExposeData() {
3133
Scribe_Values.Look(ref Key, @"key");

Source/ModSwitch/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
[assembly: System.Reflection.AssemblyCopyright("Copyright © DoctorVanGogh 2017")]
1313
[assembly: System.Runtime.InteropServices.ComVisible(false)]
1414
[assembly: System.Runtime.InteropServices.Guid("ab2e8e89-3d1d-4e36-a0ae-489b6ebc84a6")]
15-
[assembly: System.Reflection.AssemblyVersion("1.2.0.30")]
15+
[assembly: System.Reflection.AssemblyVersion("1.2.0.66")]
1616

1717

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.0.30
1+
1.2.0.66

0 commit comments

Comments
 (0)