From 81c5ca77612da8f4e32340cba8a74551a0a592b0 Mon Sep 17 00:00:00 2001 From: Koen Mulder Date: Tue, 5 Jan 2021 18:28:45 +0100 Subject: [PATCH] Added support for FilterText --- Facepunch.Steamworks/Generated/SteamEnums.cs | 2 +- Facepunch.Steamworks/SteamUtils.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Facepunch.Steamworks/Generated/SteamEnums.cs b/Facepunch.Steamworks/Generated/SteamEnums.cs index c3fb41f..a27f8ac 100644 --- a/Facepunch.Steamworks/Generated/SteamEnums.cs +++ b/Facepunch.Steamworks/Generated/SteamEnums.cs @@ -752,7 +752,7 @@ namespace Steamworks // // ETextFilteringContext // - internal enum TextFilteringContext : int + public enum TextFilteringContext : int { Unknown = 0, GameContent = 1, diff --git a/Facepunch.Steamworks/SteamUtils.cs b/Facepunch.Steamworks/SteamUtils.cs index 9d3eea0..a6fe436 100644 --- a/Facepunch.Steamworks/SteamUtils.cs +++ b/Facepunch.Steamworks/SteamUtils.cs @@ -261,5 +261,20 @@ namespace Steamworks /// Returns whether this steam client is a Steam China specific client, vs the global client /// public static bool IsSteamChinaLauncher => Internal.IsSteamChinaLauncher(); + + /// + /// 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 + /// + public static bool InitFilterText( uint unFilterOptions ) => Internal.InitFilterText( unFilterOptions ); + + /// + /// 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. + /// + public int FilterText( TextFilteringContext eContext, SteamId sourceSteamID, string pchInputMessage, out string pchOutFilteredText ) + { + return Internal.FilterText( eContext, sourceSteamID, pchInputMessage, out pchOutFilteredText ); + } } } \ No newline at end of file