Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
shkyera::ConsoleWidget Class Reference

A user interface widget for the console, used for logging and displaying messages. More...

#include <ConsoleWidget.hpp>

Inheritance diagram for shkyera::ConsoleWidget:
[legend]

Public Member Functions

 ConsoleWidget (const std::string &name)
 
 ~ConsoleWidget ()
 
virtual void draw () override
 Implementation of the abstract draw method to render the console widget.
 
 Widget (std::string name)
 Constructor to create a widget with a specified name.
 
- Public Member Functions inherited from shkyera::Widget
 Widget (std::string name)
 Constructor to create a widget with a specified name.
 
virtual ~Widget ()=default
 Default virtual destructor.
 

Static Public Member Functions

static void clear ()
 Clear all logs from the console widget.
 
static void enableVerbose ()
 Enable verbose logging mode.
 
static void disableVerbose ()
 Disable verbose logging mode.
 
static void logVerbose (std::string text)
 Log a verbose message to the console.
 
static void logInfo (std::string text)
 Log an informational message to the console.
 
static void logSuccess (std::string text)
 Log a success message to the console.
 
static void logError (std::string text)
 Log an error message to the console.
 

Static Public Attributes

static constexpr size_t MAX_LOGS = 500
 The maximum number of logs to keep in the console.
 

Private Member Functions

void drawInfoBar () const
 Draw the information bar of the console widget.
 

Private Attributes

AssetRef< Texture_totalIcon
 
AssetRef< Texture_errorIcon
 
AssetRef< Texture_successIcon
 
AssetRef< Texture_infoIcon
 
AssetRef< Texture_verboseIcon
 

Static Private Attributes

static size_t _totalVerbose = 0
 The total number of verbose logs.
 
static size_t _totalInfo = 0
 The total number of informational logs.
 
static size_t _totalSuccess = 0
 The total number of success logs.
 
static size_t _totalError = 0
 The total number of error logs.
 
static std::vector< std::shared_ptr< Log > > _logs = {}
 A collection of logs in the console.
 
static bool _verbose = true
 A flag indicating verbose logging mode.
 

Additional Inherited Members

- Public Attributes inherited from shkyera::Widget
std::string _name
 The name of the widget.
 

Detailed Description

A user interface widget for the console, used for logging and displaying messages.

Constructor & Destructor Documentation

◆ ConsoleWidget()

shkyera::ConsoleWidget::ConsoleWidget ( const std::string &  name)

◆ ~ConsoleWidget()

shkyera::ConsoleWidget::~ConsoleWidget ( )

Member Function Documentation

◆ clear()

void shkyera::ConsoleWidget::clear ( )
static

Clear all logs from the console widget.

◆ disableVerbose()

void shkyera::ConsoleWidget::disableVerbose ( )
static

Disable verbose logging mode.

◆ draw()

void shkyera::ConsoleWidget::draw ( )
overridevirtual

Implementation of the abstract draw method to render the console widget.

Implements shkyera::Widget.

◆ drawInfoBar()

void shkyera::ConsoleWidget::drawInfoBar ( ) const
private

Draw the information bar of the console widget.

◆ enableVerbose()

void shkyera::ConsoleWidget::enableVerbose ( )
static

Enable verbose logging mode.

◆ logError()

void shkyera::ConsoleWidget::logError ( std::string  text)
static

Log an error message to the console.

Parameters
textThe error message to log.

◆ logInfo()

void shkyera::ConsoleWidget::logInfo ( std::string  text)
static

Log an informational message to the console.

Parameters
textThe informational message to log.

◆ logSuccess()

void shkyera::ConsoleWidget::logSuccess ( std::string  text)
static

Log a success message to the console.

Parameters
textThe success message to log.

◆ logVerbose()

void shkyera::ConsoleWidget::logVerbose ( std::string  text)
static

Log a verbose message to the console.

Parameters
textThe verbose message to log.

◆ Widget()

shkyera::Widget::Widget ( std::string  name)

Constructor to create a widget with a specified name.

Parameters
nameThe name of the widget.

Member Data Documentation

◆ _errorIcon

AssetRef<Texture> shkyera::ConsoleWidget::_errorIcon
private

◆ _infoIcon

AssetRef<Texture> shkyera::ConsoleWidget::_infoIcon
private

◆ _logs

std::vector< std::shared_ptr< Log > > shkyera::ConsoleWidget::_logs = {}
staticprivate

A collection of logs in the console.

◆ _successIcon

AssetRef<Texture> shkyera::ConsoleWidget::_successIcon
private

◆ _totalError

size_t shkyera::ConsoleWidget::_totalError = 0
staticprivate

The total number of error logs.

◆ _totalIcon

AssetRef<Texture> shkyera::ConsoleWidget::_totalIcon
private

◆ _totalInfo

size_t shkyera::ConsoleWidget::_totalInfo = 0
staticprivate

The total number of informational logs.

◆ _totalSuccess

size_t shkyera::ConsoleWidget::_totalSuccess = 0
staticprivate

The total number of success logs.

◆ _totalVerbose

size_t shkyera::ConsoleWidget::_totalVerbose = 0
staticprivate

The total number of verbose logs.

◆ _verbose

bool shkyera::ConsoleWidget::_verbose = true
staticprivate

A flag indicating verbose logging mode.

◆ _verboseIcon

AssetRef<Texture> shkyera::ConsoleWidget::_verboseIcon
private

◆ MAX_LOGS

constexpr size_t shkyera::ConsoleWidget::MAX_LOGS = 500
staticconstexpr

The maximum number of logs to keep in the console.


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