Skip to content

Commit 86fe126

Browse files
committed
Make component info files extensionless
1 parent dde21ac commit 86fe126

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

FlashpointInstaller/src/Common.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public static bool VerifyDestinationPath(string path)
247247
{
248248
if (alreadyExists || node.Name != "component") return;
249249

250-
if (File.Exists(Path.Combine(path, "Components", $"{new Component(node).ID}.txt")))
250+
if (File.Exists(Path.Combine(path, "Components", new Component(node).ID)))
251251
{
252252
alreadyExists = true;
253253
}

FlashpointInstaller/src/Forms/Operate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private void ExtractComponents()
145145
{
146146
string rootPath = FPM.Main.DestinationPath.Text;
147147
string infoPath = Path.Combine(FPM.Main.DestinationPath.Text, "Components");
148-
string infoFile = Path.Combine(infoPath, $"{workingComponent.ID}.txt");
148+
string infoFile = Path.Combine(infoPath, workingComponent.ID);
149149

150150
Directory.CreateDirectory(infoPath);
151151

FlashpointInstaller/src/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ static void Main(string[] args)
2929
catch
3030
{
3131
MessageBox.Show(
32-
"The component list could not be downloaded! Do you have an internet connection?",
32+
"The component list could not be downloaded!\n\n" +
33+
"Verify that your internet connection is working.",
3334
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error
3435
);
3536

FlashpointManager/src/Common.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Component : Category
2020
public string Path { get; set; }
2121
public string[] Depends { get; set; } = new string[] { };
2222

23-
public string InfoFile { get => System.IO.Path.Combine(FPM.SourcePath, "Components", $"{ID}.txt"); }
23+
public string InfoFile { get => System.IO.Path.Combine(FPM.SourcePath, "Components", ID); }
2424
public bool Downloaded { get => File.Exists(InfoFile); }
2525

2626
public Component(XmlNode node) : base(node)
@@ -355,7 +355,7 @@ public static void SyncManager(bool init = false)
355355

356356
foreach (string filePath in Directory.EnumerateFiles(Path.Combine(SourcePath, "Components")))
357357
{
358-
if (!filePath.EndsWith(".txt")) continue;
358+
if (Path.HasExtension(filePath)) continue;
359359

360360
string id = Path.GetFileName(filePath).Split('.')[0];
361361

FlashpointManager/src/Forms/Operate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ private void ExtractComponents()
176176
{
177177
string rootPath = Path.Combine(FPM.SourcePath, "Temp");
178178
string infoPath = Path.Combine(rootPath, "Components");
179-
string infoFile = Path.Combine(infoPath, $"{workingComponent.ID}.txt");
179+
string infoFile = Path.Combine(infoPath, workingComponent.ID);
180180

181181
Directory.CreateDirectory(infoPath);
182182

@@ -293,7 +293,7 @@ private void RemoveComponents()
293293
private void ApplyComponents()
294294
{
295295
string tempPath = Path.Combine(FPM.SourcePath, "Temp");
296-
string tempInfoFile = Path.Combine(tempPath, "Components", $"{workingComponent.ID}.txt");
296+
string tempInfoFile = Path.Combine(tempPath, "Components", workingComponent.ID);
297297
string[] infoText = File.ReadLines(tempInfoFile).Skip(1).ToArray();
298298

299299
foreach (string file in infoText)

0 commit comments

Comments
 (0)