Files
Client/GameTools/NeoRylClient/GUIMessageBoxManager.cpp
LGram16 dd97ddec92 Restructure repository to include all source folders
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>
2025-11-29 20:17:20 +09:00

100 lines
2.2 KiB
C++

// GUIMessageBoxManager.cpp: implementation of the CGUIMessageBoxManager class.
//
//////////////////////////////////////////////////////////////////////
#include "GUIMessageBoxManager.h"
#include "BaseDataDefine.h"
#include "FrameTimer.h"
CGUIMessageBoxManager g_MessageBoxManager;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGUIMessageBoxManager::CGUIMessageBoxManager()
{
m_lpTexture = NULL;
}
CGUIMessageBoxManager::~CGUIMessageBoxManager()
{
if(m_lpTexture) { delete m_lpTexture; m_lpTexture = NULL; }
}
void CGUIMessageBoxManager::AddMessageBox(CGUIMessageBox *lpMessageBox)
{
m_lstMessageBox.push_back(lpMessageBox);
}
void CGUIMessageBoxManager::Create()
{
CTexture::SetPath(INTERFACETEXTUREPATH);
m_lpTexture = new CTexture;
m_lpTexture->Load("GUIMsgBox.dds");
m_dwMessageBoxTick = CFrameTimer::Regist(1000.0f);
}
void CGUIMessageBoxManager::DeleteMessageBox(CGUIMessageBox *lpMessageBox)
{
vector<CGUIMessageBox *>::iterator it;
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end(); it++)
{
if((*it) == lpMessageBox)
{
m_lstMessageBox.erase(it);
break;
}
}
}
BOOL CGUIMessageBoxManager::Update()
{
float fTick = CFrameTimer::GetUpdateTimer(m_dwMessageBoxTick);
vector<CGUIMessageBox *>::iterator it;
BOOL bClick = FALSE;
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end();)
{
if(!(*it)->Update(fTick, bClick, !bClick))
{
CGUIMessageBox *lpDelete = (*it);
it = m_lstMessageBox.erase(it);
lpDelete->m_bShow = FALSE;
delete lpDelete;
} else
{
it++;
}
}
return bClick;
/* if(m_lstMessageBox.empty())
return FALSE;
else
return TRUE;*/
}
void CGUIMessageBoxManager::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
{
vector<CGUIMessageBox *>::iterator it;
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end(); it++)
{
(*it)->Render(lpD3DDevice);
}
}
void CGUIMessageBoxManager::DestroyList()
{
vector<CGUIMessageBox *>::iterator it;
CGUIMessageBox *lpDelete;
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end();)
{
lpDelete = (*it);
it = m_lstMessageBox.erase(it);
delete lpDelete;
}
m_lstMessageBox.clear();
}