RynthSuite as of 2026-12-02 (internal 152e13d): release 2026.12.1.1
This commit is contained in:
parent
e8e4228d15
commit
6b5a9c7e99
65 changed files with 3920 additions and 237 deletions
|
|
@ -888,13 +888,21 @@ internal static class AfFileParser
|
|||
/// Drops empty nav routes (header only, 0 points) from the dict and
|
||||
/// blanks EmbedNav action data on rules whose referenced nav was empty.
|
||||
/// Non-empty embedded navs survive in the dict for runtime + save.
|
||||
/// A rule naming a route the file has NO block for keeps its name (2026-11-30): it is a
|
||||
/// NavProfiles route (MetaNavEmbedding copies it in on load). It used to be blanked whenever
|
||||
/// the meta had any block at all, so that rule loaded no route.
|
||||
/// </summary>
|
||||
private static void PruneEmbeddedNavs(List<MetaRule> rules,
|
||||
Dictionary<string, List<string>> navRoutes)
|
||||
{
|
||||
if (navRoutes.Count == 0) return;
|
||||
|
||||
var toRemove = new List<string>();
|
||||
// AfFileWriter writes an Embedded Nav Route with no route as "EmbedNav empty": no route,
|
||||
// unless the meta carries one of that name (the blanking below used to catch it).
|
||||
if (!navRoutes.ContainsKey(AfFileWriter.EmptyNavName))
|
||||
ClearPlaceholderRefs(rules);
|
||||
|
||||
var toRemove = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var kvp in navRoutes)
|
||||
{
|
||||
var content = kvp.Value;
|
||||
|
|
@ -904,23 +912,34 @@ internal static class AfFileParser
|
|||
foreach (string key in toRemove)
|
||||
navRoutes.Remove(key);
|
||||
|
||||
ClearMissingEmbedRefs(rules, navRoutes);
|
||||
if (toRemove.Count > 0) ClearEmptyEmbedRefs(rules, toRemove);
|
||||
}
|
||||
|
||||
private static void ClearMissingEmbedRefs(List<MetaRule> rules,
|
||||
Dictionary<string, List<string>> navRoutes)
|
||||
private static void ClearPlaceholderRefs(List<MetaRule> rules)
|
||||
{
|
||||
foreach (var rule in rules)
|
||||
{
|
||||
if (rule.Action == MetaActionType.EmbeddedNavRoute &&
|
||||
string.Equals(rule.ActionData, AfFileWriter.EmptyNavName, StringComparison.Ordinal))
|
||||
rule.ActionData = "";
|
||||
if (rule.ActionChildren != null)
|
||||
ClearPlaceholderRefs(rule.ActionChildren);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ClearEmptyEmbedRefs(List<MetaRule> rules, HashSet<string> emptyRoutes)
|
||||
{
|
||||
foreach (var rule in rules)
|
||||
{
|
||||
if (rule.Action == MetaActionType.EmbeddedNavRoute &&
|
||||
!string.IsNullOrEmpty(rule.ActionData) &&
|
||||
!navRoutes.ContainsKey(rule.ActionData))
|
||||
emptyRoutes.Contains(rule.ActionData))
|
||||
{
|
||||
rule.ActionData = "";
|
||||
}
|
||||
|
||||
if (rule.ActionChildren != null)
|
||||
ClearMissingEmbedRefs(rule.ActionChildren, navRoutes);
|
||||
ClearEmptyEmbedRefs(rule.ActionChildren, emptyRoutes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue