# Inventool Confirm Prompt UGUI

## ❓ InventoolConfirmPromptUGUI Class

> **Namespace:** `Esper.Inventool.UI.UGUI`\
> **Access:** `public`\
> **Type:** `class`\
> **Inherits:** `CrossInputSupportedWindowUGUI`

***

### 📦 Fields

| Access      | Field                  | Type              | Description                         |
| ----------- | ---------------------- | ----------------- | ----------------------------------- |
| `protected` | `hiddenCloseButton`    | `Button`          | Full‑screen invisible close button. |
| `protected` | `titleLabel`           | `TextMeshProUGUI` | The title label.                    |
| `protected` | `descriptionLabel`     | `TextMeshProUGUI` | The description label.              |
| `protected` | `leftButton`           | `Button`          | The left button option.             |
| `protected` | `rightButton`          | `Button`          | The right button option.            |
| `protected` | `leftButtonIconImage`  | `Image`           | Left button icon element.           |
| `protected` | `rightButtonIconImage` | `Image`           | Right button icon element.          |
| `protected` | `leftButtonLabel`      | `TextMeshProUGUI` | The left button label.              |
| `protected` | `rightButtonLabel`     | `TextMeshProUGUI` | The right button label.             |
| `protected` | `leftButtonAction`     | `Action`          | The left button on‑click action.    |
| `protected` | `rightButtonAction`    | `Action`          | The right button on‑click action.   |

***

### 🔍 Properties

| Access   | Property   | Type                         | Description          |
| -------- | ---------- | ---------------------------- | -------------------- |
| `public` | `Instance` | `InventoolConfirmPromptUGUI` | The active instance. |

***

### 🧰 Methods

| Access               | Method                                                                                                                                                                                                                                                                                                                                                                   | Returns | Description                                                                       |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | --------------------------------------------------------------------------------- |
| `protected override` | `Awake()`                                                                                                                                                                                                                                                                                                                                                                | `void`  | Initializes singleton, wires buttons, closes initially.                           |
| `public virtual`     | `Open(string title, string description, Action leftButtonAction = null, Action rightButtonAction = null, bool showLeftButton = true, bool showRightButton = true, string leftButtonText = "Cancel", string rightButtonText = "Confirm", Sprite leftButtonIcon = null, Sprite rightButtonIcon = null, bool leftLabelIsNumeric = false, bool rightLabelIsNumeric = false)` | `void`  | Opens the prompt with optional actions, labels, icons, and localization handling. |
| `public virtual`     | `Close()`                                                                                                                                                                                                                                                                                                                                                                | `void`  | Closes the prompt and invokes `onClosed`.                                         |

## Active Instance

You can get the active `InventoolConfirmPromptUGUI` instance with `InventoolConfirmPromptUGUI.Instance`. Ensure there's an instance of it in your scene before using this field.

## Open

The `Open` method has many parameters you can use to customize what's displayed on the confirm prompt.

| Name                | Description                                                                      | Type   |
| ------------------- | -------------------------------------------------------------------------------- | ------ |
| title               | The prompt title or the localized string key if you're using localization.       | string |
| description         | The prompt description or the localized string key if you're using localization. | string |
| leftButtonAction    | The left button on-click action.                                                 | Action |
| rightButtonAction   | The right button on-click action.                                                | Action |
| showLeftButton      | If the left button should be displayed.                                          | bool   |
| showRightButton     | If the right button should be displayed.                                         | bool   |
| leftButtonText      | The left button text or the localized string key if you're using localization.   | string |
| rightButtonText     | The right button text or the localized string key if you're using localization.  | string |
| leftButtonIcon      | The left button icon.                                                            | Sprite |
| rightButtonIcon     | The right button icon.                                                           | Sprite |
| leftLabelIsNumeric  | If the left label is numeric (localization disabled).                            | bool   |
| rightLabelIsNumeric | If the right label is numeric (localization disabled).                           | bool   |

```csharp
InventoolConfirmPromptUGUI.Instance.Open("My Title", "My Description");
```

## Close

```csharp
InventoolConfirmPromptUGUI.Instance.Close();
```
