Colobot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Ui::CDebugMenu Class Reference

Handles debug menu (F11) More...

#include <src/ui/debug_menu.h>

Public Member Functions

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

Protected Member Functions

void CreateInterface ()
 Create the main page of debug interface. More...
 
void CreateSpawnInterface ()
 Create the spawn object interface. More...
 
void UpdateInterface ()
 Update controls in the debug interface. More...
 
void DestroyInterface ()
 Destroy the debug interface window. More...
 
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

CRobotMainm_main
 
CInterfacem_interface
 
Gfx::CEnginem_engine
 
CObjectManagerm_objMan
 
CSoundInterfacem_sound
 
ObjectType m_spawningType = OBJECT_NULL
 
bool m_lightningActive = false
 
bool m_teleportActive = false
 

Detailed Description

Handles debug menu (F11)

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: