# Projecte 2026 - Console Commands
# Metadata for the in-game console command system.
# Execution logic stays in C++; this file defines metadata only.
#
# Fields:
#   keyword          - Command name (uppercase)
#   handler          - C++ handler function identifier
#   description      - Short description for help output
#   usage            - Full usage string for terminal help
#   instant          - (optional) Skip typewriter effect (default: false)
#   hidden           - (optional) Hide from TAB completion (default: false)
#   debug_only       - (optional) Only available in debug builds (default: false)
#   help_hidden      - (optional) Don't show in help output (default: false)
#   dynamic_completions - (optional) Completions generated at runtime (default: false)
#   completions      - (optional) Static TAB completion tree
#   debug_extras     - (optional) Overrides applied in debug builds
#   scope            - (optional) Visibility scope: global, game, editor, debug (default: global)
#                      Can be a string or a list. Categories can set a default scope for all commands.

categories:
  - name: VIDEO
    scope: game
    commands:
      - keyword: SS
        handler: cmd_ss
        description: Supersampling
        usage: "SS [ON|OFF|SIZE|UPSCALE [NEAREST|LINEAR]|DOWNSCALE [BILINEAR|LANCZOS2|LANCZOS3]]"
        completions:
          SS: [ON, OFF, SIZE, UPSCALE, DOWNSCALE]
          SS UPSCALE: [NEAREST, LINEAR]
          SS DOWNSCALE: [BILINEAR, LANCZOS2, LANCZOS3]

      - keyword: SHADER
        handler: cmd_shader
        description: "Toggle/select shader (F4)"
        usage: "SHADER [ON|OFF|NEXT|POSTFX|CRTPI|PRESET [NEXT|PREV|<name>]]"
        completions:
          SHADER: [ON, OFF, NEXT, POSTFX, CRTPI, PRESET]
        dynamic_completions: true

      - keyword: BORDER
        handler: cmd_border
        description: "Decorative border (B)"
        usage: "BORDER [ON|OFF]"
        completions:
          BORDER: [ON, OFF]

      - keyword: FULLSCREEN
        handler: cmd_fullscreen
        description: "Fullscreen mode (F3)"
        usage: "FULLSCREEN [ON|OFF]"
        completions:
          FULLSCREEN: [ON, OFF]

      - keyword: ZOOM
        handler: cmd_zoom
        description: "Window zoom (F1/F2)"
        usage: "ZOOM [UP|DOWN|<1-N>]"
        completions:
          ZOOM: [UP, DOWN]

      - keyword: INTSCALE
        handler: cmd_intscale
        description: "Integer scaling (F7)"
        usage: "INTSCALE [ON|OFF]"
        completions:
          INTSCALE: [ON, OFF]

      - keyword: VSYNC
        handler: cmd_vsync
        description: "Vertical sync"
        usage: "VSYNC [ON|OFF]"
        completions:
          VSYNC: [ON, OFF]

      - keyword: DRIVER
        handler: cmd_driver
        description: "GPU driver (restart to apply)"
        usage: "DRIVER [LIST|AUTO|NONE|<name>]"
        completions:
          DRIVER: [LIST, AUTO, NONE]

      - keyword: PALETTE
        handler: cmd_palette
        description: "Color palette (F5/F6)"
        usage: "PALETTE [NEXT|PREV|SORT [ORIGINAL|LUMINANCE|SPECTRUM]|DEFAULT|<name>]"
        completions:
          PALETTE SORT: [ORIGINAL, LUMINANCE, SPECTRUM]
        dynamic_completions: true

  - name: AUDIO
    scope: game
    commands:
      - keyword: AUDIO
        handler: cmd_audio
        description: Audio master
        usage: "AUDIO [ON|OFF|VOL <0-100>]"
        completions:
          AUDIO: [ON, OFF, VOL]

      - keyword: MUSIC
        handler: cmd_music
        description: Music volume
        usage: "MUSIC [ON|OFF|VOL <0-100>]"
        completions:
          MUSIC: [ON, OFF, VOL]

      - keyword: SOUND
        handler: cmd_sound
        description: Sound volume
        usage: "SOUND [ON|OFF|VOL <0-100>]"
        completions:
          SOUND: [ON, OFF, VOL]

  - name: GAME
    scope: game
    commands:
      - keyword: PLAYER
        handler: cmd_player
        description: "Player skin and color"
        usage: "PLAYER SKIN <name> | PLAYER COLOR <0-15>|DEFAULT"
        completions:
          PLAYER: [SKIN, COLOR]
          PLAYER SKIN: [DEFAULT, ABAD, BATMAN, CHIP, CONGO, JEANNINE, MUMMY, UPV_STUDENT]
          PLAYER COLOR: [DEFAULT]

      - keyword: RESTART
        handler: cmd_restart
        description: Restart from the beginning
        usage: RESTART
        instant: true

      - keyword: KIOSK
        handler: cmd_kiosk
        description: Enable kiosk mode
        usage: "KIOSK [ON]"
        completions:
          KIOSK: [ON]

      - keyword: EXIT
        handler: cmd_exit
        description: Quit application
        usage: EXIT
        instant: true
        scope: global

      - keyword: QUIT
        handler: cmd_quit
        description: Quit application
        usage: QUIT
        instant: true
        help_hidden: true
        scope: global

  - name: INFO
    scope: global
    commands:
      - keyword: SHOW
        handler: cmd_show
        description: Show info overlay
        usage: "SHOW [INFO]"
        completions:
          SHOW: [INFO]
        debug_extras:
          description: "Show overlay/test notification"
          usage: "SHOW [INFO|NOTIFICATION|CHEEVO]"
          completions:
            SHOW: [INFO, NOTIFICATION, CHEEVO]

      - keyword: HIDE
        handler: cmd_hide
        description: Hide info overlay
        usage: "HIDE [INFO]"
        completions:
          HIDE: [INFO]

      - keyword: SIZE
        handler: cmd_size
        description: Window size in pixels
        usage: SIZE

      - keyword: HELP
        handler: cmd_help
        description: "Show this help"
        usage: "HELP [<command>]"
        dynamic_completions: true

      - keyword: "?"
        handler: cmd_help
        help_hidden: true

  - name: DEBUG
    debug_only: true
    scope: debug
    commands:
      - keyword: DEBUG
        handler: cmd_debug
        description: "Debug mode and start options (F12)"
        usage: "DEBUG [MODE [ON|OFF]|START [HERE|ROOM|POS|SCENE <name>]]"
        completions:
          DEBUG: [MODE, START]
          DEBUG MODE: [ON, OFF]
          DEBUG START: [HERE, ROOM, POS, SCENE]
          DEBUG START SCENE: [LOGO, LOADING, TITLE, CREDITS, GAME, ENDING, ENDING2]

      - keyword: ITEMS
        handler: cmd_items
        description: "Set item count (GAME only)"
        usage: "ITEMS <0-200>"

      - keyword: ROOM
        handler: cmd_room
        description: "Change to room number (GAME only)"
        usage: "ROOM <1-60>|NEXT|PREV|LEFT|RIGHT|UP|DOWN"
        scope: [debug, editor]
        completions:
          ROOM: [NEXT, PREV, LEFT, RIGHT, UP, DOWN, NEW, DELETE]
          ROOM NEW: [LEFT, RIGHT, UP, DOWN]

      - keyword: SCENE
        handler: cmd_scene
        description: Change scene
        usage: "SCENE [LOGO|LOADING|TITLE|CREDITS|GAME|ENDING|ENDING2|RESTART]"
        completions:
          SCENE: [LOGO, LOADING, TITLE, CREDITS, GAME, ENDING, ENDING2, RESTART]

      - keyword: EDIT
        handler: cmd_edit
        description: "Map editor mode (GAME only)"
        usage: "EDIT [ON|OFF|REVERT|SHOW|HIDE|DRAW|COLLISION|MAPBG|MAPCONN] [...]"
        scope: [debug, editor]
        dynamic_completions: true
        completions:
          EDIT: [ON, OFF, REVERT, SHOW, HIDE, DRAW, COLLISION, MAPBG, MAPCONN]
          EDIT SHOW: [INFO, GRID]
          EDIT HIDE: [INFO, GRID]

  - name: EDITOR
    debug_only: true
    scope: editor
    commands:
      - keyword: ENEMY
        handler: cmd_enemy
        description: "Add, delete or duplicate enemy"
        usage: "ENEMY <ADD|DELETE|DUPLICATE>"
        completions:
          ENEMY: [ADD, DELETE, DUPLICATE]

      - keyword: ITEM
        handler: cmd_item
        description: "Add, delete or duplicate item"
        usage: "ITEM <ADD|DELETE|DUPLICATE>"
        completions:
          ITEM: [ADD, DELETE, DUPLICATE]

      - keyword: SET
        handler: cmd_set
        description: "Set property (enemy, item or room)"
        usage: "SET <property> <value>"
        dynamic_completions: true
        completions:
          SET FLIP: [ON, OFF]
          SET MIRROR: [ON, OFF]
          SET CONVEYOR: [LEFT, NONE, RIGHT]

  - name: CHEATS
    scope: [game, editor]
    commands:
      - keyword: CHEAT
        handler: cmd_cheat
        description: "Game cheats (GAME only)"
        usage: "CHEAT [INFINITE LIVES|INVINCIBILITY|OPEN THE JAIL|CLOSE THE JAIL]"
        hidden: true
        help_hidden: true
        completions:
          CHEAT: [INFINITE, INVINCIBILITY, OPEN, CLOSE]
          CHEAT INFINITE: [LIVES]
          CHEAT INFINITE LIVES: [ON, OFF]
          CHEAT INVINCIBILITY: [ON, OFF]
          CHEAT OPEN: [THE]
          CHEAT OPEN THE: [JAIL]
          CHEAT CLOSE: [THE]
          CHEAT CLOSE THE: [JAIL]
        debug_extras:
          hidden: false
          help_hidden: false
