Skip to content

Commit

Permalink
Add a little more verbose logging to track MAS_SUB_PAGE loads
Browse files Browse the repository at this point in the history
  • Loading branch information
MOARdV committed Sep 7, 2022
1 parent 145c35c commit e91ccd5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Properties/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
7 changes: 5 additions & 2 deletions Source/MASLoader.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -779,12 +779,15 @@ private void LoadAssets()
string subPageName = string.Empty;
if (subPageNode[subPageIdx].TryGetValue("name", ref subPageName))
{
subPageName = subPageName.Trim();

List<ConfigNode> subPageNodes = new List<ConfigNode>();
ConfigNode[] nodes = subPageNode[subPageIdx].GetNodes();

subPageNodes.AddRange(nodes);

subPages.Add(subPageName, subPageNodes);
Utility.LogMessage(this, "Found MAS_SUB_PAGE \"{0}\"", subPageName);
}
else
{
Expand Down
5 changes: 3 additions & 2 deletions Source/MASPage.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -366,6 +366,7 @@ private List<ConfigNode> 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;
Expand All @@ -390,7 +391,7 @@ private List<ConfigNode> ResolveSubPage(ConfigNode subPageNode, Vector2 fontSize
List<ConfigNode> 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<ConfigNode> newNodes = new List<ConfigNode>();

Expand Down

0 comments on commit e91ccd5

Please sign in to comment.