From 3d75766552367b03475eeedbc607dc74c29189e6 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 17 Sep 2022 14:32:19 +0200 Subject: [PATCH] fix documentation errors --- docs/ox_lib/Interface/Client/alert.md | 26 ++++++++++++++++++++++++ docs/ox_lib/Interface/Client/notify.md | 2 +- docs/ox_lib/Interface/Client/progress.md | 14 +++++++------ 3 files changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/ox_lib/Interface/Client/alert.md b/docs/ox_lib/Interface/Client/alert.md index 5176c4fe..f38f63ea 100644 --- a/docs/ox_lib/Interface/Client/alert.md +++ b/docs/ox_lib/Interface/Client/alert.md @@ -17,6 +17,10 @@ lib.alertDialog(data) +:::caution +This function is **asynchronous** requiring you to do a `.then` callback on the promise or make your function `async`. +::: + ```ts import lib from '@overextended/ox_lib/client' @@ -40,6 +44,9 @@ or has exited the dialog with ESC the return will be `cancel`. **Example:** + + + ```lua local alert = lib.alertDialog({ header = 'Hello there', @@ -50,5 +57,24 @@ local alert = lib.alertDialog({ print(alert) ``` + + + +```ts +import lib from '@overextended/ox_lib/client' + +const alert = await lib.alertDialog({ + header: 'Hello there', + content: 'General Kenobi \n Markdown support!', + centered: true, + cancel: true +}) + +console.log(alert) +``` + + + + ![alert_dialog](https://i.imgur.com/TnUT3S1.png) diff --git a/docs/ox_lib/Interface/Client/notify.md b/docs/ox_lib/Interface/Client/notify.md index f8a4d39f..f314db69 100644 --- a/docs/ox_lib/Interface/Client/notify.md +++ b/docs/ox_lib/Interface/Client/notify.md @@ -34,7 +34,7 @@ lib.notify(data) * duration?: `number` * position?: `'top'` or `'top-right'` or `'top-left'` or `'bottom'` or `'bottom-right'` or `'bottom-left'` * Default: `'top-right'` -* type: `'inform'` or `'error'` or `'success'` +* type?: `'inform'` or `'error'` or `'success'` * Default: `'inform'` * style?: `table` (`object`) * React CSS styling format diff --git a/docs/ox_lib/Interface/Client/progress.md b/docs/ox_lib/Interface/Client/progress.md index a49b240c..22d98082 100644 --- a/docs/ox_lib/Interface/Client/progress.md +++ b/docs/ox_lib/Interface/Client/progress.md @@ -121,10 +121,11 @@ if (await lib.progressBar({ }, prop: { model: `prop_ld_flow_bottle`, - pos: vec3(0.03, 0.03, 0.02), - rot: vec3(0.0, 0.0, -1.5) + pos: {x: 0.03, y: 0.03, z: 0.02}, + rot: {x: 0.0, y: 0.0, z: -1.5} }, -})) print('Do stuff when complete') else print('Do stuff when cancelled') +})) console.log('Do stuff when complete'); +else console.log('Do stuff when cancelled') ``` @@ -249,10 +250,11 @@ if (await lib.progressCircle({ }, prop: { model: `prop_ld_flow_bottle`, - pos: vec3(0.03, 0.03, 0.02), - rot: vec3(0.0, 0.0, -1.5) + pos: {x: 0.03, y: 0.03, z: 0.02}, + rot: {x: 0.0, y: 0.0, z: -1.5} }, -})) print('Do stuff when complete') else print('Do stuff when cancelled') +})) console.log('Do stuff when complete') +else console.log('Do stuff when cancelled') ```