From bf8d5f165da8556d3645ba1a1838af2d2cd2cd72 Mon Sep 17 00:00:00 2001 From: ikpil Date: Thu, 15 Jun 2023 23:10:52 +0900 Subject: [PATCH] changed IsMousInside -> IsHovered --- src/DotRecast.Recast.Demo/RecastDemo.cs | 2 +- src/DotRecast.Recast.Demo/UI/IRcView.cs | 2 +- src/DotRecast.Recast.Demo/UI/RcCanvas.cs | 9 +++++---- src/DotRecast.Recast.Demo/UI/RcLogView.cs | 6 +++--- src/DotRecast.Recast.Demo/UI/RcSettingsView.cs | 6 +++--- src/DotRecast.Recast.Demo/UI/RcToolsetView.cs | 6 +++--- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/DotRecast.Recast.Demo/RecastDemo.cs b/src/DotRecast.Recast.Demo/RecastDemo.cs index a513351..f9c3696 100644 --- a/src/DotRecast.Recast.Demo/RecastDemo.cs +++ b/src/DotRecast.Recast.Demo/RecastDemo.cs @@ -781,7 +781,7 @@ public class RecastDemo dd.Fog(false); _canvas.Draw(dt); - _mouseOverMenu = _canvas.IsMouseOverUI(); + _mouseOverMenu = _canvas.IsMouseOver(); _imgui.Render(); diff --git a/src/DotRecast.Recast.Demo/UI/IRcView.cs b/src/DotRecast.Recast.Demo/UI/IRcView.cs index 94a2f03..677e441 100644 --- a/src/DotRecast.Recast.Demo/UI/IRcView.cs +++ b/src/DotRecast.Recast.Demo/UI/IRcView.cs @@ -21,7 +21,7 @@ namespace DotRecast.Recast.Demo.UI; public interface IRcView { void Bind(RcCanvas canvas); - bool IsMouseInside(); + bool IsHovered(); void Update(double dt); void Draw(double dt); } \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/UI/RcCanvas.cs b/src/DotRecast.Recast.Demo/UI/RcCanvas.cs index fec796d..f53c496 100644 --- a/src/DotRecast.Recast.Demo/UI/RcCanvas.cs +++ b/src/DotRecast.Recast.Demo/UI/RcCanvas.cs @@ -33,8 +33,9 @@ public class RcCanvas private readonly IWindow _window; private readonly IRcView[] _views; - private bool _mouseOverUI; - public bool IsMouseOverUI() => _mouseOverUI; + private bool _mouseOver; + + public bool IsMouseOver() => _mouseOver; public Vector2D Size => _window.Size; @@ -107,11 +108,11 @@ public class RcCanvas public void Draw(double dt) { - _mouseOverUI = false; + _mouseOver = false; foreach (var view in _views) { view.Draw(dt); - _mouseOverUI |= view.IsMouseInside(); + _mouseOver |= view.IsHovered(); } } } \ No newline at end of file diff --git a/src/DotRecast.Recast.Demo/UI/RcLogView.cs b/src/DotRecast.Recast.Demo/UI/RcLogView.cs index 0e92a2e..ca098bf 100644 --- a/src/DotRecast.Recast.Demo/UI/RcLogView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcLogView.cs @@ -14,7 +14,8 @@ namespace DotRecast.Recast.Demo.UI; public class RcLogView : IRcView { private RcCanvas _canvas; - private bool _mouseInside; + private bool _isHovered; + public bool IsHovered() => _isHovered; private readonly List _lines; private readonly ConcurrentQueue _queues; @@ -59,7 +60,6 @@ public class RcLogView : IRcView } } - public bool IsMouseInside() => _mouseInside; public void Draw(double dt) { @@ -78,7 +78,7 @@ public class RcLogView : IRcView if (ImGui.BeginChild("scrolling", Vector2.Zero, false, ImGuiWindowFlags.HorizontalScrollbar)) { - _mouseInside = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); + _isHovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, Vector2.Zero); diff --git a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs index a23f0cb..83569a4 100644 --- a/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcSettingsView.cs @@ -47,8 +47,8 @@ public class RcSettingsView : IRcView private bool meshInputTrigerred; private bool navMeshInputTrigerred; - private bool _mouseInside; - public bool IsMouseInside() => _mouseInside; + private bool _isHovered; + public bool IsHovered() => _isHovered; private Sample _sample; private RcCanvas _canvas; @@ -81,7 +81,7 @@ public class RcSettingsView : IRcView ImGui.SetNextWindowSize(new Vector2(width, _canvas.Size.Y)); ImGui.Begin("Properties", ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize); - _mouseInside = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); + _isHovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); ImGui.Text("Input Mesh"); ImGui.Separator(); diff --git a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs index 374e53d..77fd4f4 100644 --- a/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs +++ b/src/DotRecast.Recast.Demo/UI/RcToolsetView.cs @@ -34,8 +34,8 @@ public class RcToolsetView : IRcView private IRcTool currentTool; private bool enabled; private readonly IRcTool[] tools; - private bool _mouseInside; - public bool IsMouseInside() => _mouseInside; + private bool _isHovered; + public bool IsHovered() => _isHovered; private RcCanvas _canvas; @@ -59,7 +59,7 @@ public class RcToolsetView : IRcView ImGui.SetNextWindowPos(new Vector2(0, 0)); ImGui.SetNextWindowSize(new Vector2(width, _canvas.Size.Y)); ImGui.Begin("Tools", ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize); - _mouseInside = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); + _isHovered = ImGui.IsWindowHovered(ImGuiHoveredFlags.RectOnly | ImGuiHoveredFlags.RootAndChildWindows); for (int i = 0; i < tools.Length; ++i) {