File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 77using SharpEngine . Core . Renderer ;
88using SharpEngine . Core . Utils ;
99using SharpEngine . Core . Utils . SeImGui ;
10+ using SharpEngine . Core . Utils . SeImGui . ConsoleCommand ;
1011
1112namespace SharpEngine . Core . Manager ;
1213
@@ -52,6 +53,13 @@ public static void SeRenderImGui(Window window)
5253 window . _imguiDisplayConsole = ! window . _imguiDisplayConsole ;
5354 }
5455
56+ /// <summary>
57+ /// Add Console Command
58+ /// </summary>
59+ /// <param name="command">Console Command</param>
60+ public static void AddConsoleCommand ( ISeImGuiConsoleCommand command ) =>
61+ SeImGuiWindows . Console . Commands . Add ( command ) ;
62+
5563 /// <summary>
5664 /// Log Message
5765 /// </summary>
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace SharpEngine.Core.Utils.SeImGui
1414 /// </summary>
1515 public static class SeImGuiWindows
1616 {
17- private static SeImGuiConsole Console { get ; } = new ( ) ;
17+ internal static SeImGuiConsole Console { get ; } = new ( ) ;
1818
1919 /// <summary>
2020 /// Display ImGui Console for SharpEngine
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ private static void Main()
2828
2929 window . AddScene ( new MyScene ( ) ) ;
3030
31+ DebugManager . AddConsoleCommand ( new TestConsoleCommand ( ) ) ;
32+
3133 window . Run ( ) ;
3234 }
3335}
Original file line number Diff line number Diff line change 1+ using SharpEngine . Core ;
2+ using SharpEngine . Core . Utils . SeImGui ;
3+ using SharpEngine . Core . Utils . SeImGui . ConsoleCommand ;
4+ using System ;
5+ using System . Collections . Generic ;
6+ using System . Linq ;
7+ using System . Text ;
8+ using System . Threading . Tasks ;
9+
10+ namespace Testing
11+ {
12+ internal class TestConsoleCommand : ISeImGuiConsoleCommand
13+ {
14+ public string Command => "test" ;
15+
16+ public void Process ( string [ ] args , SeImGuiConsole console , Window window )
17+ {
18+ console . AddText ( window . IndexCurrentScene . ToString ( ) ) ;
19+ }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments