mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-08 22:38:28 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
30 lines
815 B
C#
30 lines
815 B
C#
using Native;
|
|
|
|
namespace Editor.MapEditor;
|
|
|
|
/// <summary>
|
|
/// Interface for the addon layer to implement, this is called from native Hammer.
|
|
/// </summary>
|
|
public interface IPathTool
|
|
{
|
|
internal void CreateUI( QWidget container ) => CreateUI( new Widget( container ) );
|
|
public void CreateUI( Widget container );
|
|
public string GetCurrentEntityClassName();
|
|
public float GetRadiusOffset();
|
|
public bool IsRadiusOffsetEnabled();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Methods called from native to glue the remaining native tool code to here.
|
|
/// This will become redundant as the API matures.
|
|
/// </summary>
|
|
internal static class PathToolGlue
|
|
{
|
|
internal static IPathTool Create()
|
|
{
|
|
var entityTool = IToolFactory.Instance.CreatePathTool();
|
|
Sandbox.InteropSystem.Alloc( entityTool ); // dirty fucker
|
|
return entityTool;
|
|
}
|
|
}
|