Skip to content

Commit 7145ea0

Browse files
authored
Fixed CopyMods (unfinished FTP) & ModCreate UI
1 parent 48c3938 commit 7145ea0

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

Sonic '06 Mod Manager/ModCreate.Designer.cs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sonic '06 Mod Manager/ModCreate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private void CreateButton_Click(object sender, EventArgs e)
7171
if (modAuthor != "") { modINI.WriteLine("Author=\"" + modAuthor + "\""); }
7272
modINI.WriteLine("Platform=\"" + combo_System.Text + "\"");
7373
modINI.WriteLine("Merge=\"" + modMerge.ToString() + "\"");
74-
if (modCopy != "") { modINI.WriteLine("Copy=\"" + modCopy + "\""); }
74+
if (modCopy != "") { modINI.WriteLine("Read-only=\"" + modCopy + "\""); }
7575
modINI.Close();
7676
}
7777
}
@@ -95,7 +95,7 @@ private void Check_Merge_CheckedChanged(object sender, EventArgs e)
9595
modMerge = false;
9696
lbl_Copy.Enabled = false;
9797
modCopyBox.Enabled = false;
98-
readonlyButtonHelp.Enabled = true;
98+
readonlyButtonHelp.Enabled = false;
9999
}
100100
}
101101

Sonic '06 Mod Manager/ModManager.cs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ private void CopyMods()
14641464
string entryValue;
14651465
while ((line = configFile.ReadLine()) != null)
14661466
{
1467-
if (line.Contains("Copy=\""))
1467+
if (line.Contains("Read-only=\""))
14681468
{
14691469
entryValue = line.Substring(line.IndexOf("=") + 2);
14701470
entryValue = entryValue.Remove(entryValue.Length - 1);
@@ -1496,33 +1496,16 @@ private void CopyMods()
14961496
{
14971497
if (File.ReadAllLines($"{modsPath}\\{item}\\mod.ini").Contains("Merge=\"True\""))
14981498
{
1499-
if (mod.EndsWith(".arc"))
1499+
if (Path.GetExtension(mod) == ".arc")
15001500
{
1501-
if (combo_Priority.SelectedIndex == 0)
1501+
if (string.Join(" ", filesToCopyList.ToArray()).Contains(Path.GetFileName(mod)))
15021502
{
1503-
foreach (var modFile in filesToCopyList)
1504-
{
1505-
if (modFile == Path.GetFileName(mod))
1506-
{
1507-
Console.WriteLine("Copying " + mod);
1508-
if (!File.Exists(targetArcPath)) File.Move(origArcPath, targetArcPath);
1509-
File.Copy(mod, origArcPath, true);
1510-
}
1511-
}
1512-
Console.WriteLine("Merging " + mod);
1513-
MergeARCs(origArcPath, mod, origArcPath, false, string.Empty);
1503+
Console.WriteLine("Copying " + mod);
1504+
if (!File.Exists(targetArcPath)) File.Move(origArcPath, targetArcPath);
1505+
File.Copy(mod, origArcPath, true);
15141506
}
1515-
else if (combo_Priority.SelectedIndex == 1)
1507+
else
15161508
{
1517-
foreach (var modFile in filesToCopyList)
1518-
{
1519-
if (modFile == Path.GetFileName(mod))
1520-
{
1521-
Console.WriteLine("Copying " + mod);
1522-
if (!File.Exists(targetArcPath)) File.Move(origArcPath, targetArcPath);
1523-
File.Copy(mod, origArcPath, true);
1524-
}
1525-
}
15261509
Console.WriteLine("Merging " + mod);
15271510
MergeARCs(origArcPath, mod, origArcPath, false, string.Empty);
15281511
}

0 commit comments

Comments
 (0)