Files
UE5-Modular-Game-Framework/docs/blueprints/13-polish/113_WBP_DebugMenu.md
Lefteris Notas 411edea8ce add blueprints
2026-05-19 13:22:27 +03:00

5.6 KiB
Raw Blame History

81 — WBP_DebugMenu

Blueprint Spec — UE 5.55.7


Parent Class

UserWidget

Dependencies

Purpose

Visual debug overlay menu for developers and QA testers. Provides categorized panels for toggling debug features, viewing runtime state (narrative, AI, events, inventory), adjusting world settings (time scale, lighting), and executing cheat commands from a user-friendly UI. Accessible via the ~ console toggle or from the BPC_DevCheatManager. Only available in non-shipping builds.

Enums

EDebugPanel

Value Description
Main Top-level menu
Cheats Cheat toggles
Performance FPS, memory, draw calls
AI AI state and debug vis
Narrative Quest/chapter state
World Time, lighting, weather
Camera Camera modes
Inventory Item list and manipulation
Events Dynamic event state

Variables

Name Type Description
Panels TMap<EDebugPanel, UUserWidget> Sub-panel references
ActivePanel EDebugPanel Currently visible
bIsOpen Bool Menu visible
bMinimized Bool Compact view
DebugConsoleText FText Command input

Functions

Name Inputs Outputs Description
OpenMenu Show debug menu
CloseMenu Hide debug menu
ToggleMenu Open/close
SwitchPanel Panel: EDebugPanel Change active panel
GetMinimumView Compact mode
ExecuteCommandFromUI Command: FString Run cheat
UpdateAIDebugDisplay Refresh AI info
UpdatePerformanceDisplay Metrics: FPerformanceMetrics Refresh FPS/stats
UpdateNarrativeStateDisplay Show story state
UpdateEventStateDisplay Show event state
ToggleGodModeUI Toggle from UI
ToggleNoClipUI Toggle from UI
ToggleCollisionDebug Toggle from UI
ToggleAIVisibility Toggle from UI
SetTimeScaleFromUI Scale: Float Slider control
SpawnItemFromUI ItemID: FString Drop-down spawn
SkipToChapterFromUI ChapterID: FString Drop-down skip

Blueprint Flow

[OpenMenu]
  └─► If bIsOpen: return
  └─► bIsOpen = true
  └─► Set input mode: GameAndUI (mouse cursor visible)
  └─► SetVisibility(Visible)
  └─► Default panel: Main
  └─► Pause game time (optional)
  └─► Bind keyboard shortcuts:
         Tab -> SwitchPanel(next)
         Esc -> CloseMenu
         F1 -> Cheats, F2 -> Performance, F3 -> AI
         F4 -> Narrative, F5 -> World, F6 -> Camera

[CloseMenu]
  └─► bIsOpen = false
  └─► Set input mode: GameOnly
  └─► SetVisibility(Collapsed)
  └─► Resume game time (if paused)

[SwitchPanel]
  └─► Hide all sub-panels
  └─► ActivePanel = Panel
  └─► Show corresponding sub-panel
  └─► Update displayed data:
         Performance -> Call BPC_FPSCounter.GetPerformanceSnapshot()
         AI -> Call BPC_AIDirector.GetDebugState()
         Narrative -> Call BPC_NarrativeState.GetCurrentChapter()
         Events -> Call BPC_DynamicEventSystem.GetActiveEvents()

[UI Layout]
  └─► Left sidebar: Panel selection buttons
  └─► Main content: Active panel content
  └─► Bottom bar: Command input field + Execute button + Minimize
  └─► Top bar: Indices for quick-nav, FPS counter overlay

[ExecuteCommandFromUI]
  └─► Get text from command input field
  └─► Pass to BPC_DevCheatManager.ExecuteCheat()
  └─► Clear input field
  └─► Add to command history
  └─► Show result feedback text (success/failure)

Event Dispatchers

Name Payload Description
OnDebugCommandExecuted Command: FString Command run
OnPanelChanged Panel: EDebugPanel Switch panels

Communications With

Target Method Why
BPC_DevCheatManager Direct call Execute commands
BPC_FPSCounter Direct call Performance data
BPC_AIDirector Direct call AI debug state
BPC_NarrativeState Direct call Story state
BPC_DynamicEventSystem Direct call Event debug
BPC_PlayerCamera Direct call Camera modes
BPC_DevCheatManager Direct call All cheat toggles

Reuse Notes

  • Panel-based architecture allows easy addition of new debug panels
  • All interactive elements bound to DevCheatManager functions
  • Comms-visible only; all logic lives in DevCheatManager
  • Command input field mirrors console functionality
  • Quick-nav keyboard shortcuts for common panels
  • Compact/minimized mode for minimal screen intrusion during gameplay
  • Designed for developer productivity, not end users