Skip to content

Commit a3eb4f9

Browse files
committed
Spore ModAPI Easy Uninstaller: add mod version to UninstallerForm
1 parent c6b4d93 commit a3eb4f9

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

Spore ModAPI Easy Uninstaller/UninstallerForm.Designer.cs

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

Spore ModAPI Easy Uninstaller/UninstallerForm.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ public void AddMods(HashSet<ModConfiguration> mods)
4646
// add mods
4747
foreach (var mod in mods)
4848
{
49+
string versionString = "";
50+
if (mod.Version != null)
51+
{
52+
versionString = mod.Version.ToString();
53+
}
4954

50-
int index = this.dataGridView1.Rows.Add(new object[] { false, mod, mod.DisplayName });
55+
int index = this.dataGridView1.Rows.Add(new object[] { false, mod, mod.DisplayName, versionString });
5156

5257
if (GetConfiguratorPath(index) != null)
53-
this.dataGridView1.Rows[index].Cells[3].ReadOnly = true;
58+
this.dataGridView1.Rows[index].Cells[4].ReadOnly = true;
5459
}
5560

5661
// sort mods
@@ -67,7 +72,7 @@ private void btnCancel_Click(object sender, EventArgs e)
6772

6873
private void dataGridView_CellDoubleClick(Object sender, DataGridViewCellEventArgs e)
6974
{
70-
if (e.RowIndex != 0 && e.ColumnIndex == 3 && GetConfiguratorPath(e.RowIndex) != null)
75+
if (e.RowIndex != 0 && e.ColumnIndex == 4 && GetConfiguratorPath(e.RowIndex) != null)
7176
{
7277
// execute configurator and close uninstaller
7378
ExecuteConfigurator(GetModConfiguration(e.RowIndex));
@@ -80,7 +85,7 @@ private void dataGridView_CellDoubleClick(Object sender, DataGridViewCellEventAr
8085

8186
private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
8287
{
83-
if (e.RowIndex != 0 && e.ColumnIndex == 3 && GetConfiguratorPath(e.RowIndex) != null)
88+
if (e.RowIndex != 0 && e.ColumnIndex == 4 && GetConfiguratorPath(e.RowIndex) != null)
8489
{
8590
// execute configurator and close uninstaller
8691
ExecuteConfigurator(GetModConfiguration(e.RowIndex));
@@ -153,7 +158,7 @@ private void btnUninstall_Click(object sender, EventArgs e)
153158

154159
private void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
155160
{
156-
if (e.ColumnIndex == 3 && this.dataGridView1.SelectedRows.Count > 0)
161+
if (e.ColumnIndex == 4 && this.dataGridView1.SelectedRows.Count > 0)
157162
{
158163
if (e.RowIndex > 0)
159164
{

Spore ModAPI Easy Uninstaller/UninstallerForm.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@
126126
<metadata name="ModDisplayNames.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
127127
<value>True</value>
128128
</metadata>
129+
<metadata name="ModVersions.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
130+
<value>True</value>
131+
</metadata>
129132
<metadata name="ModConfiguration.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
130133
<value>True</value>
131134
</metadata>

0 commit comments

Comments
 (0)