From c8e5c0ca5a06c1fb310cd7cde99bafb105b4abed Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Wed, 31 Jan 2018 12:50:13 +0000 Subject: [PATCH] fixed "Result Esult" --- .../Interfaces/Inventory.Result.cs | 2 +- .../SteamNative/SteamNative.Structs.cs | 30 +++++++++---------- Generator/CodeWriter/Utility.cs | 3 ++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs index d2373b3..648b991 100644 --- a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs +++ b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs @@ -153,7 +153,7 @@ internal void Fill() internal void OnSteamResult( SteamInventoryResultReady_t data, bool error ) { - var success = data.Esult == SteamNative.Result.OK && !error; + var success = data.Result == SteamNative.Result.OK && !error; if ( success ) { diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs index c965b50..af487a0 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs @@ -4939,7 +4939,7 @@ internal struct SetPersonaNameResponse_t public bool Success; // m_bSuccess _Bool [MarshalAs(UnmanagedType.I1)] public bool LocalSuccess; // m_bLocalSuccess _Bool - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. @@ -4957,7 +4957,7 @@ internal struct PackSmall public bool Success; // m_bSuccess _Bool [MarshalAs(UnmanagedType.I1)] public bool LocalSuccess; // m_bLocalSuccess _Bool - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult // // Easily convert from PackSmall to SetPersonaNameResponse_t @@ -4968,7 +4968,7 @@ public static implicit operator SetPersonaNameResponse_t ( SetPersonaNameRespon { Success = d.Success, LocalSuccess = d.LocalSuccess, - Esult = d.Esult, + Result = d.Result, }; } } @@ -29015,7 +29015,7 @@ internal struct SteamInventoryResultReady_t { public const int CallbackId = CallbackIdentifiers.ClientInventory + 0; public int Handle; // m_handle SteamInventoryResult_t - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult // // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. @@ -29030,7 +29030,7 @@ public static SteamInventoryResultReady_t FromPointer( IntPtr p ) internal struct PackSmall { public int Handle; // m_handle SteamInventoryResult_t - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult // // Easily convert from PackSmall to SteamInventoryResultReady_t @@ -29040,7 +29040,7 @@ public static implicit operator SteamInventoryResultReady_t ( SteamInventoryRes return new SteamInventoryResultReady_t() { Handle = d.Handle, - Esult = d.Esult, + Result = d.Result, }; } } @@ -29307,7 +29307,7 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo internal struct SteamInventoryEligiblePromoItemDefIDs_t { public const int CallbackId = CallbackIdentifiers.ClientInventory + 3; - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult public ulong SteamID; // m_steamID class CSteamID public int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int [MarshalAs(UnmanagedType.I1)] @@ -29325,7 +29325,7 @@ public static SteamInventoryEligiblePromoItemDefIDs_t FromPointer( IntPtr p ) [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct PackSmall { - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult public ulong SteamID; // m_steamID class CSteamID public int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int [MarshalAs(UnmanagedType.I1)] @@ -29338,7 +29338,7 @@ public static implicit operator SteamInventoryEligiblePromoItemDefIDs_t ( Steam { return new SteamInventoryEligiblePromoItemDefIDs_t() { - Esult = d.Esult, + Result = d.Result, SteamID = d.SteamID, UmEligiblePromoItemDefs = d.UmEligiblePromoItemDefs, CachedData = d.CachedData, @@ -29593,7 +29593,7 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo internal struct SteamInventoryStartPurchaseResult_t { public const int CallbackId = CallbackIdentifiers.ClientInventory + 4; - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult public ulong OrderID; // m_ulOrderID uint64 public ulong TransID; // m_ulTransID uint64 @@ -29609,7 +29609,7 @@ public static SteamInventoryStartPurchaseResult_t FromPointer( IntPtr p ) [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct PackSmall { - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult public ulong OrderID; // m_ulOrderID uint64 public ulong TransID; // m_ulTransID uint64 @@ -29620,7 +29620,7 @@ public static implicit operator SteamInventoryStartPurchaseResult_t ( SteamInve { return new SteamInventoryStartPurchaseResult_t() { - Esult = d.Esult, + Result = d.Result, OrderID = d.OrderID, TransID = d.TransID, }; @@ -29874,7 +29874,7 @@ public static void RegisterCallback( Facepunch.Steamworks.BaseSteamworks steamwo internal struct SteamInventoryRequestPricesResult_t { public const int CallbackId = CallbackIdentifiers.ClientInventory + 5; - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string Currency; // m_rgchCurrency char [4] @@ -29890,7 +29890,7 @@ public static SteamInventoryRequestPricesResult_t FromPointer( IntPtr p ) [StructLayout( LayoutKind.Sequential, Pack = 4 )] internal struct PackSmall { - public Result Esult; // m_result enum EResult + public Result Result; // m_result enum EResult [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string Currency; // m_rgchCurrency char [4] @@ -29901,7 +29901,7 @@ public static implicit operator SteamInventoryRequestPricesResult_t ( SteamInve { return new SteamInventoryRequestPricesResult_t() { - Esult = d.Esult, + Result = d.Result, Currency = d.Currency, }; } diff --git a/Generator/CodeWriter/Utility.cs b/Generator/CodeWriter/Utility.cs index 4843e86..e6e5623 100644 --- a/Generator/CodeWriter/Utility.cs +++ b/Generator/CodeWriter/Utility.cs @@ -36,6 +36,7 @@ string CleanMemberName( string m ) if ( m == "m_cubParam" ) return "ParamCount"; if ( m == "m_itemId" ) return "ItemId"; if ( m == "m_handle" ) return "Handle"; + if (m == "m_result") return "Result"; var cleanName = m.Replace( "m_un", "" ) .Replace( "m_us", "" ) @@ -56,6 +57,8 @@ string CleanMemberName( string m ) .Replace( "m_r", "" ) .Replace( "m_", "" ); + + return cleanName.Substring( 0, 1 ).ToUpper() + cleanName.Substring( 1 ); }