Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Olympe::ComponentPalettePanel Class Reference

#include <ComponentPalettePanel.h>

Public Member Functions

 ComponentPalettePanel ()
 
 ~ComponentPalettePanel ()
 
void Initialize ()
 
void Render (EntityPrefabGraphDocument *document)
 
const std::vector< ComponentType > & GetComponentTypes () const
 
void RegisterComponentType (const std::string &name, const std::string &category, const std::string &description="")
 
bool LoadComponentsFromJSON (const std::string &filepath)
 

Private Member Functions

void RenderSearchBar ()
 
void RenderComponentList (EntityPrefabGraphDocument *document)
 
void RenderCategoryTabs ()
 
void AddComponentToGraph (EntityPrefabGraphDocument *document, const ComponentType &componentType)
 
std::string ExtractCategoryFromComponentType (const std::string &componentType)
 

Private Attributes

std::vector< ComponentTypem_componentTypes
 
std::vector< std::string > m_categories
 
std::vector< boolm_categoryExpanded
 
std::string m_searchFilter
 
int m_selectedCategoryIndex = 0
 
char m_searchBuffer [256]
 
char m_draggedComponentBuffer [256]
 

Static Private Attributes

static constexpr float CATEGORY_HEADER_HEIGHT = 22.0f
 
static constexpr float COMPONENT_ITEM_HEIGHT = 18.0f
 
static constexpr float COMPONENT_ITEM_PADDING_X = 5.0f
 
static constexpr float COMPONENT_ITEM_PADDING_Y = 2.0f
 

Detailed Description

Definition at line 22 of file ComponentPalettePanel.h.

Constructor & Destructor Documentation

◆ ComponentPalettePanel()

Olympe::ComponentPalettePanel::ComponentPalettePanel ( )

Definition at line 13 of file ComponentPalettePanel.cpp.

References GetComponentTypeID_Static(), m_draggedComponentBuffer, and m_searchBuffer.

+ Here is the call graph for this function:

◆ ~ComponentPalettePanel()

Olympe::ComponentPalettePanel::~ComponentPalettePanel ( )

Definition at line 19 of file ComponentPalettePanel.cpp.

Member Function Documentation

◆ AddComponentToGraph()

void Olympe::ComponentPalettePanel::AddComponentToGraph ( EntityPrefabGraphDocument document,
const ComponentType componentType 
)
private

Definition at line 270 of file ComponentPalettePanel.cpp.

References GetComponentTypeID_Static(), Olympe::ComponentType::name, Olympe::ComponentNode::position, SYSTEM_LOG, and Olympe::Vector.

+ Here is the call graph for this function:

◆ ExtractCategoryFromComponentType()

std::string Olympe::ComponentPalettePanel::ExtractCategoryFromComponentType ( const std::string &  componentType)
private

Definition at line 416 of file ComponentPalettePanel.cpp.

Referenced by LoadComponentsFromJSON().

+ Here is the caller graph for this function:

◆ GetComponentTypes()

const std::vector< ComponentType > & Olympe::ComponentPalettePanel::GetComponentTypes ( ) const

Definition at line 291 of file ComponentPalettePanel.cpp.

References m_componentTypes.

◆ Initialize()

void Olympe::ComponentPalettePanel::Initialize ( )

Definition at line 21 of file ComponentPalettePanel.cpp.

References GetComponentTypeID_Static(), LoadComponentsFromJSON(), m_categories, m_categoryExpanded, m_componentTypes, RegisterComponentType(), and SYSTEM_LOG.

Referenced by Olympe::EntityPrefabRenderer::EntityPrefabRenderer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadComponentsFromJSON()

bool Olympe::ComponentPalettePanel::LoadComponentsFromJSON ( const std::string &  filepath)

Definition at line 301 of file ComponentPalettePanel.cpp.

References ExtractCategoryFromComponentType(), GetComponentTypeID_Static(), m_categories, m_componentTypes, RegisterComponentType(), and SYSTEM_LOG.

Referenced by Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterComponentType()

