753 lines
24 KiB
C++
753 lines
24 KiB
C++
#include "stdafx.h"
|
|
|
|
#include "KUIControlEdit.h"
|
|
#include "KUIControlButton.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlCombo.h"
|
|
#include "KUIControlClockBox.h"
|
|
|
|
#include "SGameManager.h"
|
|
#include "SUICreateCharWnd.h"
|
|
|
|
#include "GameDefine.h"
|
|
|
|
#include "SStringDB.h"
|
|
#include "SItemDB.h"
|
|
|
|
#include "SDefaultTextureResourceDB.h"
|
|
#include "SDefaultTextureIconResourceDB.h"
|
|
|
|
// 2010.04.22 - prodongi
|
|
#include "SGameRenewalLobby.h"
|
|
|
|
|
|
// Fraun new character UI 8/20/2025
|
|
int SUICreateCharSecondDlg::nReferences = 0;
|
|
std::map<std::string, int>* SUICreateCharSecondDlg::m_CharacterSelectionPoints = 0;
|
|
std::map<int, int>* SUICreateCharSecondDlg::m_CharacterHairDyesMap = 0;
|
|
std::map<int, int>* SUICreateCharSecondDlg::m_CharacterSkinColorMap = 0;
|
|
|
|
SUICreateCharSecondDlg::~SUICreateCharSecondDlg()
|
|
{
|
|
clear();
|
|
nReferences--;
|
|
|
|
if (nReferences == 0)
|
|
{ // Removing temporary maps
|
|
delete m_CharacterSelectionPoints;
|
|
m_CharacterSelectionPoints = nullptr;
|
|
|
|
delete m_CharacterHairDyesMap;
|
|
m_CharacterHairDyesMap = nullptr;
|
|
|
|
delete m_CharacterSkinColorMap;
|
|
m_CharacterSkinColorMap = nullptr;
|
|
}
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::clear()
|
|
{
|
|
m_vHairList.clear();
|
|
m_vFaceList.clear();
|
|
m_vBodyList.clear();
|
|
m_vDecoList.clear();
|
|
}
|
|
|
|
// Character creation menu
|
|
// Character customization
|
|
|
|
// Buttons click messages function
|
|
void SUICreateCharSecondDlg::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
if (KUI_MESSAGE::KICON_CLICK == nMessage && !m_bAniCam)
|
|
{
|
|
int nControlID = m_CharacterSelectionPoints->find(lpszControlID)->second;
|
|
|
|
switch (nControlID)
|
|
{
|
|
case 0: case 1: case 2: case 3: case 4: case 5:
|
|
case 6: case 7: case 8: case 9: case 10: // Faces
|
|
{
|
|
m_nCurFace = nControlID;
|
|
m_nSelectFace = m_nCurFace;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_00", NULL, m_nCurFace); // Moving face selection box to the selected face
|
|
break;
|
|
}
|
|
case 100: case 101: case 102: case 103: case 104: case 105: case 106: case 107: case 108: case 109: // Tatoos
|
|
case 110: case 111: case 112: case 113: case 114: case 115: case 116: case 117: case 118: case 119: // Tatoos
|
|
{
|
|
m_nCurDeco = nControlID;
|
|
m_nSelectDeco = m_nCurDeco;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_01", &m_vDecoList[m_nSelectDeco], m_nCurDeco);
|
|
break;
|
|
}
|
|
case 200: case 201: case 202: case 203: case 204: case 205: case 206: case 207: // Hairstyles (hairs)
|
|
{
|
|
m_nCurHair = nControlID;
|
|
m_nSelectHair = m_nCurHair;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_02", &m_vHairList[m_nCurHair], m_nCurHair);
|
|
break;
|
|
}
|
|
case 300: case 301: case 302: case 303: case 304: case 305: case 306: case 307: case 308: case 309: case 310: case 311: // Hairdyes (haircolor) (rgb)
|
|
case 312: case 313: case 314: case 315: case 316: case 317: case 318: case 319: case 320: case 321: case 322: case 323: // Hairdyes (haircolor) (rgb)
|
|
case 324: case 325: case 326: case 327: case 328: case 329: // Hairdyes (haircolor) (rgb)
|
|
{
|
|
m_nCurHairColor = m_CharacterHairDyesMap->at(nControlID);
|
|
m_nSelectedHairColor = m_nCurHairColor;
|
|
m_vHairList[m_nCurHair].m_textureId = m_nCurHairColor;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_03", &m_vHairList[m_nCurHair], m_nCurHairColor);
|
|
break;
|
|
}
|
|
case 330: case 331: case 332: case 333: // Hairdyes (haircolor) (index)
|
|
{
|
|
m_nCurHairColor = nControlID - 327;
|
|
m_nSelectedHairColor = m_nCurHairColor;
|
|
m_vHairList[m_nCurHair].m_textureId = m_nCurHairColor;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_03", &m_vHairList[m_nCurHair], m_nCurHairColor);
|
|
break;
|
|
}
|
|
case 400: case 401: case 402: case 403: // Clothes (Outfits)
|
|
{
|
|
m_nCurBody = nControlID;
|
|
m_nSelectBody = m_nCurBody;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_04", NULL, m_nCurBody);
|
|
break;
|
|
}
|
|
case 500: case 501: case 502: case 503: case 504: case 505:
|
|
case 506: case 507: case 508: case 509: case 510: case 511: // Skin color
|
|
{
|
|
m_nCurSkinColor = m_CharacterSkinColorMap->at(nControlID);
|
|
m_nSelectSkinColor = m_nCurSkinColor;
|
|
|
|
CharCreationProcMsgAtStatic(lpszControlID, "select_box_05", NULL, m_nCurSkinColor);
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Face customization-related modification — kappamind, 2009.12.16
|
|
if( KUI_MESSAGE::KBUTTON_CLICK == nMessage && !m_bAniCam )
|
|
{
|
|
if( 0 == ::_stricmp( "ok_bt", lpszControlID ) ) // Confirmation button (Create)
|
|
{
|
|
m_pGameManager->StartSound( "ui_bgm_antechamber01.wav" );
|
|
|
|
if( !m_bCreateChar )
|
|
{
|
|
KUIControlEdit* pEdit = dynamicCast<KUIControlEdit*>(GetChild("nameEdit"));
|
|
if( pEdit )
|
|
{
|
|
SIMSG_CREATE_NEWCHAR CreateNewCharMsg( pEdit->GetText() );
|
|
|
|
if (CreateNewCharMsg.m_strName.empty())
|
|
{
|
|
m_pGameManager->InterfaceMsg( &SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_GENERAL, S(806), true ) );
|
|
}
|
|
else
|
|
{
|
|
m_pGameManager->ProcMsgAtStatic( &CreateNewCharMsg );
|
|
pEdit->SetText("");
|
|
m_bCreateChar = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if( 0 == ::_stricmp( "cc_bt", lpszControlID ) ) // Return button (Cancel)
|
|
{
|
|
m_pGameManager->StartSound( "ui_bgm_antechamber01.wav" );
|
|
|
|
SIMSG_UIWND_NOTIFY_TO_LOBBY msg( lpszControlID );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
else if( 0 == ::_stricmp( "malebtn", lpszControlID ) || 0 == ::_stricmp("fmalebtn", lpszControlID)) // Gender (Sex) change
|
|
{
|
|
SetCurrentDecoIcon( m_nCurRace, m_nCurSex, m_nCurFace );
|
|
|
|
SIMSG_UIWND_NOTIFY_TO_LOBBY msg( lpszControlID );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_CREATE_NEWCHAR:
|
|
{
|
|
SIMSG_CREATE_NEWCHAR * pNameMsg = (SIMSG_CREATE_NEWCHAR *)pMsg;
|
|
|
|
if( !pNameMsg->m_strName.empty() )
|
|
{
|
|
KUIControlIconStatic * pIcon = dynamicCast<KUIControlIconStatic*>(GetChild( "static01" ));
|
|
if( pIcon )
|
|
{
|
|
switch (pNameMsg->m_nRace)
|
|
{
|
|
case GCLAN_GAIA:
|
|
{
|
|
if (pNameMsg->m_nSex == SEX_FEMALE)
|
|
{// TODO: Old shit! Needs to be REMOVED! That's the 70x116 picture from 2004 year!
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_gaiafemale");
|
|
}
|
|
else if (pNameMsg->m_nSex == SEX_MALE)
|
|
{
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_gaiamale");
|
|
}
|
|
break;
|
|
}
|
|
case GCLAN_DEVA:
|
|
{
|
|
switch (pNameMsg->m_nSex)
|
|
{
|
|
case SEX_FEMALE:
|
|
{
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_devafemale");
|
|
break;
|
|
}
|
|
case SEX_MALE:
|
|
{
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_devamale");
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case GCLAN_ASURA:
|
|
{
|
|
switch (pNameMsg->m_nSex)
|
|
{
|
|
case SEX_FEMALE:
|
|
{
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_asurafemale");
|
|
break;
|
|
}
|
|
case SEX_MALE:
|
|
{
|
|
pIcon->SetIcon("ui_frame.spr", "static_lobby_asuramale");
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default: break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_CUSTOMIZIG_UPDATE: // Initializing the customize character window
|
|
{
|
|
SIMSG_UI_CUSTOMIZIG_UPDATE* pUpdateMsg = (SIMSG_UI_CUSTOMIZIG_UPDATE*)pMsg;
|
|
|
|
InitData(); // Initializing basic stuff
|
|
|
|
m_nCurHair = pUpdateMsg->m_nHair;
|
|
m_nCurFace = pUpdateMsg->m_nFace;
|
|
m_nCurBody = pUpdateMsg->m_nBody;
|
|
m_nCurSex = pUpdateMsg->m_nSex;
|
|
m_nCurRace = pUpdateMsg->m_nRace;
|
|
m_nCurDeco = 0;
|
|
|
|
// Set Icons (Filling arrays)
|
|
SetCurrentFaceIcon( m_nCurRace, m_nCurSex, m_nCurFace );
|
|
SetCurrentHairIcon( m_nCurRace, m_nCurSex, m_nCurHair );
|
|
SetCurrentBodyIcon( m_nCurRace, m_nCurSex, m_nCurBody );
|
|
SetCurrentDecoIcon( m_nCurRace, m_nCurSex, m_nCurFace );
|
|
|
|
if (!m_vFaceList.empty()) // Obviously faces, but comment here in case if you, the one reading this code, have low IQ
|
|
{ // This vector (m_vFaceList) should not be empty actually if DefaultModelResource rdb is correct
|
|
checkValidIndex(m_vFaceList, m_nCurFace);
|
|
|
|
m_nFacePosition = m_nCurFace;
|
|
m_nSelectFace = m_nCurFace;
|
|
|
|
for (int i = 0; i < 11; i++)
|
|
{
|
|
KUIControlIconStatic* pFaceIcon = dynamicCast<KUIControlIconStatic*>(GetChild(CStringUtil::StringFormat("select00%02d", i).c_str()));
|
|
|
|
if (pFaceIcon)
|
|
{
|
|
std::string strRaceModificator = "static_face_";
|
|
if (m_nCurRace == 5)
|
|
{
|
|
strRaceModificator += "as";
|
|
}
|
|
else if (m_nCurRace == 4)
|
|
{
|
|
strRaceModificator += "de";
|
|
}
|
|
else if (m_nCurRace == 3)
|
|
{
|
|
strRaceModificator += "ga";
|
|
}
|
|
|
|
m_nCurSex == 1 ? strRaceModificator += "f" : strRaceModificator += "m";
|
|
|
|
pFaceIcon->SetShow(false);
|
|
pFaceIcon->SetIcon("05_ui.spr", CStringUtil::StringFormat("%s_0%02d", strRaceModificator.c_str(), i + 1).c_str());
|
|
pFaceIcon->SetShow(true);
|
|
}
|
|
}
|
|
|
|
KUIControlIconStatic* pFaceSelect = dynamicCast<KUIControlIconStatic*>(GetChild(CStringUtil::StringFormat("select00%02d", m_nCurFace).c_str()));
|
|
const KRect& rIconRect = pFaceSelect->GetRect();
|
|
|
|
//SetMovePos("select_box_00", rIconRect.left, rIconRect.top);
|
|
//SetChildShow("select_box_00", true);
|
|
}
|
|
if (!m_vDecoList.empty()) // Face tatoos
|
|
{
|
|
m_nCurDeco = 0;
|
|
m_nDecoPosition = 0;
|
|
|
|
for (int i = 0; i < 19; ++i)
|
|
{
|
|
KUIControlIconStatic* pDeco = dynamicCast<KUIControlIconStatic*>(GetChild(CStringUtil::StringFormat("select01%02d", i + 1).c_str()));
|
|
|
|
if (pDeco)
|
|
{
|
|
if (i + 1 < (int)m_vDecoList.size())
|
|
{
|
|
pDeco->SetShow(true);
|
|
pDeco->SetIcon("05_ui.spr", m_vDecoList.at(i).m_iconName.c_str());
|
|
//pDeco->SetAniName(m_vDecoList[m_nCurDeco + i].m_iconName.c_str());
|
|
pDeco->Enable();
|
|
}
|
|
else
|
|
{
|
|
pDeco->SetShow(false);
|
|
pDeco->Disable();
|
|
}
|
|
}
|
|
}
|
|
|
|
m_nSelectDeco = m_nCurDeco;
|
|
}
|
|
if( !m_vHairList.empty() ) // Hairs
|
|
{
|
|
checkValidIndex(m_vHairList, m_nCurHair);
|
|
m_nHairPosition = m_nCurHair;
|
|
|
|
for( int i = 0; i < 8; i++ )
|
|
{
|
|
if (i < m_vHairList.size())
|
|
{
|
|
if (KUIControlIconStatic* pHair = dynamicCast<KUIControlIconStatic*>(GetChild(CStringUtil::StringFormat("select02%02d", i).c_str())))
|
|
{
|
|
pHair->SetIcon("05_ui.spr", m_vHairList.at(i).m_iconName.c_str());
|
|
pHair->SetShow(true);
|
|
pHair->Enable();
|
|
}
|
|
}
|
|
}
|
|
|
|
m_nSelectHair = m_nCurHair;
|
|
}
|
|
if( !m_vBodyList.empty() ) // Outfit (Costume)
|
|
{
|
|
checkValidIndex(m_vBodyList, m_nCurBody);
|
|
|
|
m_nBodyPosition = m_nCurBody;
|
|
|
|
for( int i = 0; i < 4; i++ )
|
|
{
|
|
KUIControlIconStatic* pBody = dynamicCast<KUIControlIconStatic*>(GetChild( CStringUtil::StringFormat( "select04%02d", i ).c_str() ));
|
|
|
|
if( pBody )
|
|
{
|
|
if( m_nBodyPosition < (int)m_vBodyList.size() )
|
|
{
|
|
pBody->SetIcon("05_ui.spr", m_vBodyList.at(i).m_iconName.c_str());
|
|
pBody->SetShow( true );
|
|
pBody->Enable();
|
|
}
|
|
else
|
|
{
|
|
pBody->SetShow( false );
|
|
pBody->Disable();
|
|
}
|
|
}
|
|
}
|
|
|
|
m_nSelectBody = m_nCurBody;
|
|
}
|
|
|
|
m_nCurSkinColor = 0;
|
|
VerifyAvatarHair();
|
|
}
|
|
break;
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA* pSendMsg = (SIMSG_UI_SEND_DATA*)pMsg;
|
|
|
|
if( pSendMsg->m_strString == "ani_cam" )
|
|
{
|
|
m_bAniCam = (pSendMsg->m_nNumber.getAmount() > 0 );
|
|
}
|
|
else if( pSendMsg->m_strString == "create_fail" )
|
|
{
|
|
m_bCreateChar = false;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
// This is piece of shit rendering thing, totally useless seems like
|
|
/*
|
|
if( bOpen )
|
|
{
|
|
if( !m_vHairList.empty() )
|
|
{
|
|
for( int i = 0; i <= 7; i++ )
|
|
{
|
|
KUIControlIconStatic* pHair = dynamicCast<KUIControlIconStatic*>(GetChild( CStringUtil::StringFormat( "select02%02d", i ).c_str() ));
|
|
|
|
if( pHair && i < m_vHairList.size() )
|
|
{
|
|
pHair->SetShow( true );
|
|
pHair->SetIcon("05_ui.spr", m_vHairList[i].m_iconName.c_str());
|
|
pHair->Enable();
|
|
}
|
|
}
|
|
}
|
|
if( !m_vFaceList.empty() )
|
|
{
|
|
for( int i = 0; i < 3; ++i )
|
|
{
|
|
KUIControlStatic * pFace = dynamicCast<KUIControlStatic*>(GetChild( CStringUtil::StringFormat( "face_box_%02d", i + 1 ).c_str() ));
|
|
KUIControlSimpleButton* pButtonFace = dynamicCast<KUIControlSimpleButton*>(GetChild( CStringUtil::StringFormat( "face_button_%02d", i+1 ).c_str() ));
|
|
|
|
if( pFace && pButtonFace )
|
|
{
|
|
if( m_nFacePosition + i < (int)m_vFaceList.size() )
|
|
{
|
|
pFace->SetShow( true );
|
|
pFace->SetAniName( m_vFaceList[m_nFacePosition + i].m_iconName.c_str() );
|
|
pButtonFace->Enable();
|
|
}
|
|
else
|
|
{
|
|
pFace->SetShow( false );
|
|
pButtonFace->Disable();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if( !m_vBodyList.empty() )
|
|
{
|
|
for( int i = 0; i < 3; ++i )
|
|
{
|
|
KUIControlStatic * pBody = dynamicCast<KUIControlStatic*>(GetChild( CStringUtil::StringFormat( "clothe_box_%02d", i+1 ).c_str() ));
|
|
KUIControlSimpleButton* pButtonBody = dynamicCast<KUIControlSimpleButton*>(GetChild( CStringUtil::StringFormat( "clothe_button_%02d", i+1 ).c_str() ));
|
|
|
|
if( pBody && pButtonBody )
|
|
{
|
|
if( m_nBodyPosition+i < (int)m_vBodyList.size() )
|
|
{
|
|
pBody->SetShow( true );
|
|
// 2010.04.21 - prodongi
|
|
pBody->SetAniName( m_vBodyList[m_nBodyPosition+i].m_iconName.c_str() );
|
|
pButtonBody->Enable();
|
|
}
|
|
else
|
|
{
|
|
pBody->SetShow( false );
|
|
pButtonBody->Disable();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if( !m_vDecoList.empty() )
|
|
{
|
|
for( int i = 0; i < 3; ++i )
|
|
{
|
|
KUIControlStatic * pDeco = dynamicCast<KUIControlStatic*>(GetChild( CStringUtil::StringFormat( "deco_box_%02d", i+1 ).c_str() ));
|
|
KUIControlSimpleButton* pButtonDece = dynamicCast<KUIControlSimpleButton*>(GetChild( CStringUtil::StringFormat( "deco_button_%02d", i+1 ).c_str() ));
|
|
|
|
if( pDeco && pButtonDece )
|
|
{
|
|
if( m_nDecoPosition+i < (int)m_vDecoList.size() )
|
|
{
|
|
pDeco->SetShow( true );
|
|
// 2010.04.21 - prodongi
|
|
pDeco->SetAniName( m_vDecoList[m_nDecoPosition+i].m_iconName.c_str() );
|
|
pButtonDece->Enable();
|
|
}
|
|
else
|
|
{
|
|
pDeco->SetShow( false );
|
|
pButtonDece->Disable();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*/
|
|
m_bCreateChar = false;
|
|
}
|
|
|
|
bool SUICreateCharSecondDlg::InitData( bool bReload )
|
|
{
|
|
clear();
|
|
|
|
m_nSelectFace = 0;
|
|
m_nSelectDeco = 0;
|
|
m_nSelectHair = 0;
|
|
m_nSelectedHairColor = 0;
|
|
m_nSelectBody = 0;
|
|
m_nSelectSkinColor = 0;
|
|
|
|
return SUIWnd::InitData(bReload);
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::SetCurrentFaceIcon( int nRace, int nSex, int nIndex )
|
|
{
|
|
SDefaultItemDB& DefaultItemDB = GetDefaultItemDB(); // DefaultModelResource
|
|
SDefaultTextureResourceDB& TextureResourceDB = GetDefaultTextureResourceDB(); // DefaultTextureResource
|
|
SDefaultTextureIconResourceDB& IconResourceDB = GetDefaultTextureIconResourceDB(); // DefaultTextureIconResource
|
|
|
|
unsigned int nFacesCount = DefaultItemDB.GetFaceCount();
|
|
for( int i(0); nFacesCount > i; i++ )
|
|
{
|
|
int nTextureGroupID = DefaultItemDB.m_FaceItemList[i]->texture_group_id;
|
|
|
|
int nTextureResourceCount = TextureResourceDB.GetTextureResourceCount();
|
|
for( int n(0); nTextureResourceCount > n; n++ )
|
|
{
|
|
if( TextureResourceDB.m_vDefaultTextureList[n]->texture_group_id == nTextureGroupID && TextureResourceDB.m_vDefaultTextureList[n]->texture_id == 0 )
|
|
{
|
|
int textureID = TextureResourceDB.m_vDefaultTextureList[n]->texture_id; // 0
|
|
int nIconID = TextureResourceDB.GetIconID(nTextureGroupID, textureID, nRace, nSex );
|
|
|
|
if( nIconID != -1 )
|
|
{
|
|
std::string strIconName = IconResourceDB.GetIconFileName( nIconID );
|
|
pushList(m_vFaceList, sPartsListInfo(strIconName, textureID));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::SetCurrentHairIcon( int nRace, int nSex, int nIndex )
|
|
{
|
|
struct HairIconsStruct
|
|
{
|
|
HairIconsStruct(int nRace, int nSex)
|
|
{
|
|
switch( nRace )
|
|
{
|
|
case GCLAN_GAIA:
|
|
{
|
|
if (nSex == SEX_FEMALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_gaf_001", 132001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_gaf_002", 132002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_gaf_003", 232001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_gaf_004", 232002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_gaf_005", 332001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_gaf_006", 332002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_gaf_007", 432001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_gaf_008", 432002)) );
|
|
}
|
|
else if (nSex == SEX_MALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_gam_001", 131001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_gam_002", 131002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_gam_003", 231001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_gam_004", 231002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_gam_005", 331001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_gam_006", 331002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_gam_007", 431001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_gam_008", 431002)) );
|
|
}
|
|
}
|
|
case GCLAN_DEVA:
|
|
{
|
|
if (nSex == SEX_FEMALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_def_001", 112001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_def_002", 112002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_def_003", 212001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_def_004", 212002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_def_005", 312001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_def_006", 312002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_def_007", 412001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_def_008", 412002)) );
|
|
}
|
|
else if (nSex == SEX_MALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_dem_001", 111001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_dem_002", 111002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_dem_003", 211001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_dem_004", 211002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_dem_005", 311001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_dem_006", 311002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_dem_007", 411001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_dem_008", 411002)) );
|
|
}
|
|
}
|
|
case GCLAN_ASURA:
|
|
{
|
|
if (nSex == SEX_FEMALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_asf_001", 122001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_asf_002", 122002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_asf_003", 222001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_asf_004", 222002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_asf_005", 322001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_asf_006", 322002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_asf_007", 422001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_asf_008", 422002)) );
|
|
}
|
|
else if (nSex == SEX_MALE)
|
|
{
|
|
tempMap.insert( std::make_pair(0, sPartsListInfo("static_hair_asm_001", 121001)) );
|
|
tempMap.insert( std::make_pair(1, sPartsListInfo("static_hair_asm_002", 121002)) );
|
|
tempMap.insert( std::make_pair(2, sPartsListInfo("static_hair_asm_003", 221001)) );
|
|
tempMap.insert( std::make_pair(3, sPartsListInfo("static_hair_asm_004", 221002)) );
|
|
tempMap.insert( std::make_pair(4, sPartsListInfo("static_hair_asm_005", 321001)) );
|
|
tempMap.insert( std::make_pair(5, sPartsListInfo("static_hair_asm_006", 321002)) );
|
|
tempMap.insert( std::make_pair(6, sPartsListInfo("static_hair_asm_007", 421001)) );
|
|
tempMap.insert( std::make_pair(7, sPartsListInfo("static_hair_asm_008", 421002)) );
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
~HairIconsStruct()
|
|
{
|
|
tempMap.clear();
|
|
};
|
|
|
|
std::map<int, sPartsListInfo> tempMap;
|
|
};
|
|
|
|
std::map<int, HairIconsStruct> hairmap;
|
|
|
|
HairIconsStruct hairstruct = HairIconsStruct(nRace, nSex);
|
|
|
|
for (int i = 0; i < 8; i++)
|
|
{
|
|
pushList(m_vHairList, hairstruct.tempMap.at(i));
|
|
}
|
|
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::SetCurrentBodyIcon( int nRace, int nSex, int nIndex )
|
|
{
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
std::string strIconFileName = "static_clothe_";
|
|
switch (nRace)
|
|
{
|
|
case GCLAN_ASURA: strIconFileName += "as"; break;
|
|
case GCLAN_GAIA: strIconFileName += "ga"; break;
|
|
case GCLAN_DEVA: strIconFileName += "de"; break;
|
|
}
|
|
nSex == SEX_FEMALE ? strIconFileName += "f_common_00" : strIconFileName += "m_common_00";
|
|
strIconFileName += std::to_string(static_cast<long long>(i+1));
|
|
m_vBodyList.push_back(sPartsListInfo(strIconFileName, 1));
|
|
}
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::SetCurrentDecoIcon( int nRace, int nSex, int nIndex )
|
|
{
|
|
int nIConGroupID = GetDefaultItemDB().GetFaceGroupID( nIndex );
|
|
|
|
for( int i(0); GetDefaultTextureResourceDB().GetTextureResourceCount() > i; i++ )
|
|
{
|
|
if( GetDefaultTextureResourceDB().m_vDefaultTextureList[i]->texture_group_id == nIConGroupID )
|
|
{
|
|
int textureID = GetDefaultTextureResourceDB().m_vDefaultTextureList[i]->texture_id;
|
|
int nIconID = GetDefaultTextureResourceDB().GetIconID( nIConGroupID, textureID, nRace, nSex );
|
|
|
|
if( nIconID != -1 && textureID != 0 )
|
|
{
|
|
std::string strIconName = GetDefaultTextureIconResourceDB().GetIconFileName( nIconID );
|
|
pushList(m_vDecoList, sPartsListInfo(strIconName, textureID));
|
|
}
|
|
}
|
|
}
|
|
|
|
sort( m_vDecoList.begin(), m_vDecoList.end() );
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::pushList(v_partslist& list, sPartsListInfo const& info)
|
|
{
|
|
it_partslist it = std::find(list.begin(), list.end(), info);
|
|
if (it != list.end())
|
|
return ;
|
|
list.push_back(info);
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::checkValidIndex(v_partslist const& list, int& index) const
|
|
{
|
|
if (0 > index) index = 0;
|
|
else if (list.size() <= index)
|
|
index = 0;
|
|
}
|
|
|
|
// Fraun 9.5.2 character creation 8/21/2025
|
|
void SUICreateCharSecondDlg::CharCreationProcMsgAtStatic(char const* iconName, char const* selectControl, sPartsListInfo const* info, int selectIndex)
|
|
{
|
|
// Display a border around the selected icon
|
|
KUIControlIconStatic* iconStatic = dynamicCast< KUIControlIconStatic* >(GetChild( iconName));
|
|
const KRect& rIconRect = iconStatic->GetRect();
|
|
|
|
if (selectControl == "select_box_01")
|
|
{
|
|
SetMovePos( selectControl, rIconRect.left + 6, rIconRect.top + 4);
|
|
}
|
|
else if (selectControl == "select_box_04")
|
|
{
|
|
SetMovePos( selectControl, rIconRect.left + 5, rIconRect.top);
|
|
}
|
|
else
|
|
{
|
|
SetMovePos( selectControl, rIconRect.left , rIconRect.top );
|
|
}
|
|
SetChildShow( selectControl, true );
|
|
|
|
SIMSG_UIWND_NOTIFY_TO_LOBBY msg( iconName );
|
|
msg.m_nSelectIndex = selectIndex;
|
|
|
|
if (info)
|
|
{
|
|
msg.m_textureId = info->m_textureId;
|
|
}
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
|
|
void SUICreateCharSecondDlg::VerifyAvatarHair()
|
|
{
|
|
SGameRenewalLobby* renewalLobby = (SGameRenewalLobby*)m_pGameManager->GetActiveGame();
|
|
if (!renewalLobby)
|
|
return ;
|
|
|
|
SIMSG_UIWND_NOTIFY_TO_LOBBY msg("");
|
|
msg.m_nSelectIndex = m_nCurHair;
|
|
msg.m_textureId = m_vHairList[m_nCurHair].m_textureId;
|
|
|
|
renewalLobby->VerifyCustomizeAvatarHair(&msg);
|
|
} |