Skip to content

Commit ec126d5

Browse files
committed
Add unknown versions to the dropdown
1 parent 754885d commit ec126d5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ModAssistant/MainWindow.xaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,16 @@ private async void LoadVersionsAsync()
122122
body = await resp.Content.ReadAsStringAsync();
123123
Dictionary<string, string[]> aliases = JsonSerializer.Deserialize<Dictionary<string, string[]>>(body);
124124

125+
string version = Utils.GetVersion();
126+
if (!versions.Contains(version) && CheckAliases(versions, aliases, version) == string.Empty)
127+
{
128+
versions.Insert(0, version);
129+
}
130+
131+
125132
Dispatcher.Invoke(() =>
126133
{
127-
GameVersion = GetGameVersion(versions, aliases);
134+
GameVersion = GetGameVersion(version, versions, aliases);
128135

129136
GameVersionsBox.ItemsSource = versions;
130137
GameVersionsBox.SelectedValue = GameVersion;
@@ -157,9 +164,8 @@ private async void LoadVersionsAsync()
157164
}
158165
}
159166

160-
private string GetGameVersion(List<string> versions, Dictionary<string, string[]> aliases)
167+
private string GetGameVersion(string version, List<string> versions, Dictionary<string, string[]> aliases)
161168
{
162-
string version = Utils.GetVersion();
163169
if (!string.IsNullOrEmpty(version) && versions.Contains(version))
164170
{
165171
return version;

0 commit comments

Comments
 (0)