/
bulkin
/
BModder
Обзор
Документация
Войти
/
bulkin
/
BModder
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
BModder.UI/Mods/Mod.cs
42 строки
1 KB
bulka-s
fix
16 окт 2025, 21:46
16 окт 2025, 21:46
abbed1c
Код
Авторство
О чём код?
using System.Text.Json.Serialization; using System.IO; namespace BModder.UI { public class Mod { [JsonPropertyName("name")] public string? Name { get; set; } [JsonPropertyName("modPath")] public string? ModPath { get; set; } [JsonPropertyName("downloadUrl")] public string? DownloadUrl { get; set; } public bool IsInstalled(string gamePath) { if (string.IsNullOrWhiteSpace(ModPath)) { LogHelper.WriteLog($"The path (folder) is not specified in the \"{{Name}}\" mod.", LogHelper.LogType.Error); return false; } string fullPath = Path.Combine(gamePath, ModPath); return File.Exists(fullPath); } public void PrintStatus(string gamePath) { if (IsInstalled(gamePath)) { LogHelper.WriteLog($"{Name}", LogHelper.LogType.Success); } else { LogHelper.WriteLog($"{Name}", LogHelper.LogType.Error); } } } }