> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edmortars/reference/menus.md).

# Menus (GUIs)

The unlock and upgrades menus are regular **PinnaPrison GUI files**, installed once into `plugins/PinnaPrison/guis/EdMortars/`:

| File                  | Opened                                                |
| --------------------- | ----------------------------------------------------- |
| `mortar-unlock.yml`   | clicking a locked mortar / `/mortar` while locked     |
| `mortar-upgrades.yml` | clicking an unlocked mortar / `/mortar` once unlocked |

Edit them like any PinnaPrison menu (title, rows, open-sound, items with material, `head-<name>` / `texture-<base64>` heads, name, lore, glow, click-sound, left-click-actions, update-interval...) and run `/pinna reload`. A mortar type can use other menus with `menus.unlock` / `menus.upgrades` in its file.

The defaults are clean vanilla chest menus: a glass frame, the mortar's stats, requirement items with progress bars, upgrade items with current → next values, cost, balance and level bars, the player's head, a live reload clock and a guide book.

## EdMortars items

Use them with `custom-item: { type: ... }`:

| Type                    | What it does                                                                                                                                                                                            |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `edmortars-info`        | Any item, drawn with the mortar's tokens. Give it `update-interval: 20` to keep `{cooldown}` counting.                                                                                                  |
| `edmortars-requirement` | One unlock requirement (`requirement: <id>`). `unmet-item:` is shown while it isn't met. Hidden when the mortar has no requirement with that id.                                                        |
| `edmortars-unlock`      | The unlock button. `unmet-item:` is shown while anything is missing.                                                                                                                                    |
| `edmortars-upgrade`     | Buys one level (`upgrade: chance\|multiplier\|radius`), shift-click buys several. `unmet-item:` when the next level can't be afforded, `maxed-item:` at max level. Hidden when the upgrade is disabled. |

```yaml
  upgrade-chance:
    custom-item:
      type: 'edmortars-upgrade'
      upgrade: chance
      unmet-item:
        material: FIRE_CHARGE
        name: '{upgrade} &8(&7Lv. {level}&8/&7{max-level}&8)'
        lore: [ ... ]
      maxed-item:
        material: FIRE_CHARGE
        glow: true
        name: '{upgrade} &8(&a&lMAXED&8)'
        lore: [ ... ]
    slot: '20'
    material: FIRE_CHARGE
    name: '{upgrade} &8(&7Lv. {level}&8/&7{max-level}&8)'
    lore:
      - '&8▪ &7Chance: &6{value}% &8→ &a{next-value}%'
      - '{progress-bar} &7{percent}%'
      - '&8▪ &7Cost: &e{cost} {currency}'
      - '&3[ᴄʟɪᴄᴋ ᴛᴏ ᴜᴘɢʀᴀᴅᴇ]'
```

## Tokens

On every EdMortars item and in the menu title:

`{mortar}` `{mortar-id}` `{player}` `{status}` `{cooldown}` `{reload}` `{shells}` `{chance}` `{multiplier}` `{radius}` `{<upgrade>-level}` `{<upgrade>-max-level}` `{<upgrade>-name}` `{requirements}` (one line per requirement) `{requirements-met}` `{requirements-total}` `{missing}`

Requirement items also: `{display}` `{amount}` `{current}` `{progress}` `{percent}` `{progress-bar}`

Upgrade items also: `{upgrade}` `{level}` `{next-level}` `{max-level}` `{value}` `{next-value}` `{cost}` `{currency}` `{balance}` `{needed}` `{percent}` `{progress-bar}`

Plain items (no `custom-item`) get the tokens as they were when the menu opened.

## Behaviour

* Buttons are throttled per player (`menus.click-cooldown-ms`); refused clicks play `menus.fail-sound`.
* After a purchase the menu redraws in place (no flicker, no re-open).
* Each mortar menu knows which mortar it belongs to through `{mortar-id}`; opened another way (an `open-gui` action), it shows the player's first mortar.

## Resource-pack menus

Background pictures in the title, your own button icons, tooltip frames and values drawn with your pack: see [Custom Textures & Resource-Pack Menus](/p/edmortars/reference/custom-textures.md).
