mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-13 07:16:37 +08:00
Cleanup CSConsole, add start of Options and Log panels
This commit is contained in:
@ -276,8 +276,6 @@ The following helper methods are available:
|
||||
int endIdx = Input.Text.Length - 1;
|
||||
int topLine = 0;
|
||||
|
||||
try
|
||||
{
|
||||
// Calculate visible text if necessary
|
||||
if (Input.Rect.rect.height > Panel.InputScroll.ViewportRect.rect.height)
|
||||
{
|
||||
@ -308,13 +306,6 @@ The following helper methods are available:
|
||||
? Input.Text.Length - 1
|
||||
: (Input.TextGenerator.lines[bottomLine + 1].startCharIdx - 1);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ExplorerCore.Log("Exception on HighlightVisibleText: " + ex.GetType().Name + ", " + ex.Message);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Highlight the visible text with the LexerBuilder
|
||||
Panel.HighlightText.text = Lexer.BuildHighlightedString(Input.Text, startIdx, endIdx, topLine);
|
||||
|
36
src/UI/Panels/ConsoleLogPanel.cs
Normal file
36
src/UI/Panels/ConsoleLogPanel.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace UnityExplorer.UI.Panels
|
||||
{
|
||||
public class ConsoleLogPanel : UIPanel
|
||||
{
|
||||
public override string Name => "Console Log";
|
||||
public override UIManager.Panels PanelType => UIManager.Panels.ConsoleLog;
|
||||
|
||||
public override int MinWidth => 300;
|
||||
public override int MinHeight => 75;
|
||||
|
||||
public override void ConstructPanelContent()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void DoSaveToConfigElement()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string GetSaveData()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected internal override void DoSetDefaultPosAndAnchors()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
36
src/UI/Panels/OptionsPanel.cs
Normal file
36
src/UI/Panels/OptionsPanel.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace UnityExplorer.UI.Panels
|
||||
{
|
||||
public class OptionsPanel : UIPanel
|
||||
{
|
||||
public override string Name => "Options";
|
||||
public override UIManager.Panels PanelType => UIManager.Panels.Options;
|
||||
|
||||
public override int MinWidth => 400;
|
||||
public override int MinHeight => 200;
|
||||
|
||||
public override void ConstructPanelContent()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void DoSaveToConfigElement()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override string GetSaveData()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected internal override void DoSetDefaultPosAndAnchors()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
@ -43,6 +43,8 @@ namespace UnityExplorer.UI
|
||||
public static ObjectExplorerPanel Explorer { get; private set; }
|
||||
public static InspectorPanel Inspector { get; private set; }
|
||||
public static CSConsolePanel CSharpConsole { get; private set; }
|
||||
public static OptionsPanel Options { get; private set; }
|
||||
public static ConsoleLogPanel ConsoleLog { get; private set; }
|
||||
|
||||
public static AutoCompleteModal AutoCompleter { get; private set; }
|
||||
|
||||
@ -180,6 +182,12 @@ namespace UnityExplorer.UI
|
||||
CSharpConsole.ConstructUI();
|
||||
ConsoleController.Init();
|
||||
|
||||
Options = new OptionsPanel();
|
||||
Options.ConstructUI();
|
||||
|
||||
ConsoleLog = new ConsoleLogPanel();
|
||||
ConsoleLog.ConstructUI();
|
||||
|
||||
ShowMenu = !ConfigManager.Hide_On_Startup.Value;
|
||||
|
||||
ExplorerCore.Log("UI initialized.");
|
||||
|
@ -262,8 +262,10 @@
|
||||
<Compile Include="UI\Models\InputFieldRef.cs" />
|
||||
<Compile Include="UI\ObjectPool\IPooledObject.cs" />
|
||||
<Compile Include="UI\ObjectPool\Pool.cs" />
|
||||
<Compile Include="UI\Panels\ConsoleLogPanel.cs" />
|
||||
<Compile Include="UI\Panels\CSConsolePanel.cs" />
|
||||
<Compile Include="Core\Utility\IOUtility.cs" />
|
||||
<Compile Include="UI\Panels\OptionsPanel.cs" />
|
||||
<Compile Include="UI\Widgets\AutoComplete\ISuggestionProvider.cs" />
|
||||
<Compile Include="UI\Widgets\AutoComplete\Suggestion.cs" />
|
||||
<Compile Include="Core\Config\ConfigElement.cs" />
|
||||
|
Reference in New Issue
Block a user