mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-02 08:50:18 -04:00
* Fix extremely long property getting cut off in platform settings, grouped things a bit better
* Fix "Couldn't find Input Action called "escape"" warning when first opening chat
* Make sure host messages have the correct data on them
* Fixed chat net messages not registering on non-host 🤦🏻
* Make sure we create Platform.config on project startup, same as Collision/Input configs
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
namespace Sandbox;
|
|
|
|
/// <summary>
|
|
/// Platform-level settings for a game project. These control engine-provided
|
|
/// features like text chat that exist outside of any specific scene.
|
|
/// </summary>
|
|
[Expose]
|
|
public class PlatformSettings : ConfigData
|
|
{
|
|
/// <summary>
|
|
/// Whether the built-in text chat system is enabled for this game.
|
|
/// </summary>
|
|
[Group( "Chat Settings" ), Title( "Enabled" )]
|
|
public bool ChatEnabled
|
|
{
|
|
get
|
|
{
|
|
if ( Application.IsEditor )
|
|
return field;
|
|
|
|
// This will be false for published games that didn't include Platform.config
|
|
if ( !LoadedFromDisk )
|
|
return false;
|
|
|
|
return field;
|
|
}
|
|
set;
|
|
} = true;
|
|
|
|
/// <summary>
|
|
/// Show the default chat UI overlay. When false, messages are still processed
|
|
/// and events still fire, but the built-in overlay is hidden. Use this when
|
|
/// implementing a custom chat UI.
|
|
/// </summary>
|
|
[Group( "Chat Settings" ), Title( "Show UI" )]
|
|
public bool ChatShowUI { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Maximum length of a single chat message in characters.
|
|
/// </summary>
|
|
[Group( "Chat Settings" )]
|
|
[Range( 32, 256 ), Title( "Chat Max Length" )]
|
|
public int ChatMaxMessageLength { get; set; } = 255;
|
|
}
|