minor fixes
This commit is contained in:
parent
631f5c9126
commit
372fa5eda2
@ -22,11 +22,11 @@ public record Config
|
|||||||
public int max_parallel_downloads { get; set; } = 16;
|
public int max_parallel_downloads { get; set; } = 16;
|
||||||
public VersionCatalogProps[] version_catalogs { get; set; } =
|
public VersionCatalogProps[] version_catalogs { get; set; } =
|
||||||
[
|
[
|
||||||
new() { Name = "Mojang", Url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" }
|
new() { name = "Mojang", url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
[JsonIgnore] private static IOPath _filePath = "config.json";
|
[JsonIgnore] private static IOPath _filePath = "млаумчерб.json";
|
||||||
|
|
||||||
public static Config LoadFromFile()
|
public static Config LoadFromFile()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -281,6 +281,7 @@ public partial class MainWindow : Window
|
|||||||
{
|
{
|
||||||
VersionCatalogItemsComboBox.Items.Add(new VersionItemView(p));
|
VersionCatalogItemsComboBox.Items.Add(new VersionItemView(p));
|
||||||
}
|
}
|
||||||
|
VersionCatalogItemsComboBox.SelectedIndex = 0;
|
||||||
VersionCatalogItemsComboBox.IsEnabled = true;
|
VersionCatalogItemsComboBox.IsEnabled = true;
|
||||||
AddVersionButton.IsEnabled = versions.Count > 0;
|
AddVersionButton.IsEnabled = versions.Count > 0;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,14 +5,14 @@ namespace Mlaumcherb.Client.Avalonia.классы;
|
|||||||
|
|
||||||
public class VersionCatalogProps
|
public class VersionCatalogProps
|
||||||
{
|
{
|
||||||
[JsonRequired] public required string Name { get; init; }
|
[JsonRequired] public required string name { get; init; }
|
||||||
[JsonRequired] public required string Url { get; init; }
|
[JsonRequired] public required string url { get; init; }
|
||||||
|
|
||||||
public override string ToString() => Name;
|
public override string ToString() => name;
|
||||||
|
|
||||||
|
|
||||||
public async Task<GameVersionCatalog> GetVersionCatalogAsync()
|
public async Task<GameVersionCatalog> GetVersionCatalogAsync()
|
||||||
{
|
{
|
||||||
return await NetworkHelper.DownloadStringAndDeserialize<GameVersionCatalog>(Url);
|
return await NetworkHelper.DownloadStringAndDeserialize<GameVersionCatalog>(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user