You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PersistentIConfigNode : Moved some logging from errors to warnings as users keep pestering me about those instead of pestering the authors of the problematic config files, and attempted to make the logged messages a bit clearer.
Copy file name to clipboardExpand all lines: KSPCommunityFixes/Modding/PersistentIConfigNode.cs
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -182,8 +182,8 @@ public bool Read(Value value, object host, int attribIndex)
182
182
{
183
183
if(attribIndex>=attribs.Length)
184
184
{
185
-
Debug.LogError($"[KSPCommunityFixes] Tried to read value `{value.name} = {value.value}` for field {fieldInfo.Name}, index was{attribIndex}but only {attribs.Length} [Persistent] attributes on that field on host object of type {host.AssemblyQualifiedName()}."
186
-
+"\nThis is probably because the value was specified twice in the config. Making that assumption and clamping.");
185
+
Debug.LogWarning($"[KSPCF] Value `{value.name} = {value.value}` on object `{host.AssemblyQualifiedName()}` is the{attribIndex+1}nth value read, but only {attribs.Length} [Persistent] attributes are defined. "
186
+
+"The value will be applied, but it was likely incorrectly specified twice in the config");
187
187
attribIndex=0;
188
188
}
189
189
if(attribs[attribIndex].link)
@@ -213,8 +213,8 @@ public bool Read(ConfigNode node, object host, int attribIndex)
213
213
{
214
214
if(attribIndex>=attribs.Length)
215
215
{
216
-
Debug.LogError($"[KSPCommunityFixes] Tried to read node `{node.name}` for field {fieldInfo.Name}, index was{attribIndex}but only {attribs.Length} [Persistent] attributes on that field on host object of type {host.AssemblyQualifiedName()}."
217
-
+"\nThis is probably because the node was specified twice in the config. Making that assumption and clamping.");
216
+
Debug.LogWarning($"[KSPCF] Node `{node.name}` on object `{host.AssemblyQualifiedName()}` is the{attribIndex+1}nth node read, but only {attribs.Length} [Persistent] attributes are defined. "
217
+
+"The node will be applied, but it was likely incorrectly specified twice in the config");
218
218
attribIndex=0;
219
219
}
220
220
intvCount=node._values.values.Count;
@@ -580,7 +580,7 @@ public static object ReadValue(string value, DataType dataType, Type fieldType)
Debug.LogWarning($"[KSPCF] Couldn't parse value '{value}' for enum '{fieldType.Name}', default value '{defaultName}' will be used.\nValid values are {string.Join(", ",enumNames)}");
583
+
Debug.LogWarning($"[KSPCF] Couldn't parse value '{value}' for enum '{fieldType.Name}', default value '{defaultName}' will be used. Valid values are {string.Join(", ",enumNames)}");
584
584
returnnull;
585
585
}
586
586
caseDataType.ValueVector2:
@@ -956,7 +956,7 @@ public static TypeCache CreateAndAdd(Type t)
956
956
vartc=newTypeCache(t);
957
957
if(tc._fields.Count==0)
958
958
{
959
-
Debug.LogWarning($"[KSPCommunityFixes]: No Persistent fields on object of type {t.AssemblyQualifiedName()}, adding as null to TypeCache. That object likely shouldn't implement the IConfigNode interface.");
959
+
Debug.LogWarning($"[KSPCF] No Persistent fields on object of type {t.AssemblyQualifiedName()}, adding as null to TypeCache. That object likely shouldn't implement the IConfigNode interface.");
0 commit comments