大修
This commit is contained in:
@@ -25,6 +25,9 @@ namespace Ichni.Editor
|
||||
public GameObject ConsoleUI;
|
||||
public TMP_Text cueText;
|
||||
bool isHide = true;
|
||||
|
||||
|
||||
|
||||
private string FillCueCommand(MethodInfo method)
|
||||
{
|
||||
if (method == null)
|
||||
@@ -115,7 +118,15 @@ namespace Ichni.Editor
|
||||
private void Update()
|
||||
{
|
||||
UIscale();
|
||||
if (InputCommand.isFocused) InputDect();
|
||||
if (InputCommand.isFocused)
|
||||
{
|
||||
|
||||
InputDect();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("未聚焦输入框");
|
||||
}
|
||||
}
|
||||
private void UIscale()
|
||||
{
|
||||
@@ -177,6 +188,8 @@ namespace Ichni.Editor
|
||||
//这是史,不要看
|
||||
private void InputDect()
|
||||
{
|
||||
Debug.Log("输入指令中");
|
||||
|
||||
// 向下翻历史命令
|
||||
if (Keyboard.current.downArrowKey.wasPressedThisFrame)
|
||||
{
|
||||
@@ -192,6 +205,8 @@ namespace Ichni.Editor
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("输入指令中 - 1");
|
||||
|
||||
// 向上翻历史命令
|
||||
if (Keyboard.current.upArrowKey.wasPressedThisFrame && historycount != 0)
|
||||
@@ -200,32 +215,11 @@ namespace Ichni.Editor
|
||||
InputCommand.text = historyCommand[historycount];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Debug.Log("输入指令中 - 2");
|
||||
|
||||
// 提交命令
|
||||
if (Keyboard.current.enterKey.wasPressedThisFrame)
|
||||
{
|
||||
string input = InputCommand.text; // 原始命令文本
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
InputCommand.text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// 【修改点】:调用新方法获取最终执行的命令(已包含修正逻辑和 TransformCommand)
|
||||
string ExpoCommand = GetFinalCommandForExecution(input);
|
||||
|
||||
// print(ExpoCommand); // 调试语句,可选
|
||||
GetCommand(ExpoCommand);
|
||||
|
||||
// 记录历史命令,使用原始命令 input
|
||||
if (historyCommand.ContainsKey(historycount))
|
||||
historyCommand[historycount] = input;
|
||||
else
|
||||
historyCommand.Add(historycount, input);
|
||||
|
||||
historycount++;
|
||||
InputCommand.text = "";
|
||||
}
|
||||
|
||||
CheckCtrlNumberShortcut();
|
||||
|
||||
}
|
||||
@@ -328,11 +322,41 @@ namespace Ichni.Editor
|
||||
{
|
||||
|
||||
SetUpFunctions();
|
||||
|
||||
|
||||
InputCommand.onSubmit.AddListener(OnSubmitCommand);
|
||||
|
||||
//Test
|
||||
// functionInterpreter.Eval("print(\"Hello World!\")");
|
||||
// functionInterpreter.Eval("log(\"Hello World but debug!\")");
|
||||
}
|
||||
|
||||
private void OnSubmitCommand(string input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(input))
|
||||
{
|
||||
InputCommand.text = "";
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行转换和提交命令
|
||||
string ExpoCommand = GetFinalCommandForExecution(input);
|
||||
GetCommand(ExpoCommand);
|
||||
|
||||
// 记录历史
|
||||
if (historyCommand.ContainsKey(historycount))
|
||||
historyCommand[historycount] = input;
|
||||
else
|
||||
historyCommand.Add(historycount, input);
|
||||
|
||||
historycount++;
|
||||
|
||||
// 提交后清零输入框文本
|
||||
InputCommand.text = "";
|
||||
|
||||
// 核心体验优化:回车后立刻强制重新激活聚焦光标,以便用户紧接着顺畅丝滑地连续敲下一条指令
|
||||
InputCommand.ActivateInputField();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public partial class EditorConsole
|
||||
|
||||
@@ -365,7 +365,7 @@ namespace Ichni.Editor
|
||||
float endTime = hold.holdEndTime;
|
||||
float interval = 1f / (PathnodesCount - 1);
|
||||
|
||||
hold.UpdateNoteInMovableTrack();
|
||||
hold.UpdateNoteInMovableTrack(CoreServices.TimeProvider.SongTime);
|
||||
Vector3 HoldStartPos = default;
|
||||
Vector3 HoldEndPos = default;
|
||||
if (hold.noteVisual is DTMNoteVisualHold dTMNoteVisualHold)
|
||||
@@ -385,7 +385,7 @@ namespace Ichni.Editor
|
||||
LogWindow.Log("the Hold may not be split currently", Color.yellow);
|
||||
return;
|
||||
}
|
||||
hold.UpdateNoteInMovableTrack();
|
||||
hold.UpdateNoteInMovableTrack(CoreServices.TimeProvider.SongTime);
|
||||
Track NewTrack = Track.GenerateElement(hold.elementName + "_SplitTrack", Guid.NewGuid(), new List<string>(), true, parentTrack);
|
||||
new TrackTimeSubmoduleMovable(NewTrack, startTime, endTime, 1, AnimationCurveType.Linear);
|
||||
for (int i = 0; i < PathnodesCount; i++)
|
||||
|
||||
Reference in New Issue
Block a user