Loading...
Searching...
No Matches
Ui::CDebugMenu Class Reference

Handles debug menu (F10). More...

`#include <src/ui/debug_menu.h>`

## Public Member Functions

| CDebugMenu (CRobotMain *main, Gfx::CEngine *engine, CObjectManager *objMan, CSoundInterface *sound)
| Creates the CDebugMenu instance.
virtual | ~CDebugMenu ()
void | ToggleInterface ()
| Toggle the debug interface.
bool | IsActive ()
| Check if the debug interface is open.
bool | EventProcess (const Event &event)
| Event processing.

## Protected Member Functions

void | CreateInterface ()
| Create the main page of debug interface.
void | CreateSpawnInterface ()
| Create the spawn object interface.
void | UpdateInterface ()
| Update controls in the debug interface.
void | DestroyInterface ()
| Destroy the debug interface window.
void | HandleFrameUpdate (const Event &event)
bool | HandleSpawnObject (ObjectType type, Math::Point mousePos)
bool | HandleLightning (Math::Point mousePos)
bool | HandleTeleport (Math::Point mousePos)
bool | HandleCopy (Math::Point mousePos)

## Protected Attributes

CRobotMain * | m_main
CInterface * | m_interface
Gfx::CEngine * | m_engine
CObjectManager * | m_objMan
CSoundInterface * | m_sound
ObjectType | m_spawningType = OBJECT_NULL
bool | m_lightningActive = false
bool | m_teleportActive = false

## Detailed Description

Handles debug menu (F10).

There should always be only one instance of this class for each associated CRobotMain class.

## Constructor & Destructor Documentation

## CDebugMenu()

Ui::CDebugMenu::CDebugMenu | ( | CRobotMain * | main,
|  | Gfx::CEngine * | engine,
|  | CObjectManager * | objMan,
|  | CSoundInterface * | sound )

Creates the CDebugMenu instance.

## ~CDebugMenu()

Ui::CDebugMenu::~CDebugMenu | ( |  | ) |

virtual

Destroys the CDebugMenu instance

Note
  Does not clean up the interface, should be called only when CRobotMain is destroyed

## Member Function Documentation

## ToggleInterface()

void Ui::CDebugMenu::ToggleInterface | ( |  | ) |

Toggle the debug interface.

## IsActive()

bool Ui::CDebugMenu::IsActive | ( |  | ) |

Check if the debug interface is open.

## EventProcess()

bool Ui::CDebugMenu::EventProcess | ( | const Event & | event | ) |

Event processing.

## CreateInterface()

void Ui::CDebugMenu::CreateInterface | ( |  | ) |

protected

Create the main page of debug interface.

## CreateSpawnInterface()

void Ui::CDebugMenu::CreateSpawnInterface | ( |  | ) |

protected

Create the spawn object interface.

## UpdateInterface()

void Ui::CDebugMenu::UpdateInterface | ( |  | ) |

protected

Update controls in the debug interface.

## DestroyInterface()

void Ui::CDebugMenu::DestroyInterface | ( |  | ) |

protected

Destroy the debug interface window.

## HandleFrameUpdate()

void Ui::CDebugMenu::HandleFrameUpdate | ( | const Event & | event | ) |

protected

Handle frame update This is used to update the cursor coordinates overlay

## HandleSpawnObject()

bool Ui::CDebugMenu::HandleSpawnObject | ( | ObjectType | type,
|  | Math::Point | mousePos )

protected

Handle spawning a new object at mouse position

Returns
  true on success, false on error

## HandleLightning()

bool Ui::CDebugMenu::HandleLightning | ( | Math::Point | mousePos | ) |

protected

Handle lightning at position

Returns
  true on success, false on error

## HandleTeleport()

bool Ui::CDebugMenu::HandleTeleport | ( | Math::Point | mousePos | ) |

protected

Handle teleport to position

Returns
  true on success, false on error

## HandleCopy()

bool Ui::CDebugMenu::HandleCopy | ( | Math::Point | mousePos | ) |

protected

Handle ctrl+c (copy coordinates under cursor to clipboard)

Returns
  true on success, false on error

The documentation for this class was generated from the following files:

- src/ui/debug_menu.h
- src/ui/debug_menu.cpp