This commit is contained in:
SoulliesOfficial
2026-03-14 02:30:26 -04:00
parent cf86f0ee51
commit aee62cd637
2041 changed files with 246771 additions and 129128 deletions

View File

@@ -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

View File

@@ -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++)