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>
543 lines
15 KiB
C++
543 lines
15 KiB
C++
// GUIMessageBox.cpp: implementation of the CGUIMessageBox class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#include "ClientMain.h"
|
||
#include "GUITextEdit.h"
|
||
#include "GUIMessageBox.h"
|
||
#include "GUIMessageBoxManager.h"
|
||
#include "Creature\NPC\NPCList.h"
|
||
|
||
//////////////////////////////////////////////////////////////////////
|
||
// Construction/Destruction
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
|
||
CGUIMessageBox::CGUIMessageBox(void)
|
||
{
|
||
m_bShow = TRUE;
|
||
m_lTick = 3000;
|
||
m_lpResultValue = NULL;
|
||
m_lpValue = NULL;
|
||
m_lpstrValue = NULL;
|
||
m_bEnableEnter = TRUE;
|
||
m_bWordBreak = TRUE;
|
||
}
|
||
|
||
CGUIMessageBox::~CGUIMessageBox()
|
||
{
|
||
Destroy();
|
||
}
|
||
|
||
void CGUIMessageBox::Create(const char *strMessage, unsigned long dwFlag, float posX, float posY)
|
||
{
|
||
m_dwFlag = dwFlag;
|
||
|
||
if(m_dwFlag & MB_EXIT)
|
||
{
|
||
m_btnButton[4].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[4].m_bExistItemPress = TRUE;
|
||
m_btnButton[4].m_lpNormalButton = new CSprite;
|
||
m_btnButton[4].m_lpNormalButton->Create(0, 0, 92, 68, 105, 79, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[4].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[4].m_lpClickMouseButton->Create(0, 0, 105, 68, 118, 79, g_MessageBoxManager.m_lpTexture);
|
||
}
|
||
|
||
if(m_dwFlag & MB_PREV)
|
||
{
|
||
m_btnButton[2].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[2].m_bExistItemPress = TRUE;
|
||
m_btnButton[2].m_lpNormalButton = new CSprite;
|
||
m_btnButton[2].m_lpNormalButton->Create(0, 0, 92, 91, 105, 103, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[2].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[2].m_lpClickMouseButton->Create(0, 0, 105, 91, 118, 103, g_MessageBoxManager.m_lpTexture);
|
||
}
|
||
|
||
if(m_dwFlag & MB_NEXT)
|
||
{
|
||
m_btnButton[3].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[3].m_bExistItemPress = TRUE;
|
||
m_btnButton[3].m_lpNormalButton = new CSprite;
|
||
m_btnButton[3].m_lpNormalButton->Create(0, 0, 92, 79, 105, 91, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[3].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[3].m_lpClickMouseButton->Create(0, 0, 105, 79, 105, 91, g_MessageBoxManager.m_lpTexture);
|
||
}
|
||
|
||
if(m_dwFlag & MB_CONFIRM)
|
||
{
|
||
m_btnButton[0].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[0].m_bExistItemPress = TRUE;
|
||
m_btnButton[0].m_lpNormalButton = new CSprite;
|
||
m_btnButton[0].m_lpNormalButton->Create(0, 0, 3, 100, 44, 117, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[0].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[0].m_lpClickMouseButton->Create(0, 0, 44, 100, 85, 117, g_MessageBoxManager.m_lpTexture);
|
||
} else if(m_dwFlag & MB_YES)
|
||
{
|
||
m_btnButton[0].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[0].m_bExistItemPress = TRUE;
|
||
m_btnButton[0].m_lpNormalButton = new CSprite;
|
||
m_btnButton[0].m_lpNormalButton->Create(0, 0, 3, 66, 44, 83, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[0].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[0].m_lpClickMouseButton->Create(0, 0, 44, 66, 85, 83, g_MessageBoxManager.m_lpTexture);
|
||
}
|
||
|
||
if(m_dwFlag & MB_CANCEL)
|
||
{
|
||
m_btnButton[1].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[1].m_bExistItemPress = TRUE;
|
||
m_btnButton[1].m_lpNormalButton = new CSprite;
|
||
m_btnButton[1].m_lpNormalButton->Create(0, 0, 3, 117, 44, 134, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[1].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[1].m_lpClickMouseButton->Create(0, 0, 44, 117, 85, 134, g_MessageBoxManager.m_lpTexture);
|
||
} else if(m_dwFlag & MB_NO)
|
||
{
|
||
m_btnButton[1].m_nMethod = BUTTON_SIMPLE;
|
||
m_btnButton[1].m_bExistItemPress = TRUE;
|
||
m_btnButton[1].m_lpNormalButton = new CSprite;
|
||
m_btnButton[1].m_lpNormalButton->Create(0, 0, 3, 83, 44, 100, g_MessageBoxManager.m_lpTexture);
|
||
m_btnButton[1].m_lpClickMouseButton = new CSprite;
|
||
m_btnButton[1].m_lpClickMouseButton->Create(0, 0, 44, 83, 85, 100, g_MessageBoxManager.m_lpTexture);
|
||
}
|
||
|
||
if(m_dwFlag & MB_NUMBER)
|
||
{
|
||
m_spNumber.Create(0, 0, 118, 66, 254, 87, g_MessageBoxManager.m_lpTexture);
|
||
g_TextEdit.m_dwEditMode = EDITMODE_NUMBER;
|
||
g_TextEdit.SetFocus();
|
||
g_TextEdit.SetEditLength(9);
|
||
// char strText[20];
|
||
// sprintf(strText, "%u", m_dwValue);
|
||
// g_TextEdit.SetWindowText(strText);
|
||
}
|
||
|
||
if(m_dwFlag & MB_STRING)
|
||
{
|
||
m_spNumber.Create(0, 0, 3, 151, 196, 173, g_MessageBoxManager.m_lpTexture);
|
||
g_TextEdit.m_dwEditMode = EDITMODE_NUMBER;
|
||
g_TextEdit.SetFocus();
|
||
g_TextEdit.SetEditLength(30);
|
||
// char strText[20];
|
||
// sprintf(strText, "%u", m_dwValue);
|
||
// g_TextEdit.SetWindowText(strText);
|
||
}
|
||
|
||
m_wIndex[ 0] = 0; m_wIndex[ 1] = 1; m_wIndex[ 2] = 4;
|
||
m_wIndex[ 3] = 1; m_wIndex[ 4] = 5; m_wIndex[ 5] = 4;
|
||
m_wIndex[ 6] = 1; m_wIndex[ 7] = 2; m_wIndex[ 8] = 5;
|
||
m_wIndex[ 9] = 2; m_wIndex[10] = 6; m_wIndex[11] = 5;
|
||
m_wIndex[12] = 2; m_wIndex[13] = 3; m_wIndex[14] = 6;
|
||
m_wIndex[15] = 3; m_wIndex[16] = 7; m_wIndex[17] = 6;
|
||
m_wIndex[18] = 4; m_wIndex[19] = 5; m_wIndex[20] = 8;
|
||
m_wIndex[21] = 5; m_wIndex[22] = 9; m_wIndex[23] = 8;
|
||
m_wIndex[24] = 5; m_wIndex[25] = 6; m_wIndex[26] = 9;
|
||
m_wIndex[27] = 6; m_wIndex[28] = 10; m_wIndex[29] = 9;
|
||
m_wIndex[30] = 6; m_wIndex[31] = 7; m_wIndex[32] = 10;
|
||
m_wIndex[33] = 7; m_wIndex[34] = 11; m_wIndex[35] = 10;
|
||
m_wIndex[36] = 8; m_wIndex[37] = 9; m_wIndex[38] = 12;
|
||
m_wIndex[39] = 9; m_wIndex[40] = 13; m_wIndex[41] = 12;
|
||
m_wIndex[42] = 9; m_wIndex[43] = 10; m_wIndex[44] = 13;
|
||
m_wIndex[45] = 10; m_wIndex[46] = 14; m_wIndex[47] = 13;
|
||
m_wIndex[48] = 10; m_wIndex[49] = 11; m_wIndex[50] = 14;
|
||
m_wIndex[51] = 11; m_wIndex[52] = 15; m_wIndex[53] = 14;
|
||
|
||
SetText(strMessage);
|
||
SetPosition(posX, posY);
|
||
|
||
g_MessageBoxManager.AddMessageBox(this);
|
||
}
|
||
|
||
BOOL CGUIMessageBox::ShowDialog(unsigned long dwChrID, unsigned long dwPage)
|
||
{
|
||
NPCNode *lpNPCNode;
|
||
lpNPCNode = g_NPCList.GetNPCNode(dwChrID);
|
||
if(lpNPCNode)
|
||
{
|
||
LPDialogNode lpDialog = lpNPCNode->GetScript(dwPage);
|
||
|
||
if(lpDialog)
|
||
{
|
||
Create(lpDialog->m_strWord, /*lpDialog->m_dwFlag | */MB_EXIT);
|
||
|
||
return TRUE;
|
||
}
|
||
}
|
||
|
||
return FALSE;
|
||
}
|
||
|
||
void CGUIMessageBox::Destroy()
|
||
{
|
||
vector<LPWORDNode>::iterator it;
|
||
vector<char *>::iterator itchar;
|
||
LPWORDNode lpWord;
|
||
char *lpMessage;
|
||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||
{
|
||
lpWord = (*it);
|
||
it = m_lstMessage.erase(it);
|
||
for(itchar = lpWord->m_lstMessage.begin(); itchar != lpWord->m_lstMessage.end();)
|
||
{
|
||
lpMessage = (*itchar);
|
||
itchar = lpWord->m_lstMessage.erase(itchar);
|
||
|
||
delete[] lpMessage;
|
||
}
|
||
lpWord->m_lstMessage.clear();
|
||
|
||
delete lpWord;
|
||
}
|
||
m_lstMessage.clear();
|
||
|
||
for(int i = 0; i < 5; i++)
|
||
{
|
||
if(m_btnButton[i].m_lpNormalButton) { delete m_btnButton[i].m_lpNormalButton; m_btnButton[i].m_lpNormalButton = NULL; }
|
||
if(m_btnButton[i].m_lpClickMouseButton) { delete m_btnButton[i].m_lpClickMouseButton; m_btnButton[i].m_lpClickMouseButton = NULL; }
|
||
}
|
||
|
||
if(m_lpResultValue && *m_lpResultValue == 0) *m_lpResultValue = MB_EXIT;
|
||
if(m_lpValue && *m_lpValue == 0)
|
||
{
|
||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||
{
|
||
*m_lpValue = atoi(g_TextEdit.GetMessage());
|
||
} else
|
||
{
|
||
*m_lpValue = 0;
|
||
}
|
||
}
|
||
|
||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||
{
|
||
g_ClientMain.SetFocus();
|
||
g_TextEdit.InitMessage();
|
||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||
g_TextEdit.SetEditLength(100);
|
||
}
|
||
|
||
g_MessageBoxManager.DeleteMessageBox(this);
|
||
}
|
||
|
||
void CGUIMessageBox::SetText(const char *strMessage)
|
||
{
|
||
vector<LPWORDNode>::iterator it;
|
||
vector<char *>::iterator itchar;
|
||
LPWORDNode lpWord;
|
||
char *lpMessage;
|
||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||
{
|
||
lpWord = (*it);
|
||
it = m_lstMessage.erase(it);
|
||
for(itchar = lpWord->m_lstMessage.begin(); itchar != lpWord->m_lstMessage.end();)
|
||
{
|
||
lpMessage = (*itchar);
|
||
itchar = lpWord->m_lstMessage.erase(itchar);
|
||
|
||
delete[] lpMessage;
|
||
}
|
||
lpWord->m_lstMessage.clear();
|
||
|
||
delete lpWord;
|
||
}
|
||
m_lstMessage.clear();
|
||
|
||
char *strMessageTemp, *strMessageTemp2, *token, seps[] = "\\";
|
||
strMessageTemp = new char[strlen(strMessage) + 100];
|
||
|
||
if(m_bWordBreak)
|
||
{
|
||
strcpy(strMessageTemp, g_TextEdit.MakeWordBreak(strMessage, 268));
|
||
} else
|
||
{
|
||
strcpy(strMessageTemp, strMessage);
|
||
}
|
||
token = strtok(strMessageTemp, seps);
|
||
|
||
while(token != NULL)
|
||
{
|
||
{
|
||
lpWord = new WORDNode;
|
||
lpWord->m_dwNum = 1; // <20>ӽ<EFBFBD>
|
||
lpWord->m_bFirstLink = FALSE; // <20>ӽ<EFBFBD>
|
||
strMessageTemp2 = new char[strlen(token) + 100];
|
||
strcpy(strMessageTemp2, token);
|
||
lpWord->m_lstMessage.push_back(strMessageTemp2);
|
||
}
|
||
|
||
m_lstMessage.push_back(lpWord);
|
||
|
||
token = strtok(NULL, seps);
|
||
}
|
||
|
||
delete[] strMessageTemp;
|
||
}
|
||
|
||
void CGUIMessageBox::SetPosition(float fPosX, float fPosY) //x, y<><79> <20><EFBFBD><DEBD><EFBFBD> <20>ڽ<EFBFBD><DABD><EFBFBD> left top<6F><70> <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB5A5>.
|
||
{
|
||
m_fPosX = fPosX;
|
||
m_fPosY = fPosY;
|
||
|
||
int i;
|
||
for(i = 0; i < 16; i++)
|
||
{
|
||
m_Vertexes[i].Diffuse.c = 0xFFFFFFFF;
|
||
m_Vertexes[i].Specular.c = 0;
|
||
m_Vertexes[i].w = 0.1f;
|
||
m_Vertexes[i].v.z = 0.1f;
|
||
}
|
||
float height = m_lstMessage.size() * 16;
|
||
if(m_dwFlag & 0x00011110) height += 20; // <20><>ư ũ<><C5A9>
|
||
|
||
m_rcRect.left = fPosX;
|
||
m_rcRect.top = fPosY;
|
||
m_rcRect.right = fPosX + 316;
|
||
m_rcRect.bottom = fPosY + 45 + height;
|
||
|
||
for(i = 0; i < 4; i++)
|
||
{
|
||
m_Vertexes[i * 4].tu = 0.0f;
|
||
m_Vertexes[i * 4 + 1].tu = 24.0f / 256.0f;
|
||
m_Vertexes[i * 4 + 2].tu = 232.0f / 256.0f;
|
||
m_Vertexes[i * 4 + 3].tu = 1.0f;
|
||
|
||
m_Vertexes[i * 4].v.x = m_rcRect.left - 0.5f;
|
||
m_Vertexes[i * 4 + 1].v.x = m_rcRect.left + 24.0f - 0.5f;
|
||
m_Vertexes[i * 4 + 2].v.x = m_rcRect.right - 24.0f - 0.5f;
|
||
m_Vertexes[i * 4 + 3].v.x = m_rcRect.right - 0.5f;
|
||
|
||
m_Vertexes[i].tv = 0.0f;
|
||
m_Vertexes[i + 4].tv = 20.0f / 256.0f;
|
||
m_Vertexes[i + 8].tv = 44.0f / 256.0f;
|
||
m_Vertexes[i + 12].tv = 0.25f;
|
||
|
||
m_Vertexes[i].v.y = m_rcRect.top - 0.5f;
|
||
m_Vertexes[i + 4].v.y = m_rcRect.top + 20.0f - 0.5f;
|
||
m_Vertexes[i + 8].v.y = m_rcRect.bottom - 20.0f - 0.5f;
|
||
m_Vertexes[i + 12].v.y = m_rcRect.bottom - 0.5f;
|
||
}
|
||
|
||
if(m_dwFlag & MB_EXIT)
|
||
{
|
||
m_btnButton[4].m_lMoveX = m_rcRect.right - 21;
|
||
m_btnButton[4].m_lMoveY = m_rcRect.top + 8;
|
||
}
|
||
if(m_dwFlag & MB_PREV)
|
||
{
|
||
m_btnButton[2].m_lMoveX = m_rcRect.right - 57;
|
||
m_btnButton[2].m_lMoveY = m_rcRect.top + 11;
|
||
}
|
||
if(m_dwFlag & MB_NEXT)
|
||
{
|
||
m_btnButton[3].m_lMoveX = m_rcRect.right - 41;
|
||
m_btnButton[3].m_lMoveY = m_rcRect.top + 11;
|
||
}
|
||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||
{
|
||
m_btnButton[1].m_lMoveX = m_rcRect.right - 56;
|
||
m_btnButton[1].m_lMoveY = m_rcRect.bottom - 32;
|
||
}
|
||
if((m_dwFlag & MB_CONFIRM) || (m_dwFlag & MB_YES))
|
||
{
|
||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||
{
|
||
m_btnButton[0].m_lMoveX = m_rcRect.right - 103;
|
||
m_btnButton[0].m_lMoveY = m_rcRect.bottom - 32;
|
||
} else
|
||
{
|
||
m_btnButton[0].m_lMoveX = m_rcRect.right - 56;
|
||
m_btnButton[0].m_lMoveY = m_rcRect.bottom - 32;
|
||
}
|
||
}
|
||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||
{
|
||
m_spNumber.m_nPutX = m_rcRect.left + 13;
|
||
m_spNumber.m_nPutY = m_rcRect.bottom - 34;
|
||
}
|
||
}
|
||
|
||
BOOL CGUIMessageBox::Update(float fTick, BOOL &bClick, BOOL bAble)
|
||
{
|
||
if((m_dwFlag & MB_EXIT))
|
||
{
|
||
if(bAble)
|
||
{
|
||
m_btnButton[4].Update();
|
||
|
||
if(m_btnButton[4].m_nState == BUTTON_CLICK)
|
||
{
|
||
bClick = TRUE;
|
||
if(m_lpResultValue) *m_lpResultValue = MB_EXIT;
|
||
return FALSE;
|
||
}
|
||
}
|
||
} else
|
||
{
|
||
m_lTick -= fTick;
|
||
if(m_lpResultValue) *m_lpResultValue = MB_EXIT;
|
||
if(m_lTick <= 0) return FALSE;
|
||
}
|
||
|
||
if(bAble)
|
||
{
|
||
if(m_dwFlag & MB_PREV)
|
||
{
|
||
m_btnButton[2].Update();
|
||
|
||
if(m_btnButton[2].m_nState == BUTTON_CLICK)
|
||
{
|
||
if(m_lpResultValue) *m_lpResultValue = MB_PREV;
|
||
bClick = TRUE;
|
||
}
|
||
}
|
||
if(m_dwFlag & MB_NEXT)
|
||
{
|
||
m_btnButton[3].Update();
|
||
|
||
if(m_btnButton[3].m_nState == BUTTON_CLICK)
|
||
{
|
||
if(m_lpResultValue) *m_lpResultValue = MB_NEXT;
|
||
if(m_lpValue) *m_lpValue = 0;
|
||
if(m_dwFlag & MB_NUMBER)
|
||
{
|
||
g_ClientMain.SetFocus();
|
||
g_TextEdit.InitMessage();
|
||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||
g_TextEdit.SetEditLength(100);
|
||
}
|
||
bClick = TRUE;
|
||
}
|
||
}
|
||
if((m_dwFlag & MB_NO) || (m_dwFlag & MB_CANCEL))
|
||
{
|
||
m_btnButton[1].Update();
|
||
|
||
if(m_btnButton[1].m_nState == BUTTON_CLICK)
|
||
{
|
||
if(m_lpResultValue) { *m_lpResultValue = MB_NO | MB_CANCEL; m_lpResultValue = NULL; }
|
||
if(m_lpValue) { *m_lpValue = 0; m_lpValue = NULL; }
|
||
if(m_lpstrValue) { strcpy(m_lpstrValue, ""); m_lpstrValue = NULL; }
|
||
bClick = TRUE;
|
||
if(m_dwFlag & MB_NUMBER)
|
||
{
|
||
g_ClientMain.SetFocus();
|
||
g_TextEdit.InitMessage();
|
||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||
g_TextEdit.SetEditLength(100);
|
||
}
|
||
return FALSE;
|
||
}
|
||
}
|
||
if((m_dwFlag & MB_YES) || (m_dwFlag & MB_CONFIRM))
|
||
{
|
||
m_btnButton[0].Update();
|
||
|
||
if((m_bEnableEnter && GetAsyncKeyState(VK_RETURN)) || m_btnButton[0].m_nState == BUTTON_CLICK)
|
||
{
|
||
if(m_lpResultValue) { *m_lpResultValue = MB_YES | MB_CONFIRM; m_lpResultValue = NULL; }
|
||
if(m_lpValue)
|
||
{
|
||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||
{
|
||
*m_lpValue = atoi(g_TextEdit.GetMessage());
|
||
} else
|
||
{
|
||
*m_lpValue = 0;
|
||
}
|
||
m_lpValue = NULL;
|
||
}
|
||
if(m_lpstrValue)
|
||
{
|
||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||
{
|
||
strcpy(m_lpstrValue, g_TextEdit.GetMessage());
|
||
} else
|
||
{
|
||
strcpy(m_lpstrValue, "");
|
||
}
|
||
m_lpstrValue = NULL;
|
||
}
|
||
bClick = TRUE;
|
||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||
{
|
||
g_ClientMain.SetFocus();
|
||
g_TextEdit.InitMessage();
|
||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||
g_TextEdit.SetEditLength(100);
|
||
}
|
||
return FALSE;
|
||
}
|
||
}
|
||
}
|
||
|
||
return TRUE;
|
||
}
|
||
|
||
void CGUIMessageBox::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
if(!m_bShow) return;
|
||
|
||
lpD3DDevice->SetTexture(0, g_MessageBoxManager.m_lpTexture->GetTexture());
|
||
lpD3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 16, 18, m_wIndex, D3DFMT_INDEX16, m_Vertexes, sizeof(TLVertex));
|
||
|
||
RECT rect;
|
||
for(int i = 0; i < m_lstMessage.size(); i++)
|
||
{
|
||
rect.left = m_rcRect.left + 24;
|
||
rect.top = m_rcRect.top + 21 + i * 16;
|
||
rect.right = m_rcRect.right - 24;
|
||
rect.bottom = rect.top + 16;
|
||
|
||
g_TextEdit.DrawText(m_lstMessage[i]->m_lstMessage[0], &rect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||
}
|
||
|
||
if(m_dwFlag & MB_EXIT)
|
||
{
|
||
m_btnButton[4].Render(lpD3DDevice);
|
||
}
|
||
if(m_dwFlag & MB_PREV)
|
||
{
|
||
m_btnButton[2].Render(lpD3DDevice);
|
||
}
|
||
if(m_dwFlag & MB_NEXT)
|
||
{
|
||
m_btnButton[3].Render(lpD3DDevice);
|
||
}
|
||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||
{
|
||
m_btnButton[1].Render(lpD3DDevice);
|
||
}
|
||
if((m_dwFlag & MB_CONFIRM) || (m_dwFlag & MB_YES))
|
||
{
|
||
m_btnButton[0].Render(lpD3DDevice);
|
||
}
|
||
if((m_dwFlag & MB_NUMBER))
|
||
{
|
||
m_spNumber.Render(lpD3DDevice);
|
||
|
||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_NUMBER)
|
||
{
|
||
char strText[MAX_PATH];
|
||
int nNumber;
|
||
RECT rcRect;
|
||
|
||
SetRect(&rcRect, m_spNumber.m_nPutX + 4, m_spNumber.m_nPutY + 2, m_spNumber.m_nPutX + 132, m_spNumber.m_nPutY + 18);
|
||
nNumber = atoi(g_TextEdit.GetMessage());
|
||
sprintf(strText, "%s_", g_TextEdit.MakePrintGold((unsigned long)nNumber));
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||
}
|
||
}/**/
|
||
if(m_dwFlag & MB_STRING)
|
||
{
|
||
m_spNumber.Render(lpD3DDevice);
|
||
|
||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_NUMBER)
|
||
{
|
||
char strText[MAX_PATH];
|
||
RECT rcRect;
|
||
|
||
SetRect(&rcRect, m_spNumber.m_nPutX + 4, m_spNumber.m_nPutY + 2, m_spNumber.m_nPutX + 186, m_spNumber.m_nPutY + 18);
|
||
sprintf(strText, "%s_", g_TextEdit.GetMessage());
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||
}
|
||
}/**/
|
||
}
|