Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Fixed SetNuiFocus conflicts when focus hasn't previously been set #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/NUI/ElsUiPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ internal static void DisableUI()
{
Utils.DebugWriteLine("Disabling Ui");
API.SendNuiMessage("{\"type\":\"enableui\", \"enable\":false}");
API.SetNuiFocus(false, false);
if (_enabled == 2)
API.SetNuiFocus(false, false);
_enabled = 0;
}

Expand All @@ -74,7 +75,8 @@ internal static void ShowUI()
{
Utils.DebugWriteLine("Showing Ui");
API.SendNuiMessage("{\"type\":\"enableui\", \"enable\":true}");
API.SetNuiFocus(false, false);
if (_enabled == 2)
API.SetNuiFocus(false, false);
_enabled = 1;
}

Expand Down