> For the complete documentation index, see [llms.txt](https://codeforge.gitbook.io/codeforge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codeforge.gitbook.io/codeforge/sleek-series/sleek-pause-menu/exports.md).

# Exports

**Pause Menu Exports Documentation**

The `forge-pausemenu` script includes exports designed to handle cases where the Pause Menu might unintentionally appear when pressing the `ESCAPE` key, especially while other user interfaces (UI) are active.

#### Why These Exports Are Needed

While the script uses `SEND NUI` communication from other scripts to detect if a UI is open and prevent the Pause Menu from appearing, there are situations where interfaces don't utilize this mechanism. In these cases, pressing `ESCAPE` can still bring up the Pause Menu unintentionally. To address this, `forge-pausemenu` provides the following exports for explicit control over the menu's behavior.

#### Exports Overview

* **`disableMenu`**\
  Forces the Pause Menu to be disabled, regardless of other conditions. This is useful to ensure the menu does not appear during interactions with UIs that don't trigger `SEND NUI`.

  ```lua
  exports['forge-pausemenu']:disableMenu()
  ```
* **`enableMenu`**\
  Re-enables the Pause Menu after being force-disabled, allowing it to function normally when no UI is active.

  ```lua
  exports['forge-pausemenu']:enableMenu()
  ```
* **`setMenuState(state)`**\
  Directly sets the state of the Pause Menu (`true` for enabled, `false` for disabled). This is a flexible way to control the menu based on your script's logic.

  * **Parameter:**
    * `state` *(boolean)*: The desired state of the Pause Menu.

  ```lua
  exports['forge-pausemenu']:setMenuState(false)
  ```
* **`getMenuState`**\
  Returns the current state of the Pause Menu, considering both the enabled/disabled state and any force-disable flag.

  * **Returns:**
    * *(boolean)*: `true` if the menu is enabled and not force-disabled, `false` otherwise.

  ```lua
  local isMenuActive = exports['forge-pausemenu']:getMenuState()
  ```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://codeforge.gitbook.io/codeforge/sleek-series/sleek-pause-menu/exports.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
