input相关

This commit is contained in:
2025-05-26 00:06:37 +08:00
parent 68b88d57db
commit 763fa5103f
23 changed files with 745 additions and 68 deletions

View File

@@ -0,0 +1,46 @@
using NBC;
namespace NBF
{
public static class InputCursorExtension
{
public static void InputInit()
{
UI.Inst.On(UIEvents.UIShow, UIShow, null, 1);
UI.Inst.On(UIEvents.UIHide, UIHide, null, 1);
}
public static void Dispose()
{
}
private static void UIShow(EventArgs ev)
{
CheckUICursor();
}
private static void UIHide(EventArgs ev)
{
CheckUICursor();
}
private static void CheckUICursor()
{
var uis = UI.Inst.GetAllUI();
bool showCursor = false;
foreach (var ui in uis)
{
if (!ui.IsShowing) continue;
if (ui.IsShowCursor)
{
showCursor = true;
break;
}
}
Log.Error($"showCursor={showCursor}");
InputManager.IsUIStopInput = showCursor;
InputManager.SetMouseCursor(showCursor);
}
}
}