Skip to content

Commit

Permalink
update for ImGui 1.89.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdawson committed Dec 23, 2022
1 parent 9d2b286 commit 011ac3b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/godot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
gdver: "4.0"
gdrel: beta8
gdrel: beta10

jobs:
export_game:
Expand Down
4 changes: 2 additions & 2 deletions Dear ImGui for Godot Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.0.0-beta.8">
<Project Sdk="Godot.NET.Sdk/4.0.0-beta.10">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
Expand All @@ -10,6 +10,6 @@
<EmbeddedResource Remove="doc\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.88.0" />
<PackageReference Include="ImGui.NET" Version="1.89.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dear ImGui plugin for Godot 4 (C#)

![](https://img.shields.io/static/v1?label=Godot%204.0&message=beta8&color=blue&logo=godotengine)
![](https://img.shields.io/static/v1?label=Godot%204.0&message=beta10&color=blue&logo=godotengine)
![](https://github.com/pkdawson/imgui-godot/actions/workflows/dotnet.yml/badge.svg)
![](https://github.com/pkdawson/imgui-godot/actions/workflows/godot.yml/badge.svg)

Expand Down
8 changes: 4 additions & 4 deletions addons/imgui-godot/ImGuiGodot/Internal/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ public static void ProcessNotification(long what)

private static void UpdateKeyMods(ImGuiIOPtr io)
{
io.AddKeyEvent(ImGuiKey.ModCtrl, Godot.Input.IsKeyPressed(Key.Ctrl));
io.AddKeyEvent(ImGuiKey.ModShift, Godot.Input.IsKeyPressed(Key.Shift));
io.AddKeyEvent(ImGuiKey.ModAlt, Godot.Input.IsKeyPressed(Key.Alt));
io.AddKeyEvent(ImGuiKey.ModSuper, Godot.Input.IsKeyPressed(Key.SuperL));
io.AddKeyEvent(ImGuiKey.ImGuiMod_Ctrl, Godot.Input.IsKeyPressed(Key.Ctrl));
io.AddKeyEvent(ImGuiKey.ImGuiMod_Shift, Godot.Input.IsKeyPressed(Key.Shift));
io.AddKeyEvent(ImGuiKey.ImGuiMod_Alt, Godot.Input.IsKeyPressed(Key.Alt));
io.AddKeyEvent(ImGuiKey.ImGuiMod_Super, Godot.Input.IsKeyPressed(Key.SuperL));
}

private static CursorShape ConvertCursorShape(ImGuiMouseCursor cur) => cur switch
Expand Down
25 changes: 10 additions & 15 deletions addons/imgui-godot/ImGuiGodot/Widgets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,28 @@ public static void Image(Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1,
ImGuiNative.igImage((IntPtr)tex.GetRid().Id, size, uv0, uv1, tint_col, border_col);
}

public static bool ImageButton(Texture2D tex, Vector2 size)
public static bool ImageButton(string str_id, Texture2D tex, Vector2 size)
{
return ImageButton(tex, size, Vector2.Zero, Vector2.One, -1, Vector4.Zero, Vector4.One);
return ImageButton(str_id, tex, size, Vector2.Zero, Vector2.One, Vector4.Zero, Vector4.One);
}

public static bool ImageButton(Texture2D tex, Vector2 size, Vector2 uv0)
public static bool ImageButton(string str_id, Texture2D tex, Vector2 size, Vector2 uv0)
{
return ImageButton(tex, size, uv0, Vector2.One, -1, Vector4.Zero, Vector4.One);
return ImageButton(str_id, tex, size, uv0, Vector2.One, Vector4.Zero, Vector4.One);
}

public static bool ImageButton(Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1)
public static bool ImageButton(string str_id, Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1)
{
return ImageButton(tex, size, uv0, uv1, -1, Vector4.Zero, Vector4.One);
return ImageButton(str_id, tex, size, uv0, uv1, Vector4.Zero, Vector4.One);
}

public static bool ImageButton(Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1, int frame_padding)
public static bool ImageButton(string str_id, Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 bg_col)
{
return ImageButton(tex, size, uv0, uv1, frame_padding, Vector4.Zero, Vector4.One);
return ImageButton(str_id, tex, size, uv0, uv1, bg_col, Vector4.One);
}

public static bool ImageButton(Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1, int frame_padding, Vector4 bg_col)
public static bool ImageButton(string str_id, Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1, Vector4 bg_col, Vector4 tint_col)
{
return ImageButton(tex, size, uv0, uv1, frame_padding, bg_col, Vector4.One);
}

public static bool ImageButton(Texture2D tex, Vector2 size, Vector2 uv0, Vector2 uv1, int frame_padding, Vector4 bg_col, Vector4 tint_col)
{
return ImGuiNative.igImageButton((IntPtr)tex.GetRid().Id, size, uv0, uv1, frame_padding, bg_col, tint_col) != 0;
return ImGui.ImageButton(str_id, (IntPtr)tex.GetRid().Id, size, uv0, uv1, bg_col, tint_col);
}
}
1 change: 1 addition & 0 deletions data/Hack-Regular.ttf.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
Expand Down
1 change: 1 addition & 0 deletions data/MPLUS2-Regular.ttf.import
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
Expand Down

0 comments on commit 011ac3b

Please sign in to comment.