From 387ba964fb4e7c200b668289e62681efddcb2482 Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Wed, 27 May 2020 15:49:17 -0700 Subject: [PATCH] Documentation and logging --- .../MaterialModifiers/MaterialPropertyCollection.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs b/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs index 3ba9228..6b455d6 100644 --- a/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs +++ b/Source/ConformalDecals/MaterialModifiers/MaterialPropertyCollection.cs @@ -12,7 +12,7 @@ namespace ConformalDecals.MaterialModifiers { private List _materialModifiers; private List _texturePropertyMaterialModifiers; - public MaterialPropertyCollection(ConfigNode node) { + public MaterialPropertyCollection(ConfigNode node, PartModule module) { _materialModifiers = new List(); _texturePropertyMaterialModifiers = new List(); @@ -64,7 +64,9 @@ namespace ConformalDecals.MaterialModifiers { MainTextureMaterial = textureModifier; } else { - Debug.LogWarning( + // multiple textures have been marked as main! + // non-fatal issue, ignore this one and keep using current main texture + module.LogWarning( $"Material texture property {textureModifier.TextureUrl} is marked as main, but material already has a main texture! \n" + $"Defaulting to {MainTextureMaterial.TextureUrl}"); } @@ -81,7 +83,9 @@ namespace ConformalDecals.MaterialModifiers { } catch (Exception e) { - Debug.LogError(e.Message); + // Catch exception from parsing current material property + // And print it to the log as an Error + module.LogError(e.Message); } } }