Parse newer style STEAM_CALLBACK_BEGIN

This commit is contained in:
Garry Newman 2019-04-11 17:00:44 +01:00
parent 21ff07288d
commit 9d086dbcf6
2 changed files with 4119 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,8 @@ internal void ExtendDefinition( SteamApiDefinition def )
// Get a list of CallbackIds
//
def.CallbackIds = new Dictionary<string, int>();
//v1
{
var r = new Regex( @"enum { (k_[i|I](?:.+)) = ([0-9]+) };" );
var ma = r.Matches( Content );
@ -38,8 +40,6 @@ internal void ExtendDefinition( SteamApiDefinition def )
}
}
//
// Associate callbackIds with structs
//
@ -80,6 +80,22 @@ internal void ExtendDefinition( SteamApiDefinition def )
//kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" );
kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" );
t.CallbackId = $"{kName} + {num}";
}
}
// Even Newer Style
{
var r = new Regex( @"STEAM_CALLBACK_BEGIN\( " + t.Name + @", (.+) \+ ([0-9]+) \)" );
var m = r.Match( Content );
if ( m.Success )
{
var kName = m.Groups[1].Value;
var num = m.Groups[2].Value;
//kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" );
kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" );
t.CallbackId = $"{kName} + {num}";
}
}