feat(client): Text UI functions

This commit is contained in:
Luke
2022-04-11 15:59:18 +02:00
parent ff71a7d033
commit ed75b683d5
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
function lib.showTextUI(text, options)
if not options then options = {} end
options.text = text
SendNUIMessage({
action = 'textUi',
data = options
})
end
function lib.hideTextUI()
SendNUIMessage({
action = 'textUiHide'
})
end

View File

@@ -33,6 +33,7 @@ const TextUI: React.FC = () => {
const [visible, setVisible] = React.useState(false);
useNuiEvent<Props>("textUi", (data) => {
if (!data.position) data.position = "right-center"; // Default right position
setData(data);
setVisible(true);
});