mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 14:48:02 +03:00
Added Client.CurrentLanguage + AvailableLanguages
This commit is contained in:
parent
f9f18eec74
commit
ca7107c8d3
@ -129,6 +129,38 @@ namespace Facepunch.Steamworks.Test
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void CurrentLanguage()
|
||||||
|
{
|
||||||
|
var sw = new Stopwatch();
|
||||||
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
||||||
|
{
|
||||||
|
Assert.IsTrue( client.IsValid );
|
||||||
|
Assert.IsTrue( client.CurrentLanguage != null );
|
||||||
|
Assert.IsTrue( client.CurrentLanguage.Length > 0 );
|
||||||
|
|
||||||
|
Console.Write( $"CurrentLanguage: {client.CurrentLanguage}" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void AvailableLanguages()
|
||||||
|
{
|
||||||
|
var sw = new Stopwatch();
|
||||||
|
using ( var client = new Facepunch.Steamworks.Client( 252490 ) )
|
||||||
|
{
|
||||||
|
Assert.IsTrue( client.IsValid );
|
||||||
|
Assert.IsTrue( client.AvailableLanguages != null );
|
||||||
|
Assert.IsTrue( client.AvailableLanguages.Length > 0 );
|
||||||
|
|
||||||
|
foreach ( var lang in client.AvailableLanguages )
|
||||||
|
{
|
||||||
|
Console.Write( $"AvailableLanguages: {lang}" );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void Cybercafe()
|
public void Cybercafe()
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,18 @@ namespace Facepunch.Steamworks
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DirectoryInfo InstallFolder { get; private set; }
|
public DirectoryInfo InstallFolder { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The currently selected language
|
||||||
|
/// </summary>
|
||||||
|
public string CurrentLanguage { get; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// List of languages available to the game
|
||||||
|
/// </summary>
|
||||||
|
public string[] AvailableLanguages { get; }
|
||||||
|
|
||||||
public Voice Voice { get; private set; }
|
public Voice Voice { get; private set; }
|
||||||
public ServerList ServerList { get; private set; }
|
public ServerList ServerList { get; private set; }
|
||||||
public App App { get; private set; }
|
public App App { get; private set; }
|
||||||
@ -79,6 +91,8 @@ namespace Facepunch.Steamworks
|
|||||||
OwnerSteamId = native.apps.GetAppOwner();
|
OwnerSteamId = native.apps.GetAppOwner();
|
||||||
InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) );
|
InstallFolder = new DirectoryInfo( native.apps.GetAppInstallDir( AppId ) );
|
||||||
BuildId = native.apps.GetAppBuildId();
|
BuildId = native.apps.GetAppBuildId();
|
||||||
|
CurrentLanguage = native.apps.GetCurrentGameLanguage();
|
||||||
|
AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated
|
||||||
|
|
||||||
//
|
//
|
||||||
// Run update, first call does some initialization
|
// Run update, first call does some initialization
|
||||||
|
Loading…
x
Reference in New Issue
Block a user