Files
sbox-public/engine/Sandbox.Tools/Qt/Widget.Data.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

35 lines
813 B
C#

using Sandbox.Bind;
namespace Editor
{
public partial class Widget : QObject
{
}
}
namespace Sandbox
{
public static partial class SandboxToolExtensions
{
/// <summary>
/// Bind the Left hand side to the value of the given console variable.
/// </summary>
public static Link FromConsoleVariable( this Builder self, string name )
{
var c = self;
return c.From( () => ConsoleSystem.GetValue( name ), x => ConsoleSystem.SetValue( name, x ) );
}
/// <summary>
/// Bind the Left hand side to the value of the given console variable as an integer.
/// </summary>
public static Link FromConsoleVariableInt( this Builder self, string name )
{
var c = self;
return c.From( () => Editor.ConsoleSystem.GetValueInt( name, 0 ), x => ConsoleSystem.SetValue( name, x ) );
}
}
}