A class used to manipulate developer utilities.
This class is used to display an overlay on top of the app which lists dev widgets. Each widget controls a single debug utility.
The method used to activate the dev panel depends on the platform on which the app runs:
Note that some platforms support multiple activation methods.
The dev panel is typically only available for Debug builds. However, it can be made available on Release builds by calling the CYIApp::InitializeDevPanel function.
The following describes the various components that make up the dev panel system:
debug-tools
optional module.#include <debug/YiDevPanel.h>
Public Types | |
enum | InsertPosition { InsertPosition::Top, InsertPosition::Bottom } |
Public Member Functions | |
CYIDevPanel (CYIApp *pApp) | |
~CYIDevPanel () | |
void | Open () |
void | Close () |
void | ToggleVisibility () |
bool | IsActive () const |
bool | IsVisible () const |
bool | IsConfigurationSubpanelOpen () const |
void | AddWidget (std::unique_ptr< CYIDevWidget > pWidget, InsertPosition insertPosition=InsertPosition::Top) |
void | UpdateWidget (size_t indexInPanel) |
template<class T > | |
T * | GetWidget () const |
std::vector< CYIDevWidget * > | GetWidgets () const |
CYIApp * | GetApp () const |
CYIRenderingSurfaceInfo * | GetRenderingSurfaceInfo () const |
CYISceneManager * | GetSceneManager () const |
CYISceneView * | GetWidgetsContainer () const |
void | SimulatePanelItemClicked (size_t index) |
void | SimulateConfigurationItemClicked (size_t widgetIndex, size_t itemIndex) |
void | OpenConfigurationSubpanel (CYIDevWidget *pWidget, const std::vector< std::pair< CYIString, CYIString >> &items) |
void | CloseConfigurationSubpanel () |
void | ReconfigureConfigurationSubpanel (CYIDevWidget *pWidget) |
virtual bool | Update (bool *pSkipUpdate=nullptr) override |
virtual void | Draw () override |
![]() | |
virtual | ~CYIDevPanelBase ()=default |
![]() | |
CYISignalHandler () | |
CYISignalHandler (const CYISignalHandler &signalHandler) | |
virtual | ~CYISignalHandler () |
CYISignalHandler & | operator= (const CYISignalHandler &signalHandler) |
void | MoveToThread (CYIThread *pThread) |
This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More... | |
CYIThreadHandle | GetThreadAffinity () const |
void | SetThreadAffinity (const CYIThreadHandle &threadAffinity) |
virtual bool | IsConnected () const |
virtual bool | IsConnected (const CYISignalBase &signal) const |
void | Disconnect (CYISignalBase &signal) |
void | DisconnectFromAllSignals () |
![]() | |
Listener () | |
virtual | ~Listener () |
virtual void | OnThreadStarted (CYIThread *) |
virtual void | OnThreadTerminated (CYIThread *) |
virtual void | OnThreadFinished (CYIThread *) |
![]() | |
CYIEventFilter () | |
CYIEventFilter (const CYIEventFilter &other) | |
virtual | ~CYIEventFilter () |
CYIEventFilter & | operator= (const CYIEventFilter &other) |
Public Attributes | |
CYISignal | UserActivated |
CYISignal | UserDeactivated |
Additional Inherited Members | |
![]() | |
static const CYIString | DEV_PANEL_ASSETS_PREFIX |
![]() | |
CYIDevPanelBase ()=default | |
|
strong |
CYIDevPanel::CYIDevPanel | ( | CYIApp * | pApp | ) |
CYIDevPanel::~CYIDevPanel | ( | ) |
void CYIDevPanel::AddWidget | ( | std::unique_ptr< CYIDevWidget > | pWidget, |
InsertPosition | insertPosition = InsertPosition::Top |
||
) |
Adds dev widget pWidget to the dev panel. The insert position can be controlled using the insertPosition parameter. A value of CYIDevPanel::InsertPosition::Top will insert the widget at the top of the widgets list, and a value of CYIDevPanel::InsertPosition::Bottom will insert the widget at the end of the widgets list.
void CYIDevPanel::Close | ( | ) |
Closes the dev panel if it isn't closed already.
void CYIDevPanel::CloseConfigurationSubpanel | ( | ) |
Closes the configuration subpanel, if it is open.
|
overridevirtual |
Draws the panel (if active) and any currently-active widgets.
Reimplemented from CYIDevPanelBase.
CYIApp* CYIDevPanel::GetApp | ( | ) | const |
Returns a pointer to the app.
CYIRenderingSurfaceInfo* CYIDevPanel::GetRenderingSurfaceInfo | ( | ) | const |
Returns a pointer to the rendering surface info.
CYISceneManager* CYIDevPanel::GetSceneManager | ( | ) | const |
Returns a pointer to the scene manager.
T* CYIDevPanel::GetWidget | ( | ) | const |
Finds and returns the first widget that matches type T.
std::vector<CYIDevWidget *> CYIDevPanel::GetWidgets | ( | ) | const |
Returns a collection of all of the widgets in the dev panel.
CYISceneView* CYIDevPanel::GetWidgetsContainer | ( | ) | const |
Returns a pointer to the widgets container. This is the view containing the widgets' content.
bool CYIDevPanel::IsActive | ( | ) | const |
Returns true if the dev panel is currently active (e.g. if the user has triggered the activation method.)
bool CYIDevPanel::IsConfigurationSubpanelOpen | ( | ) | const |
Returns true if the dev panel is active and if a configuration subpanel is currently open.
bool CYIDevPanel::IsVisible | ( | ) | const |
Returns true if the dev panel is currently visible. This differs from IsActive() in that it also returns true if the dev panel is animating in or out.
void CYIDevPanel::Open | ( | ) |
Opens the dev panel if it isn't open already.
void CYIDevPanel::OpenConfigurationSubpanel | ( | CYIDevWidget * | pWidget, |
const std::vector< std::pair< CYIString, CYIString >> & | items | ||
) |
Opens the configuration subpanel for widget pWidget, and configures it with configuration items items.
void CYIDevPanel::ReconfigureConfigurationSubpanel | ( | CYIDevWidget * | pWidget | ) |
Reconfigures the configuration subpanel for pWidget.
Simulates clicking a widget's configuration item.
void CYIDevPanel::SimulatePanelItemClicked | ( | size_t | index | ) |
Simulates clicking a dev panel item.
void CYIDevPanel::ToggleVisibility | ( | ) |
Toggles the visibility of the dev panel.
|
overridevirtual |
Updates the internal state of the panel and the widgets. Returns true if a render is required. If pSkipUpdate is non-null, widgets can set it to true to indicate that the app update should be skipped.
Reimplemented from CYIDevPanelBase.
void CYIDevPanel::UpdateWidget | ( | size_t | indexInPanel | ) |
Update the title, the subtitle, and the on/off indicator of the widget located at indexInPanel on the panel.
CYISignal CYIDevPanel::UserActivated |
A signal called when the User Signal widget is activated. If nothing is connected to this signal, the User Signal widget will be disabled in the dev panel.
CYISignal CYIDevPanel::UserDeactivated |
A signal called when the User Signal widget is deactivated. If nothing is connected to this signal, the CYIDevPanel::UserActivated signal is called instead.