Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
1.2 KiB
C++
61 lines
1.2 KiB
C++
// GUIButtonManager.cpp: implementation of the CGUIButtonManager class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "GUIButtonManager.h"
|
|
|
|
CGUIButtonManager g_ButtonManager;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
CGUIButtonManager::CGUIButtonManager()
|
|
{
|
|
|
|
}
|
|
|
|
CGUIButtonManager::~CGUIButtonManager()
|
|
{
|
|
DestroyAllButton();
|
|
}
|
|
|
|
BOOL CGUIButtonManager::AddButton(CGUIButton *pButton)
|
|
{
|
|
m_lstButton.push_back(pButton);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void CGUIButtonManager::Update(void)
|
|
{
|
|
vector<CGUIButton *>::iterator it;
|
|
|
|
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
|
{
|
|
(*it)->Update();
|
|
}
|
|
}
|
|
|
|
void CGUIButtonManager::DestroyAllButton()
|
|
{
|
|
vector<CGUIButton *>::iterator it;
|
|
|
|
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
|
{
|
|
if((*it)) { delete (*it); (*it) = NULL; }
|
|
}
|
|
|
|
m_lstButton.clear();
|
|
}
|
|
|
|
void CGUIButtonManager::Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha)
|
|
{
|
|
vector<CGUIButton *>::iterator it;
|
|
|
|
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
|
{
|
|
if((*it)->m_bShow) (*it)->Render(lpD3DDevice, cAlpha);
|
|
}
|
|
}
|