Skip to content
This repository was archived by the owner on Aug 4, 2020. It is now read-only.

Commit d193f48

Browse files
committed
Fixed mod info form, list version selection
1 parent 7f79a39 commit d193f48

30 files changed

+460
-301
lines changed

BeatMapInstaller/obj/Debug/build.force

Whitespace-only changes.

BeatModder/BeatModder.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
</ItemGroup>
156156
<ItemGroup>
157157
<None Include="Resources\play.ico" />
158+
<None Include="Resources\Libraries.ico" />
158159
<Content Include="Resources\refresh.ico" />
159160
<Content Include="Resources\saber.ico" />
160161
<Content Include="Resources\saber2.ico" />

BeatModder/FormFindFile.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ private void ButtonBrowse_Click(object sender, EventArgs e)
133133

134134
if (fbd.ShowDialog() == DialogResult.OK)
135135
{
136-
if (!File.Exists(Path.Combine(fbd.SelectedPath, fileToFind)))
136+
string file = Path.Combine(fbd.SelectedPath, fileToFind);
137+
if (!File.Exists(file))
137138
{
138139
DialogResult result = MessageBox.Show($"The required file '{ fileToFind }' was not found in the selected folder.\n\n" +
139140
$"Press Retry to specify the folder containing '{ fileToFind }'.\n" +
@@ -145,7 +146,7 @@ private void ButtonBrowse_Click(object sender, EventArgs e)
145146
return;
146147
}
147148

148-
SelectedFile = fbd.SelectedPath;
149+
SelectedFile = file;
149150

150151
cancellationTokenSource.Cancel();
151152
DialogResult = DialogResult.OK;

BeatModder/FormMain.Designer.cs

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

BeatModder/FormMain.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public partial class FormMain : Form
3030

3131
private ListViewItem selected = null;
3232
private Config config;
33+
private SemVersion currentListVersion;
3334

3435
private GitHubBasedUpdateCheck updateCheck = new GitHubBasedUpdateCheck("CodeStix", "Beat-Modder", "Installer/latestVersion.txt");
3536

@@ -190,6 +191,7 @@ private void FormMain_Load(object sender, EventArgs e)
190191
await beatSaber.InstallMultipleMods(wasManuallyInstalled, ProgressReport.Partial(progress, 0.35f, 0.1f));
191192
await beatSaber.UninstallMultipleMods(wasManuallyUninstalled, true, ProgressReport.Partial(progress, 0.45f, 0.1f));
192193

194+
currentListVersion = beatSaber.BeatSaberVersion;
193195
UpdateModList();
194196

195197
ProgressChange("List of mods has been refreshed.", 0.55f);
@@ -206,6 +208,13 @@ private void FormMain_Load(object sender, EventArgs e)
206208

207209
await beatSaber.RunIPA(revert: false, wait: config.showConsole, shown: config.showConsole);
208210

211+
// API moves old plugins to a folder, we don't do that here.
212+
string movedDirectory = Path.Combine(beatSaber.BeatSaberDirectory, $"Old { beatSaber.PreviousBeatSaberVersionString } Plugins");
213+
if (Directory.Exists(movedDirectory))
214+
{
215+
MessageBox.Show("Files where moved by API");
216+
}
217+
209218
ProgressChange("Patched Beat Saber!", 0.6f);
210219
}
211220

@@ -222,6 +231,16 @@ private void FormMain_Load(object sender, EventArgs e)
222231
textBoxBeatSaberLocation.Text = config.beatSaberLocation;
223232
labelBeatSaberVersion.ForeColor = Color.Green;
224233
labelBeatSaberVersion.Text = $"Beat Saber version: { beatSaber.BeatSaberVersionString }";
234+
foreach (string version in beatMods.AllGameVersions)
235+
{
236+
var tti = buttonSwitchListVersion.DropDownItems.Add(version);
237+
tti.Click += (sender2, e2) =>
238+
{
239+
currentListVersion = SemVersion.Parse(tti.Text.FixOddVersion());
240+
UpdateModList();
241+
};
242+
}
243+
225244
}));
226245

227246
config.firstTime = false;
@@ -326,8 +345,8 @@ private async void uninstallToolStripMenuItem_Click(object sender, EventArgs e)
326345

327346
if (mod.preventRemoval)
328347
{
329-
MessageBox.Show($"Removal of '{ mod.ToString() }' was canceled because " +
330-
$"this plugin is required for all mods to work.\nIf you want to remove all mods, please go to the settings tab.", "Uninstall canceled.",
348+
MessageBox.Show($"Removal of '{ mod.ToString() }' was cancelled because " +
349+
$"this plugin is required for all mods to work.\nIf you want to remove all mods, please go to the settings tab.", "Uninstall cancelled.",
331350
MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
332351
return;
333352
}
@@ -336,7 +355,7 @@ private async void uninstallToolStripMenuItem_Click(object sender, EventArgs e)
336355
{
337356
MessageBox.Show($"You are willing to remove '{ mod.ToString() }', please not that this mod is currently being used by { mod.usedBy.Count } other mods:\n\n" +
338357
string.Join("\n", mod.usedBy) +
339-
$"\n\nYou must first uninstall the mods above to succeed uninstalling this mod!", "Uninstall canceled.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
358+
$"\n\nYou must first uninstall the mods above to succeed uninstalling this mod!", "Uninstall cancelled.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
340359
return;
341360
}
342361

@@ -700,7 +719,7 @@ private void UpdateModList()
700719
.GetModsSortedBy(BeatModsSort.None)
701720
.OnlyKeepStatus(checkBoxAllowNonApproved.Checked ? ModStatus.All : ModStatus.Approved)
702721
.OnlyKeepMostRecentMods()
703-
.OnlyKeepCompatibleWith(beatSaber.BeatSaberVersion)
722+
.OnlyKeepCompatibleWith(currentListVersion)
704723
.Where((e) => !beatSaber.IsInstalledExactVersion(e)))
705724
{
706725
ListViewItem lvi = new ListViewItem(new string[]
@@ -825,6 +844,11 @@ private void ButtonListOfflineMods_Click(object sender, EventArgs e)
825844
fls.ShowDialog();
826845

827846
}
847+
848+
private void ButtonSwitchListVersion_ButtonClick(object sender, EventArgs e)
849+
{
850+
buttonSwitchListVersion.ShowDropDown();
851+
}
828852
}
829853

830854
[Serializable]

0 commit comments

Comments
 (0)