Merge pull request #514 from Noek1993/master

Added support for FilterText
This commit is contained in:
Garry Newman 2021-09-24 13:51:39 +01:00 committed by GitHub
commit b47e1e6f55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -756,7 +756,7 @@ public enum GamepadTextInputLineMode : int
//
// ETextFilteringContext
//
internal enum TextFilteringContext : int
public enum TextFilteringContext : int
{
Unknown = 0,
GameContent = 1,

View File

@ -261,5 +261,21 @@ internal static bool IsCallComplete( SteamAPICall_t call, out bool failed )
/// Returns whether this steam client is a Steam China specific client, vs the global client
/// </summary>
public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher();
/// <summary>
/// Initializes text filtering, loading dictionaries for the language the game is running in.
/// Users can customize the text filter behavior in their Steam Account preferences
/// </summary>
public static bool InitFilterText() => Internal.InitFilterText( 0 );
/// <summary>
/// Filters the provided input message and places the filtered result into pchOutFilteredText,
/// using legally required filtering and additional filtering based on the context and user settings.
/// </summary>
public string FilterText( TextFilteringContext context, SteamId sourceSteamID, string inputMessage )
{
Internal.FilterText( context, sourceSteamID, inputMessage, out var filteredString );
return filteredString;
}
}
}

View File

@ -144,6 +144,7 @@ internal static string Expose( string name )
if ( name == "NetDebugOutput" ) return "public";
if ( name == "ItemPreviewType" ) return "public";
if ( name == "OverlayToStoreFlag" ) return "public";
if ( name == "TextFilteringContext " ) return "public";
return "internal";
}