This commit is contained in:
CortexCore
2023-07-19 14:16:22 +08:00
parent d8d5b3366e
commit 44d1d445f6
5 changed files with 68 additions and 94 deletions

View File

@@ -2,6 +2,7 @@ using Godot;
using System;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BITKit;
using Cysharp.Threading.Tasks;
@@ -51,7 +52,23 @@ public partial class IDIS_SearchService : Node
}
private void Search(string word)
{
var rawHandle = word.Split('?').First();
var split = word.Split('?');
var condition = string.Empty;
switch (split)
{
case var x when x.Length is 1:
break;
case var x when x.Length is 2:
condition = split[1];
break;
case var x when x.Length > 2:
split = word.Split('?', 2);
condition = split[1];
break;
}
var rawHandle = split[0];
MathNode.ClearChild(searchCandidateContainer);
if (service.Query(word, out IDIS_Query[] queries) is false) return;
if (queries.Length is 1 && queries.First().Handle == rawHandle)
@@ -75,7 +92,7 @@ public partial class IDIS_SearchService : Node
void OnButtonOnPressed()
{
searchEdit.Text = query.Handle;
searchEdit.Text =string.IsNullOrEmpty(condition) ? query.Handle :query.Handle + condition ;
Search(query.Handle);
QueryIDIS(query);
}