Skip to content

Commit

Permalink
replace ImGuiController and support non QWERTY keyboard layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jupahe64 committed Nov 10, 2023
1 parent 5f4c322 commit ff38098
Show file tree
Hide file tree
Showing 7 changed files with 888 additions and 9 deletions.
10 changes: 6 additions & 4 deletions Fushigi/Fushigi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@

<ItemGroup>
<PackageReference Include="FuzzySharp" Version="2.0.2" />
<PackageReference Include="ImGui.NET" Version="1.89.9.3" />
<PackageReference Include="NativeFileDialogSharp" Version="0.6.0-alpha" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Silk.NET.Core" Version="2.17.1" />
<PackageReference Include="Silk.NET.GLFW" Version="2.17.1" />
<PackageReference Include="Silk.NET.Input" Version="2.17.1" />
<PackageReference Include="Silk.NET.OpenGL.Extensions.ImGui" Version="2.17.1" />
<PackageReference Include="Silk.NET.Core" Version="2.18.0" />
<PackageReference Include="Silk.NET.GLFW" Version="2.18.0" />
<PackageReference Include="Silk.NET.OpenGL" Version="2.18.0" />
<PackageReference Include="Silk.NET.Input" Version="2.18.0" />
<PackageReference Include="Silk.NET.Input.Extensions" Version="2.18.0" />
<PackageReference Include="StbImageSharp" Version="2.27.13" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.3" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion Fushigi/course/Course.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using ImGuiNET;
using Fushigi.util;
using Fushigi.windowing;
using Silk.NET.OpenGL.Extensions.ImGui;
using Fushigi.Byml;
using Fushigi.Byml.Writer;
using Fushigi.Byml.Writer.Primitives;
Expand Down
1 change: 0 additions & 1 deletion Fushigi/ui/MainWindow.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Fushigi.util;
using Fushigi.windowing;
using Silk.NET.OpenGL.Extensions.ImGui;
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
using Fushigi.param;
Expand Down
4 changes: 2 additions & 2 deletions Fushigi/ui/widgets/CourseScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void DrawUI(GL gl)
ImGui.GetWindowDrawList().AddRectFilled(topLeft, topLeft + size, 0x44000000);

//Allow button press, align to top of the screen
ImGui.SetItemAllowOverlap();
ImGui.SetNextItemAllowOverlap();
ImGui.SetCursorScreenPos(topLeft);

//Load popup when button is pressed
Expand Down Expand Up @@ -729,7 +729,7 @@ private void CourseUnitView(CourseUnitHolder unitHolder)
rail.Visible = unit.Visible;
}
}
ImGui.SetItemAllowOverlap();
ImGui.SetNextItemAllowOverlap();
ImGui.SameLine();

if (ImGui.Selectable(name, mSelectedUnit == unit))
Expand Down
7 changes: 7 additions & 0 deletions Fushigi/util/MathUtil.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Numerics;
using System.Text;
Expand All @@ -9,6 +10,12 @@ namespace Fushigi.util
{
internal static class MathUtil
{
[Pure]
public static float Clamp(float value, float min, float max)
{
return value < min ? min : value > max ? max : value;
}

public static int PolygonWindingNumber(Vector2 p, Span<Vector2> points)
{
static float isLeft(Vector2 p0, Vector2 p1, Vector2 point) =>
Expand Down
Loading

0 comments on commit ff38098

Please sign in to comment.