mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
ModList list from GitHub will display the description of a game instead of toString if available
This commit is contained in:
parent
50bbd0eb1f
commit
2fde106b92
@ -6,6 +6,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using CommonMark.Syntax;
|
||||
using Newtonsoft.Json;
|
||||
using Wabbajack.Common;
|
||||
using Wabbajack.Lib.Downloaders;
|
||||
@ -31,6 +32,9 @@ namespace Wabbajack.Lib.ModListRegistry
|
||||
[JsonProperty("game")]
|
||||
public Game Game { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string GameName { get; set; }
|
||||
|
||||
[JsonProperty("official")]
|
||||
public bool Official { get; set; }
|
||||
|
||||
@ -75,9 +79,16 @@ namespace Wabbajack.Lib.ModListRegistry
|
||||
public static List<ModlistMetadata> LoadFromGithub()
|
||||
{
|
||||
var client = new HttpClient();
|
||||
Utils.Log("Loading Modlists from Github");
|
||||
Utils.Log("Loading ModLists from Github");
|
||||
var result = client.GetStringSync(Consts.ModlistMetadataURL);
|
||||
return result.FromJSONString<List<ModlistMetadata>>();
|
||||
var list = result.FromJSONString<List<ModlistMetadata>>();
|
||||
list.Do(m =>
|
||||
{
|
||||
m.GameName = m.Game.ToDescriptionString();
|
||||
if (string.IsNullOrWhiteSpace(m.GameName))
|
||||
m.GameName = m.Game.ToString();
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
public bool NeedsDownload(string modlistPath)
|
||||
|
@ -97,7 +97,7 @@
|
||||
Grid.Row="1"
|
||||
Grid.Column="4"
|
||||
HorizontalAlignment="Right"
|
||||
Text="{Binding Game}"
|
||||
Text="{Binding GameName}"
|
||||
TextAlignment="Right" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
|
Loading…
Reference in New Issue
Block a user