From e91ccd597995c97de2736c32fd227e839df64041 Mon Sep 17 00:00:00 2001 From: MOARdV Date: Wed, 7 Sep 2022 10:29:34 -0500 Subject: [PATCH] Add a little more verbose logging to track MAS_SUB_PAGE loads --- Properties/SharedAssemblyInfo.cs | 2 +- Source/MASLoader.cs | 7 +++++-- Source/MASPage.cs | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Properties/SharedAssemblyInfo.cs b/Properties/SharedAssemblyInfo.cs index c241b752..3c4157e3 100644 --- a/Properties/SharedAssemblyInfo.cs +++ b/Properties/SharedAssemblyInfo.cs @@ -11,5 +11,5 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.3.4.*")] +[assembly: AssemblyVersion("1.3.5.*")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Source/MASLoader.cs b/Source/MASLoader.cs index 4183d440..264e69cf 100644 --- a/Source/MASLoader.cs +++ b/Source/MASLoader.cs @@ -1,7 +1,7 @@ /***************************************************************************** * The MIT License (MIT) * - * Copyright (c) 2016-2020 MOARdV + * Copyright (c) 2016-2022 MOARdV * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -762,7 +762,7 @@ private void LoadAssets() AudioClip clip = GameDatabase.Instance.GetAudioClip(val.value); if (clip == null) { - Utility.LogError(this, "Could not load audio clip {0} for morse code '{1}", val.value, val.name); + Utility.LogError(this, "Could not load audio clip {0} for morse code '{1}'", val.value, val.name); } else { @@ -779,12 +779,15 @@ private void LoadAssets() string subPageName = string.Empty; if (subPageNode[subPageIdx].TryGetValue("name", ref subPageName)) { + subPageName = subPageName.Trim(); + List subPageNodes = new List(); ConfigNode[] nodes = subPageNode[subPageIdx].GetNodes(); subPageNodes.AddRange(nodes); subPages.Add(subPageName, subPageNodes); + Utility.LogMessage(this, "Found MAS_SUB_PAGE \"{0}\"", subPageName); } else { diff --git a/Source/MASPage.cs b/Source/MASPage.cs index 4ff26b80..e174ad72 100644 --- a/Source/MASPage.cs +++ b/Source/MASPage.cs @@ -1,7 +1,7 @@ /***************************************************************************** * The MIT License (MIT) * - * Copyright (c) 2016-2019 MOARdV + * Copyright (c) 2016-2022 MOARdV * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -366,6 +366,7 @@ private List ResolveSubPage(ConfigNode subPageNode, Vector2 fontSize { throw new ArgumentException("No 'name' field in SUB_PAGE found in MASPage " + name); } + subPageName = subPageName.Trim(); // Test for 'variable' string variableString = string.Empty; @@ -390,7 +391,7 @@ private List ResolveSubPage(ConfigNode subPageNode, Vector2 fontSize List subPageNodes; if (!MASLoader.subPages.TryGetValue(subPageName, out subPageNodes)) { - throw new ArgumentException("Unable to find MAS_SUB_PAGE '" + subPageName + "' for SUB_PAGE found in MASPage " + name); + throw new ArgumentException("Unable to find MAS_SUB_PAGE '" + subPageName + "' for a SUB_PAGE in MASPage " + name); } List newNodes = new List();