frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
loading="lazy">
[size=6]LB Tablet Here[/size]
[size=6]Patch to properly close the tablet with ESC Here[/size]
[size=7][color=rgb(226,]Just drag the patch into the file[/color][/size]
[color=rgb(250,][size=6]Here's what I did for those who know a little bit of coding.[/size][/color]
[size=6][color=rgb(250,]Thank you[/color][color=rgb(41,]@@dawnduskyy[/color] [color=rgb(250,]for explaining the problem to me correctly.[/color][/size]
In client/client.lua, the function that opens/closes the tablet (export ToggleOpen) calculates the target state incorrectly:
if nil == A0_2 then
L3_2 = TabletOpen
end
L3_2 = not L3_2 or L3_2
L3_2 = true == L3_2
L3_2 = TabletOpen
end
L3_2 = not L3_2 or L3_2
L3_2 = true == L3_2
L3_2 = not L3_2 or L3_2 is always true (logical identity: ¬X ∨ X = true).
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 L3_2 == TabletOpen then
debugprint("ToggleOpen: already open/closed")
return
end
debugprint("ToggleOpen: already open/closed")
return
end
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â€Â.
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...
- 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...
Reactions are only available for posts