From 8cac04218cceecb34785bccb5c80c5d2ae4fc5fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:48:46 +0000 Subject: [PATCH 1/4] Bump ImGui.NET from 1.89.9.3 to 1.90.0.1 Bumps [ImGui.NET](https://github.com/mellinoe/imgui.net) from 1.89.9.3 to 1.90.0.1. - [Release notes](https://github.com/mellinoe/imgui.net/releases) - [Commits](https://github.com/mellinoe/imgui.net/compare/v1.89.9.3...v1.90.0.1) --- updated-dependencies: - dependency-name: ImGui.NET dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj | 2 +- .../OpenKh.Tools.Common.CustomImGui.csproj | 2 +- OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj | 2 +- .../OpenKh.Tools.Kh2MsetMotionEditor.csproj | 2 +- OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj b/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj index 1a0e4a5fd..5cb0d0614 100644 --- a/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj +++ b/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj @@ -23,7 +23,7 @@ - + diff --git a/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj b/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj index 0d41a3ba1..72d1262a8 100644 --- a/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj +++ b/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj @@ -7,7 +7,7 @@ - + diff --git a/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj b/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj index e4b656c6d..afaae340a 100644 --- a/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj +++ b/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj @@ -23,7 +23,7 @@ - + diff --git a/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj b/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj index d1e9ef9e9..08211f6c5 100644 --- a/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj +++ b/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj @@ -24,7 +24,7 @@ - + diff --git a/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj b/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj index a1bd80558..3ec5c7d41 100644 --- a/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj +++ b/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj @@ -23,7 +23,7 @@ - + From 37435b98998591def89daa07feaa9823c019932b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 02:25:46 +0000 Subject: [PATCH 2/4] Bump ImGui.NET from 1.89.9.3 to 1.90.0.1 Bumps [ImGui.NET](https://github.com/mellinoe/imgui.net) from 1.89.9.3 to 1.90.0.1. - [Release notes](https://github.com/mellinoe/imgui.net/releases) - [Commits](https://github.com/mellinoe/imgui.net/compare/v1.89.9.3...v1.90.0.1) --- updated-dependencies: - dependency-name: ImGui.NET dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj | 2 +- .../OpenKh.Tools.Common.CustomImGui.csproj | 2 +- OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj | 2 +- .../OpenKh.Tools.Kh2MsetMotionEditor.csproj | 2 +- OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj b/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj index 1a0e4a5fd..5cb0d0614 100644 --- a/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj +++ b/OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj @@ -23,7 +23,7 @@ - + diff --git a/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj b/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj index 0d41a3ba1..72d1262a8 100644 --- a/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj +++ b/OpenKh.Tools.Common.CustomImGui/OpenKh.Tools.Common.CustomImGui.csproj @@ -7,7 +7,7 @@ - + diff --git a/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj b/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj index e4b656c6d..afaae340a 100644 --- a/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj +++ b/OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj @@ -23,7 +23,7 @@ - + diff --git a/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj b/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj index d1e9ef9e9..08211f6c5 100644 --- a/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj +++ b/OpenKh.Tools.Kh2MsetMotionEditor/OpenKh.Tools.Kh2MsetMotionEditor.csproj @@ -24,7 +24,7 @@ - + diff --git a/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj b/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj index a1bd80558..3ec5c7d41 100644 --- a/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj +++ b/OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj @@ -23,7 +23,7 @@ - + From 72031bf3da8a6ebb98d90e0ff66c1a1104d76ad9 Mon Sep 17 00:00:00 2001 From: kenjiuno Date: Fri, 22 Dec 2023 13:49:48 +0900 Subject: [PATCH 3/4] - Fix errors --- OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs | 2 +- .../MonoGameImGui.cs | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs b/OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs index 169cfc6e0..28944ac85 100644 --- a/OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs +++ b/OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs @@ -297,7 +297,7 @@ public static void ForMenuCheck(string name, Func getter, Action set public static bool ForChild(string name, float w, float h, bool border, Action action) { - var ret = ImGui.BeginChild(name, new Vector2(w, h), border); + var ret = ImGui.BeginChild(name, new Vector2(w, h), border ? ImGuiChildFlags.Border : ImGuiChildFlags.None); action(); ImGui.EndChild(); diff --git a/OpenKh.Tools.Common.CustomImGui/MonoGameImGui.cs b/OpenKh.Tools.Common.CustomImGui/MonoGameImGui.cs index 4354feeb6..e4266bf9d 100644 --- a/OpenKh.Tools.Common.CustomImGui/MonoGameImGui.cs +++ b/OpenKh.Tools.Common.CustomImGui/MonoGameImGui.cs @@ -62,7 +62,7 @@ static DrawVertDeclaration() // Input private int _scrollWheelValue; - private List _keys = new List(); + private List<(ImGuiKey ImGuiKey, Keys XnaKey)> _keys = new List<(ImGuiKey ImGuiKey, Keys XnaKey)>(); public bool ImGuiWantCaptureKeyboard => ImGui.GetIO().WantCaptureKeyboard; public bool ImGuiWantCaptureMouse => ImGui.GetIO().WantCaptureMouse; @@ -102,6 +102,26 @@ public MonoGameImGui(Game game) }; }; + _keys.Add((ImGuiKey.Tab, Keys.Tab)); + _keys.Add((ImGuiKey.LeftArrow, Keys.Left)); + _keys.Add((ImGuiKey.RightArrow, Keys.Right)); + _keys.Add((ImGuiKey.UpArrow, Keys.Up)); + _keys.Add((ImGuiKey.DownArrow, Keys.Down)); + _keys.Add((ImGuiKey.PageUp, Keys.PageUp)); + _keys.Add((ImGuiKey.PageDown, Keys.PageDown)); + _keys.Add((ImGuiKey.Home, Keys.Home)); + _keys.Add((ImGuiKey.End, Keys.End)); + _keys.Add((ImGuiKey.Delete, Keys.Delete)); + _keys.Add((ImGuiKey.Backspace, Keys.Back)); + _keys.Add((ImGuiKey.Enter, Keys.Enter)); + _keys.Add((ImGuiKey.Escape, Keys.Escape)); + _keys.Add((ImGuiKey.A, Keys.A)); + _keys.Add((ImGuiKey.C, Keys.C)); + _keys.Add((ImGuiKey.V, Keys.V)); + _keys.Add((ImGuiKey.X, Keys.X)); + _keys.Add((ImGuiKey.Y, Keys.Y)); + _keys.Add((ImGuiKey.Z, Keys.Z)); + SetupInput(); } @@ -197,26 +217,6 @@ protected virtual void SetupInput() { var io = ImGui.GetIO(); - _keys.Add(io.KeyMap[(int)ImGuiKey.Tab] = (int)Keys.Tab); - _keys.Add(io.KeyMap[(int)ImGuiKey.LeftArrow] = (int)Keys.Left); - _keys.Add(io.KeyMap[(int)ImGuiKey.RightArrow] = (int)Keys.Right); - _keys.Add(io.KeyMap[(int)ImGuiKey.UpArrow] = (int)Keys.Up); - _keys.Add(io.KeyMap[(int)ImGuiKey.DownArrow] = (int)Keys.Down); - _keys.Add(io.KeyMap[(int)ImGuiKey.PageUp] = (int)Keys.PageUp); - _keys.Add(io.KeyMap[(int)ImGuiKey.PageDown] = (int)Keys.PageDown); - _keys.Add(io.KeyMap[(int)ImGuiKey.Home] = (int)Keys.Home); - _keys.Add(io.KeyMap[(int)ImGuiKey.End] = (int)Keys.End); - _keys.Add(io.KeyMap[(int)ImGuiKey.Delete] = (int)Keys.Delete); - _keys.Add(io.KeyMap[(int)ImGuiKey.Backspace] = (int)Keys.Back); - _keys.Add(io.KeyMap[(int)ImGuiKey.Enter] = (int)Keys.Enter); - _keys.Add(io.KeyMap[(int)ImGuiKey.Escape] = (int)Keys.Escape); - _keys.Add(io.KeyMap[(int)ImGuiKey.A] = (int)Keys.A); - _keys.Add(io.KeyMap[(int)ImGuiKey.C] = (int)Keys.C); - _keys.Add(io.KeyMap[(int)ImGuiKey.V] = (int)Keys.V); - _keys.Add(io.KeyMap[(int)ImGuiKey.X] = (int)Keys.X); - _keys.Add(io.KeyMap[(int)ImGuiKey.Y] = (int)Keys.Y); - _keys.Add(io.KeyMap[(int)ImGuiKey.Z] = (int)Keys.Z); - // MonoGame-specific ////////////////////// _game.Window.TextInput += (s, a) => { @@ -276,9 +276,9 @@ protected virtual void UpdateInput() var mouse = Mouse.GetState(); var keyboard = Keyboard.GetState(); - for (int i = 0; i < _keys.Count; i++) + foreach (var pair in _keys) { - io.KeysDown[_keys[i]] = keyboard.IsKeyDown((Keys)_keys[i]); + io.AddKeyEvent(pair.ImGuiKey, keyboard.IsKeyDown(pair.XnaKey)); } io.KeyShift = keyboard.IsKeyDown(Keys.LeftShift) || keyboard.IsKeyDown(Keys.RightShift); From bb15317f8531aae0c20650988d9a021e682fa4f5 Mon Sep 17 00:00:00 2001 From: kenjiuno Date: Fri, 22 Dec 2023 14:07:49 +0900 Subject: [PATCH 4/4] - Fix errors --- OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs b/OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs index b82de321f..f06175d63 100644 --- a/OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs +++ b/OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs @@ -191,7 +191,6 @@ private static void Tooltip(string description) bool isOpen = false; ImGui.Begin("Child Tooltip?", ref isOpen, ImGuiWindowFlags.Tooltip | ImGuiWindowFlags.NoTitleBar | - ImGuiWindowFlags.AlwaysUseWindowPadding | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize); ImGui.Text(description); @@ -288,7 +287,7 @@ public static bool Sequencer(SequenceInterface sequence, ref int currentFrame, r Vector2 childFramePos = ImGui.GetCursorScreenPos(); var childFrameSize = new Vector2(canvas_size.X, canvas_size.Y - 8f - headerSize.Y - (hasScrollBar ? scrollBarSize.Y : 0)); ImGui.PushStyleColor(ImGuiCol.FrameBg, 0); - ImGui.BeginChildFrame(889, childFrameSize); + ImGui.BeginChild(889, childFrameSize, ImGuiChildFlags.FrameStyle); sequence.focused = ImGui.IsWindowFocused(); ImGui.InvisibleButton("contentBar", new Vector2(canvas_size.X, (float)(controlHeight))); Vector2 contentMin = ImGui.GetItemRectMin(); @@ -709,7 +708,7 @@ public static bool Sequencer(SequenceInterface sequence, ref int currentFrame, r } // - ImGui.EndChildFrame(); + ImGui.EndChild(); ImGui.PopStyleColor(); if (hasScrollBar) {