Skip to content

Commit

Permalink
Climb an entire tree for one half-ripe blackberry
Browse files Browse the repository at this point in the history
  • Loading branch information
FenPhoenix committed Aug 20, 2023
1 parent f9e2805 commit 4ae6dd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
11 changes: 5 additions & 6 deletions AngelLoader/FMScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ void ReportProgress(FMScanner.ProgressReport pr) => Core.View.SetProgressBoxStat
pr.FMsTotal +
LText.ProgressBox.ReportScanningLast))),
message2:
// @MEM: We could get really clever and not have to do this work if we cached stuff from earlier
pr.FMName.ExtIsArchive()
? pr.FMName.GetFileNameFast()
: pr.FMName.GetDirNameFast(),
pr.FMName,
percent: pr.Percent
);
Expand Down Expand Up @@ -162,7 +159,8 @@ static void ShowProgressBox(bool suppressShow)
forceFullScan: scanFullIfNew && !fm.MarkedScanned,
cachePath: fm.Archive.ExtIs7z()
? Path.Combine(Paths.FMsCache, fm.InstalledDir)
: ""
: "",
fm.Archive
));
}
else if (fm.Game.ConvertsToKnownAndSupported(out GameIndex gameIndex))
Expand All @@ -174,7 +172,8 @@ static void ShowProgressBox(bool suppressShow)
fms.Add(new FMScanner.FMToScan
(
path: Path.Combine(fmInstalledPath, fm.InstalledDir),
forceFullScan: scanFullIfNew && !fm.MarkedScanned
forceFullScan: scanFullIfNew && !fm.MarkedScanned,
fm.InstalledDir
));
}
}
Expand Down
8 changes: 6 additions & 2 deletions FMScanner/Core/FMData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,22 @@ public sealed class FMToScan
/// </summary>
public readonly string CachePath;

public FMToScan(string path, bool forceFullScan, string cachePath)
public readonly string DisplayName;

public FMToScan(string path, bool forceFullScan, string cachePath, string displayName)
{
Path = path;
ForceFullScan = forceFullScan;
CachePath = cachePath;
DisplayName = displayName;
}

public FMToScan(string path, bool forceFullScan)
public FMToScan(string path, bool forceFullScan, string displayName)
{
Path = path;
ForceFullScan = forceFullScan;
CachePath = "";
DisplayName = displayName;
}
}

Expand Down
2 changes: 1 addition & 1 deletion FMScanner/Core/Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ private List<ScannedFMDataAndError>

if (progress != null)
{
progressReport.FMName = missions[i].Path;
progressReport.FMName = missions[i].DisplayName;
progressReport.FMNumber = i + 1;
progressReport.FMsTotal = missions.Count;
progressReport.Percent = GetPercentFromValue_Int(missions.Count == 1 ? 0 : i + 1, missions.Count);
Expand Down

0 comments on commit 4ae6dd4

Please sign in to comment.