void Olympe::ComponentPalettePanel::RegisterComponentType ( const std::string &  name,
const std::string &  category,
const std::string &  description = "" 
)

Definition at line 296 of file ComponentPalettePanel.cpp.

References m_componentTypes.

Referenced by Initialize(), and LoadComponentsFromJSON().

+ Here is the caller graph for this function:

◆ Render()

void Olympe::ComponentPalettePanel::Render ( EntityPrefabGraphDocument document)

Definition at line 97 of file ComponentPalettePanel.cpp.

References GetComponentTypeID_Static(), m_searchBuffer, m_searchFilter, and RenderCategoryTabs().

Referenced by Olympe::EntityPrefabRenderer::RenderRightPanelTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderCategoryTabs()

void Olympe::ComponentPalettePanel::RenderCategoryTabs ( )
private

◆ RenderComponentList()

void Olympe::ComponentPalettePanel::RenderComponentList ( EntityPrefabGraphDocument document)
private

Definition at line 264 of file ComponentPalettePanel.cpp.

◆ RenderSearchBar()

void Olympe::ComponentPalettePanel::RenderSearchBar ( )
private

Definition at line 130 of file ComponentPalettePanel.cpp.

References m_searchBuffer.

Member Data Documentation

◆ CATEGORY_HEADER_HEIGHT

constexpr float Olympe::ComponentPalettePanel::CATEGORY_HEADER_HEIGHT = 22.0f
staticconstexprprivate

Definition at line 45 of file ComponentPalettePanel.h.

Referenced by RenderCategoryTabs().

◆ COMPONENT_ITEM_HEIGHT

constexpr float Olympe::ComponentPalettePanel::COMPONENT_ITEM_HEIGHT = 18.0f
staticconstexprprivate

Definition at line 46 of file ComponentPalettePanel.h.

Referenced by RenderCategoryTabs().

◆ COMPONENT_ITEM_PADDING_X

constexpr float Olympe::ComponentPalettePanel::COMPONENT_ITEM_PADDING_X = 5.0f
staticconstexprprivate

Definition at line 47 of file ComponentPalettePanel.h.

Referenced by RenderCategoryTabs().

◆ COMPONENT_ITEM_PADDING_Y

constexpr float Olympe::ComponentPalettePanel::COMPONENT_ITEM_PADDING_Y = 2.0f
staticconstexprprivate

Definition at line 48 of file ComponentPalettePanel.h.

Referenced by RenderCategoryTabs().

◆ m_categories

std::vector<std::string> Olympe::ComponentPalettePanel::m_categories
private

Definition at line 51 of file ComponentPalettePanel.h.

Referenced by Initialize(), LoadComponentsFromJSON(), and RenderCategoryTabs().

◆ m_categoryExpanded

std::vector<bool> Olympe::ComponentPalettePanel::m_categoryExpanded
private

Definition at line 52 of file ComponentPalettePanel.h.

Referenced by Initialize(), and RenderCategoryTabs().

◆ m_componentTypes

std::vector<ComponentType> Olympe::ComponentPalettePanel::m_componentTypes
private

◆ m_draggedComponentBuffer

char Olympe::ComponentPalettePanel::m_draggedComponentBuffer[256]
private

Definition at line 56 of file ComponentPalettePanel.h.

Referenced by ComponentPalettePanel(), and RenderCategoryTabs().

◆ m_searchBuffer

char Olympe::ComponentPalettePanel::m_searchBuffer[256]
private

Definition at line 55 of file ComponentPalettePanel.h.

Referenced by ComponentPalettePanel(), Render(), and RenderSearchBar().

◆ m_searchFilter

std::string Olympe::ComponentPalettePanel::m_searchFilter
private

Definition at line 53 of file ComponentPalettePanel.h.

Referenced by Render(), and RenderCategoryTabs().

◆ m_selectedCategoryIndex

int Olympe::ComponentPalettePanel::m_selectedCategoryIndex = 0
private

Definition at line 54 of file ComponentPalettePanel.h.

Referenced by RenderCategoryTabs().


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