Skip to content

Commit

Permalink
add porting option flag for auto updatemapfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jaron780 committed May 1, 2024
1 parent d4285a4 commit cd1ca42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion TagTool/Commands/Porting/PortTagCommand.PortingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,12 @@ public enum PortingFlags

[PortingFlagDescription("Auto rescale gui during porting")]
AutoRescaleGui = 1 << 20,

[PortingFlagDescription("Auto Update map files")]
UpdateMapFiles = 1 << 21,

// No [PortingFlagDescription] here means we'll flag names as the description.
Default = Print | Recursive | Merge | Scripts | Squads | ForgePalette | Elites | Audio | Dialogue | MatchShaders | GenerateShaders
Default = Print | Recursive | Merge | Scripts | Squads | ForgePalette | Elites | Audio | Dialogue | MatchShaders | GenerateShaders | UpdateMapFiles
}

/// <summary>
Expand Down
9 changes: 6 additions & 3 deletions TagTool/Commands/Porting/PortTagCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,10 +1256,13 @@ public CachedTag ConvertTagInternal(Stream cacheStream, Stream blamCacheStream,
}
}

_deferredActions.Add(() =>
if (Flags.HasFlag(PortingFlags.UpdateMapFiles))
{
new UpdateMapFilesCommand(CacheContext).Execute(new List<string> { });
});
_deferredActions.Add(() =>
{
new UpdateMapFilesCommand(CacheContext).Execute(new List<string> { });
});
}
}
break;

Expand Down

0 comments on commit cd1ca42

Please sign in to comment.