From 46f333269598c7f42459d14c3f4ef6582b66fb35 Mon Sep 17 00:00:00 2001 From: rob1997 Date: Thu, 12 Dec 2024 12:29:05 +0300 Subject: [PATCH 1/4] extending UI added --- docs/v2.6/23_extending-ui.md | 40 ++++++++++++++++++++++++++++++++++++ sidebars.js | 1 + 2 files changed, 41 insertions(+) create mode 100644 docs/v2.6/23_extending-ui.md diff --git a/docs/v2.6/23_extending-ui.md b/docs/v2.6/23_extending-ui.md new file mode 100644 index 00000000..eded46a9 --- /dev/null +++ b/docs/v2.6/23_extending-ui.md @@ -0,0 +1,40 @@ +--- +slug: /current/extending-ui +sidebar_position: 23 +sidebar_label: Extending UI +--- + +# Extending UI + +:::info + +This page shows you how to extend UI for the SDK. + +::: + +To Extend UI for the SDK, you can create your own UI scripts that inherit from `GuiScreen` + +## Overlays + +There are three overlay types `GuiOverlayManager.GuiOverlayType` available in the SDK: + +1. **Error :** Displays an error message. +2. **Loading :** Displays a message with a loading spinner. +3. **Toast :** Displays a toast message with a timeout. + +### Usage + +To show an overlay, you can call the following method: + +```csharp +int GuiManager.Instance.Overlays.Show(GuiOverlayType type, string message, bool deactivateOnClick, Action onClose = null, float timeOut = 0) +``` + +| **Name** | **Type** | **Description** | +|---------------------|------------------|------------------------------------------------------------------------------------------------------| +| `type` | `GuiOverlayType` | Type of the overlay, it be `Error`, `Loading` or `Toast` | +| `message` | `string` | Message to display in overlay | +| `deactivateOnClick` | `bool` | Can overlay be closed on click | +| `onClose` | `Action` | Callback to be invoked when overlay is closed | +| `timeOut` | `float` | Time in seconds after which overlay should be closed, if it is equal to 0 then it has has no timeout | + diff --git a/sidebars.js b/sidebars.js index 6e749abd..1ae0c07e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -35,6 +35,7 @@ module.exports = { 'v2.6/ramp', 'v2.6/lootboxes', 'v2.6/extending-the-sdk', + 'v2.6/extending-ui', ], }, { From 6cc03984019eb8e0411d93fcbe21aaac36c50f18 Mon Sep 17 00:00:00 2001 From: rob1997 Date: Thu, 12 Dec 2024 13:06:54 +0300 Subject: [PATCH 2/4] spell check ifx xD --- dictionary.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dictionary.txt b/dictionary.txt index a1773543..2b77e4e4 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -120,6 +120,7 @@ Ethereum EVM evm-blockchain extending-the-sdk +extending-ui faq fix-namespaces fullscreen @@ -367,4 +368,4 @@ Localhost localhost:8000 https Brotli -LoginProvider \ No newline at end of file +LoginProvider From 5c03fb0c8e80a8ec65d1f327ba5fe06aa6e5d84e Mon Sep 17 00:00:00 2001 From: rob1997 Date: Thu, 12 Dec 2024 13:13:26 +0300 Subject: [PATCH 3/4] spell checker fix --- dictionary.txt | 1 - docs/v2.6/23_extending-ui.md | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dictionary.txt b/dictionary.txt index 2b77e4e4..3defec19 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -120,7 +120,6 @@ Ethereum EVM evm-blockchain extending-the-sdk -extending-ui faq fix-namespaces fullscreen diff --git a/docs/v2.6/23_extending-ui.md b/docs/v2.6/23_extending-ui.md index eded46a9..ecfc8964 100644 --- a/docs/v2.6/23_extending-ui.md +++ b/docs/v2.6/23_extending-ui.md @@ -30,11 +30,11 @@ To show an overlay, you can call the following method: int GuiManager.Instance.Overlays.Show(GuiOverlayType type, string message, bool deactivateOnClick, Action onClose = null, float timeOut = 0) ``` -| **Name** | **Type** | **Description** | -|---------------------|------------------|------------------------------------------------------------------------------------------------------| -| `type` | `GuiOverlayType` | Type of the overlay, it be `Error`, `Loading` or `Toast` | -| `message` | `string` | Message to display in overlay | -| `deactivateOnClick` | `bool` | Can overlay be closed on click | -| `onClose` | `Action` | Callback to be invoked when overlay is closed | -| `timeOut` | `float` | Time in seconds after which overlay should be closed, if it is equal to 0 then it has has no timeout | +| **Name** | **Type** | **Description** | +|---------------------|------------------|--------------------------------------------------------------------------------------------------| +| `type` | `GuiOverlayType` | Type of the overlay, it be `Error`, `Loading` or `Toast` | +| `message` | `string` | Message to display in overlay | +| `deactivateOnClick` | `bool` | Can overlay be closed on click | +| `onClose` | `Action` | Callback to be invoked when overlay is closed | +| `timeOut` | `float` | Time in seconds after which overlay should be closed, if it is equal to 0 then it has no timeout | From cee3858b8935bec39d807592bc66b9bfe551bcec Mon Sep 17 00:00:00 2001 From: rob1997 Date: Thu, 12 Dec 2024 13:17:40 +0300 Subject: [PATCH 4/4] added new words to dictionary.txt --- dictionary.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dictionary.txt b/dictionary.txt index 3defec19..ba16924a 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -82,6 +82,7 @@ cryptographically Ctrl Docusaurus DApp +deactivateOnClick devs dev devsetup @@ -120,6 +121,7 @@ Ethereum EVM evm-blockchain extending-the-sdk +extending-ui faq fix-namespaces fullscreen @@ -147,6 +149,9 @@ GitHub github Goerli's goerliETH +GuiOverlayManager +GuiScreen +GuiOverlayType how-tos HTTPS HyperPlay