Skip to content

Commit

Permalink
Clear read-only list on mod installation
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperbx authored Aug 25, 2019
1 parent 7cd630c commit 2328afa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
26 changes: 7 additions & 19 deletions Sonic '06 Mod Manager/ModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace Sonic_06_Mod_Manager
{
public partial class ModManager : Form
{
public static string versionNumber = "Version 1.12";
public static string versionNumber = "Version 1.13";
public static string updateState;
public static string serverStatus;
public static string installState;
Expand Down Expand Up @@ -418,6 +418,7 @@ private void RefreshMods()
foreach (string mod in modArray)
{
var modName = mod.Remove(0, Path.GetDirectoryName(mod).Length);
var getPlatform = File.ReadAllText($"{Path.Combine(modsPath, modName)}\\mod.ini");
modName = modName.Replace("\\", "");
if (Properties.Settings.Default.filter == 0)
{
Expand All @@ -427,7 +428,6 @@ private void RefreshMods()
{
if (File.Exists($"{Path.Combine(modsPath, modName)}\\mod.ini"))
{
var getPlatform = File.ReadAllText($"{Path.Combine(modsPath, modName)}\\mod.ini");
if (getPlatform.Contains("Platform=\"Xbox 360\""))
{
modList.Items.Add(modName);
Expand All @@ -438,7 +438,6 @@ private void RefreshMods()
{
if (File.Exists($"{Path.Combine(modsPath, modName)}\\mod.ini"))
{
var getPlatform = File.ReadAllText($"{Path.Combine(modsPath, modName)}\\mod.ini");
if (getPlatform.Contains("Platform=\"PlayStation 3\""))
{
modList.Items.Add(modName);
Expand Down Expand Up @@ -1731,6 +1730,7 @@ private void CopyMods()
string entryValue;
while ((line = configFile.ReadLine()) != null)
{
filesToCopyList.Clear();
if (line.Contains("Read-only=\""))
{
entryValue = line.Substring(line.IndexOf("=") + 2);
Expand Down Expand Up @@ -1770,6 +1770,7 @@ private void CopyMods()
{
if (string.Join(" ", filesToCopyList.ToArray()).Contains(Path.GetFileName(mod)))
{
Console.WriteLine(string.Join(" ", filesToCopyList.ToArray()).Contains(Path.GetFileName(mod)));
Console.WriteLine("Copying " + mod);

if (File.Exists(origArcPath))
Expand Down Expand Up @@ -3083,24 +3084,11 @@ private void Radio_PlayStation_CheckedChanged(object sender, EventArgs e)
private void Btn_SaveMods_Click(object sender, EventArgs e)
{
checkedModsList.Clear();
if (combo_Priority.SelectedIndex == 0)
for (int i = 0; i < modList.Items.Count; i++)
{
for (int i = modList.Items.Count - 1; i >= 0; i--)
if (modList.GetItemChecked(i))
{
if (modList.GetItemChecked(i))
{
checkedModsList.Add(modList.Items[i].ToString());
}
}
}
else if (combo_Priority.SelectedIndex == 1)
{
for (int i = 0; i < modList.Items.Count; i++)
{
if (modList.GetItemChecked(i))
{
checkedModsList.Add(modList.Items[i].ToString());
}
checkedModsList.Add(modList.Items[i].ToString());
}
}
checkedModsList.ForEach(i => Console.Write("{0}\n", i));
Expand Down
3 changes: 3 additions & 0 deletions Sonic '06 Mod Manager/ModManager.resx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
<metadata name="tm_CheckTab.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>308, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>60</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAkAEBAAAAEAIABoBAAAlgAAABgYAAABACAAiAkAAP4EAAAgIAAAAQAgAKgQAACGDgAAMDAAAAEA
Expand Down
1 change: 1 addition & 0 deletions Sonic '06 Mod Manager/ModStatus.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sonic '06 Mod Manager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.1.2")]
[assembly: AssemblyFileVersion("1.1.3.0")]

0 comments on commit 2328afa

Please sign in to comment.