mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-24 00:10:10 -04:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
35 lines
813 B
C#
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 ) );
|
|
}
|
|
}
|
|
}
|