mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-02 11:28:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
33 lines
628 B
C#
33 lines
628 B
C#
using Native;
|
|
using NativeModelDoc;
|
|
|
|
namespace Editor.ModelEditor;
|
|
|
|
public static partial class ModelDoc
|
|
{
|
|
static CModelDocEditorApp? App;
|
|
|
|
public static bool Open => App != null;
|
|
|
|
public static Asset ModelAsset => Open ? AssetSystem.FindByPath( App?.GetSessionModel() ) : null;
|
|
|
|
internal static void Init( CModelDocEditorApp app )
|
|
{
|
|
App = app;
|
|
}
|
|
|
|
[Event( "tools.gamedata.refresh" )]
|
|
internal static void RefreshGameData()
|
|
{
|
|
if ( App?.IsValid == true )
|
|
{
|
|
App?.RefreshGameData();
|
|
}
|
|
}
|
|
|
|
internal static void OnToolsMenu( QMenu qmenu )
|
|
{
|
|
EditorEvent.Run( "modeldoc.menu.tools", new Menu( qmenu ) );
|
|
}
|
|
}
|