2 Commits

Author SHA1 Message Date
e24ee815bc my version catalog 2024-12-28 00:26:38 +05:00
372fa5eda2 minor fixes 2024-12-28 00:22:28 +05:00
3 changed files with 8 additions and 6 deletions

View File

@@ -22,11 +22,12 @@ public record Config
public int max_parallel_downloads { get; set; } = 16;
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" },
new() { name = "Тимериховое", url = "https://timerix.ddns.net/minecraft/catalog.json" }
];
[JsonIgnore] private static IOPath _filePath = "config.json";
[JsonIgnore] private static IOPath _filePath = "млаумчерб.json";
public static Config LoadFromFile()
{

View File

@@ -281,6 +281,7 @@ public partial class MainWindow : Window
{
VersionCatalogItemsComboBox.Items.Add(new VersionItemView(p));
}
VersionCatalogItemsComboBox.SelectedIndex = 0;
VersionCatalogItemsComboBox.IsEnabled = true;
AddVersionButton.IsEnabled = versions.Count > 0;
});

View File

@@ -5,14 +5,14 @@ namespace Mlaumcherb.Client.Avalonia.классы;
public class VersionCatalogProps
{
[JsonRequired] public required string Name { get; init; }
[JsonRequired] public required string Url { get; init; }
[JsonRequired] public required string name { get; init; }
[JsonRequired] public required string url { get; init; }
public override string ToString() => Name;
public override string ToString() => name;
public async Task<GameVersionCatalog> GetVersionCatalogAsync()
{
return await NetworkHelper.DownloadStringAndDeserialize<GameVersionCatalog>(Url);
return await NetworkHelper.DownloadStringAndDeserialize<GameVersionCatalog>(url);
}
}