46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
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 = App.UI.GetAllUI();
|
|
bool showCursor = false;
|
|
foreach (var ui in uis)
|
|
{
|
|
if (!ui.IsShowing) continue;
|
|
if (ui.IsShowCursor)
|
|
{
|
|
showCursor = true;
|
|
break;
|
|
}
|
|
}
|
|
Log.Error($"showCursor={showCursor}");
|
|
// Game.Input.IsUIStopInput = showCursor;
|
|
// Game.Input.SetMouseCursor(showCursor);
|
|
}
|
|
}
|
|
} |