LB Tablet Here
Patch to properly close the tablet with ESC Here
Just drag the patch into the file
Here's what I did for those who know a little bit of coding.
Thank you @dawnduskyy for explaining the problem to me correctly.
In client/client.lua, the function that opens/closes the tablet (export ToggleOpen) calculates the target state incorrectly:
L3_2 = not L3_2 or L3_2 is always true (logical identity: ¬X ∨ X = true).if nil == A0_2 then
L3_2 = TabletOpen
end
L3_2 = not L3_2 or L3_2
L3_2 = true == L3_2
Result: L3_2 (the desired state) is always true ⇒ the function believes that we want to open the tablet.
Then, further on, there is a safeguard.
If the tablet is already open and we try to close it, as L3_2 is still true, we fall into “already open†and the function exits without executing SetNuiFocus(false,false), SendReactMessage("setVisibility", false), etc. → hence “the tablet does not closeâ€.if L3_2 == TabletOpen then
debugprint("ToggleOpen: already open/closed")
return
end
We replace this calculation with the correct logic:
if A0_2 (parameter) is nil → we toggle (not TabletOpen)
otherwise → we use exactly the passed value (A0_2)
- if nil == A0_2 then
- L3_2 = TabletOpen
- end
- L3_2 = not L3_2 or L3_2
+ if nil == A0_2 then
+ L3_2 = not TabletOpen
+else
+ L3_2 = A0_2
+ end
L3_2 = true == L3_2
Last edited: