void CFriendChange_UI::SetCirclePosition() { float x, y ; for(int i=0; i<5; i++) { x = cos((m_fDegree[i] * D3DX_PI) / 180) ; y = sin((m_fDegree[i] * D3DX_PI) / 180) ; m_fScale[i] = 1.0f / (y+2.0f) ; x = (x * m_fRX) + m_fX ; y = (y * m_fRY) + m_fY ; Position index ; CFriends *pFriend = g_Friends_List->GetFriend(m_nIconListIndex[i]) ; if(pFriend!=NULL) index = pFriend->GetIconIndex() ; else index = Position(0, 0) ; m_pSIcon[i]->SetTextureUV((float)(index.x * 24), (float)(index.y * 24), (float)((index.x+1) * 24), (float)((index.y+1) * 24)) ; m_pSIcon[i]->SetScale(m_fScale[i], m_fScale[i]) ; m_pSIcon[i]->SetPosition(x, y) ; } }
void CFriends::ConFriends(IConsole::IResult *pResult, void *pUserData) { CALLSTACK_ADD(); CFriends *pSelf = (CFriends *)pUserData; pSelf->Friends(); }
void CFriends::ConRemoveFriend(IConsole::IResult *pResult, void *pUserData) { CALLSTACK_ADD(); CFriends *pSelf = (CFriends *)pUserData; pSelf->RemoveFriend(pResult->GetString(0), pResult->GetString(1)); }
void CFriends::ConAddFriend(IConsole::IResult *pResult, void *pUserData) { CFriends *pSelf = (CFriends *)pUserData; pSelf->AddFriend(pResult->GetString(0), pResult->GetString(1)); }
void CFriendChange_UI::Init() { const char Okulo = 1 ; const char Makzelo = 2 ; const char Vento = 4 ; const char Busxo = 8 ; const char Rompo = 16 ; const char Rancho = 32 ; const char Mano = 64 ; int nFriendCode, nFriendNum=0 ; char filepath[1024] ; m_fRX = 40.0f ; m_fRY = 18.0f ; m_fMaxDegree = 72.0f ; for(int i=0; i<5; i++) { m_fDegree[i] = (float)((360 / 5) * i - 90) ; m_fScale[i] = 1.0f ; m_pSIcon[i] = new CSprite ; m_pSIcon[i]->Init(24.0f, 24.0f, "Resource/Image/Friends/Icon/SP_Symbol.png") ; m_pSIcon[i]->SetTextureUV((float)(i * 24), 24.0f, (float)((i+1) * 24), 48.0f) ; } sprintf_s(filepath, "Resource/Data/Maps/%s.frnd", g_StageProgress->GetSelectMapName()) ; FILE *pFile = fopen(filepath, "rb") ; fscanf(pFile, "%d", &nFriendCode) ; fclose(pFile) ; while(nFriendCode) { CFriends *pFriends ; if((nFriendCode & Okulo)==Okulo) { nFriendCode &= ~Okulo ; pFriends = new CFriends_Okulo ; } else if((nFriendCode & Makzelo)==Makzelo) { nFriendCode &= ~Makzelo ; pFriends = new CFriends_Makzelo ; } else if((nFriendCode & Vento)==Vento) { nFriendCode &= ~Vento ; pFriends = new CFriends_Vento ; } else if((nFriendCode & Busxo)==Busxo) { nFriendCode &= ~Busxo ; pFriends = new CFriends_Busxo ; } else if((nFriendCode & Rompo)==Rompo) { nFriendCode &= ~Rompo ; pFriends = new CFriends_Rompo ; } else if((nFriendCode & Rancho)==Rancho) { nFriendCode &= ~Rancho ; pFriends = new CFriends_Rancho ; } else if((nFriendCode & Mano)==Mano) { nFriendCode &= ~Mano ; pFriends = new CFriends_Mano ; } pFriends->Init() ; g_Friends_List->SetMaxFriends(++nFriendNum) ; g_Friends_List->AddFriend(pFriends) ; } }
void CFriends::ConRemoveFriend(IConsole::IResult *pResult, void *pUserData, int ClientID) { CFriends *pSelf = (CFriends *)pUserData; pSelf->RemoveFriend(pResult->GetString(0), pResult->GetString(1)); }