diff --git a/Facepunch.Steamworks.Test/Client/Client.cs b/Facepunch.Steamworks.Test/Client/Client.cs index ed3942c..ddd8042 100644 --- a/Facepunch.Steamworks.Test/Client/Client.cs +++ b/Facepunch.Steamworks.Test/Client/Client.cs @@ -215,7 +215,7 @@ namespace Facepunch.Steamworks.Test foreach ( var i in client.Inventory.Definitions ) { - Console.WriteLine( "{0}: {1}", i.Id, i.Name ); + Console.WriteLine( "{0}: {1} ({2})", i.Id, i.Name, i.Type ); Console.WriteLine( " itemshortname: {0}", i.GetStringProperty( "itemshortname" ) ); Console.WriteLine( " workshopdownload: {0}", i.GetStringProperty( "workshopdownload" ) ); Console.WriteLine( " IconUrl: {0}", i.IconUrl ); diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs index 17dfa35..5293512 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs @@ -20,9 +20,22 @@ namespace Facepunch.Steamworks public int Id { get; private set; } public string Name { get; set; } public string Description { get; set; } + + /// + /// URL to an image specified by the schema, else empty + /// public string IconUrl { get; set; } + + /// + /// URL to an image specified by the schema, else empty + /// public string IconLargeUrl { get; set; } + /// + /// Type can be whatever the schema defines. + /// + public string Type { get; set; } + /// /// If this item can be created using other items this string will contain a comma seperated /// list of definition ids that can be used, ie "100,101;102x5;103x3,104x3" @@ -42,6 +55,11 @@ namespace Facepunch.Steamworks public DateTime Created { get; set; } public DateTime Modified { get; set; } + public bool IsGenerator + { + get { return Type == "generator"; } + } + private Dictionary customProperties; internal Definition( SteamNative.SteamInventory i, int id ) @@ -107,6 +125,7 @@ namespace Facepunch.Steamworks ExchangeSchema = GetStringProperty( "exchange" ); IconUrl = GetStringProperty( "icon_url" ); IconLargeUrl = GetStringProperty( "icon_url_large" ); + Type = GetStringProperty( "type" ); } ///