Skip to content

Commit

Permalink
Merge pull request #939 from OpenKH/dependabot/nuget/ImGui.NET-1.90.0.1
Browse files Browse the repository at this point in the history
Bump ImGui.NET from 1.89.9.3 to 1.90.0.1
  • Loading branch information
kenjiuno authored Dec 22, 2023
2 parents 6690dcb + bb15317 commit 3f9b213
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion OpenKh.Tools.BbsMapStudio/OpenKh.Tools.BbsMapStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
<PackageReference Include="AssimpNet" Version="5.0.0-beta1" />
Expand Down
2 changes: 1 addition & 1 deletion OpenKh.Tools.Common.CustomImGui/ImGuiEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public static void ForMenuCheck(string name, Func<bool> getter, Action<bool> 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();

Expand Down
46 changes: 23 additions & 23 deletions OpenKh.Tools.Common.CustomImGui/MonoGameImGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static DrawVertDeclaration()
// Input
private int _scrollWheelValue;

private List<int> _keys = new List<int>();
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;
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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) =>
{
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion OpenKh.Tools.Kh2MapStudio/OpenKh.Tools.Kh2MapStudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
<PackageReference Include="AssimpNet" Version="5.0.0-beta1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
<PackageReference Include="AssimpNet" Version="5.0.0-beta1" />
Expand Down
5 changes: 2 additions & 3 deletions OpenKh.Tools.LayoutEditor/Controls/ImSequencer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -709,7 +708,7 @@ public static bool Sequencer(SequenceInterface sequence, ref int currentFrame, r
}
//

ImGui.EndChildFrame();
ImGui.EndChild();
ImGui.PopStyleColor();
if (hasScrollBar)
{
Expand Down
2 changes: 1 addition & 1 deletion OpenKh.Tools.LayoutEditor/OpenKh.Tools.LayoutEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="ImGui.NET" Version="1.90.0.1" />
<PackageReference Include="MonoGame.Content.Builder" Version="3.7.0.9" />
<PackageReference Include="MonoGame.Framework.DesktopGL.Core" Version="3.7.0.7" />
</ItemGroup>
Expand Down

0 comments on commit 3f9b213

Please sign in to comment.