mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
commit
7773d033ea
@ -23,8 +23,8 @@ namespace Wabbajack.Common
|
||||
throw new ArgumentException("T must be an Enum");
|
||||
}
|
||||
|
||||
DescriptionAttribute[] attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
return attributes.Length > 0 ? attributes[0].Description : string.Empty;
|
||||
var attributes = (DescriptionAttribute[])val.GetType().GetField(val.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
return attributes.Length > 0 ? attributes[0].Description : val.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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,8 @@ namespace Wabbajack.Lib.ModListRegistry
|
||||
[JsonProperty("game")]
|
||||
public Game Game { get; set; }
|
||||
|
||||
[JsonIgnore] public string GameName => this.Game.ToDescriptionString();
|
||||
|
||||
[JsonProperty("official")]
|
||||
public bool Official { get; set; }
|
||||
|
||||
@ -75,8 +78,8 @@ namespace Wabbajack.Lib.ModListRegistry
|
||||
public static List<ModlistMetadata> LoadFromGithub()
|
||||
{
|
||||
var client = new HttpClient();
|
||||
Utils.Log("Loading Modlists from Github");
|
||||
var result = client.GetStringSync(Consts.ModlistMetadataURL);
|
||||
Utils.Log("Loading ModLists from Github");
|
||||
var result = client.GetStringSync(Consts.ModlistMetadataURL);
|
||||
return result.FromJSONString<List<ModlistMetadata>>();
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,6 @@ namespace Wabbajack
|
||||
{
|
||||
this.Game = game;
|
||||
this.DisplayName = game.ToDescriptionString();
|
||||
if (string.IsNullOrWhiteSpace(this.DisplayName))
|
||||
{
|
||||
this.DisplayName = game.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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