Skip to content

Commit

Permalink
fix workflow build, fix headless
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdawson committed Jul 16, 2023
1 parent 147a03d commit 5e9ed2f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/godot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Build
run: dotnet build

- name: Download Godot
run: |
cd $HOME
wget https://github.com/godotengine/godot/releases/download/${{ env.gdver }}/Godot_v${{ env.gdver }}_mono_linux_x86_64.zip
unzip Godot_v${{ env.gdver }}_mono_linux_x86_64.zip
# HACK: no better solution for now
- name: Import resources
- name: Import resources and build
run: |
export gdbin=$HOME/Godot_v${{ env.gdver }}_mono_linux_x86_64/Godot_v${{ env.gdver }}_mono_linux.x86_64
timeout 45 $gdbin --headless --editor || true
$gdbin --headless --build-solutions --quit
# TODO: run tests with the exported binary
- name: Test
Expand Down
10 changes: 9 additions & 1 deletion addons/imgui-godot/ImGuiGodot/Internal/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ internal sealed class Input
private Vector2 _mouseWheel = Vector2.Zero;
private ImGuiMouseCursor _currentCursor = ImGuiMouseCursor.None;
private readonly Window _mainWindow;
private readonly bool _hasMouse;

public Input(Window mainWindow)
{
_mainWindow = mainWindow;
_hasMouse = DisplayServer.HasFeature(DisplayServer.Feature.Mouse);
}

public void Update(ImGuiIOPtr io)
private void UpdateMouse(ImGuiIOPtr io)
{
var mousePos = DisplayServer.MouseGetPosition();

Expand Down Expand Up @@ -66,6 +68,12 @@ public void Update(ImGuiIOPtr io)
{
_currentCursor = ImGuiMouseCursor.None;
}
}

public void Update(ImGuiIOPtr io)
{
if (_hasMouse)
UpdateMouse(io);

CurrentSubViewport = null;
}
Expand Down

0 comments on commit 5e9ed2f

Please sign in to comment.