1487 lines
49 KiB
C++
1487 lines
49 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "SGameManager.h"
|
|
#include "SUIDungeonUnitWnd.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "KUIControlList.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlButton.h"
|
|
#include "KUIControlEdit.h"
|
|
#include "SDungeonResourceDB.h"
|
|
#include "SGameManager.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
#include "SGameMessage.h"
|
|
#include "SChatType.h"
|
|
#include "SStringDB.h"
|
|
#include "SJobDB.h"
|
|
#include "SMessengerMgr.h"
|
|
#include <toolkit/XStringUtil.h>
|
|
|
|
const char* lpMercenaryOutLine = "static_dungeon_party00";
|
|
|
|
namespace
|
|
{
|
|
const int g_LimitText = 20; // Edit 컨트롤 최대 텍스트.
|
|
bool g_bButtonState[MAXPARTYCOUNT] = {0,0,0,0,0,0,0,0};
|
|
void ButtonReSet()
|
|
{
|
|
for(int i=0; i<MAXPARTYCOUNT ; ++i)
|
|
g_bButtonState[i] = UP_BUTTON_STATE; // 버튼이 올라옴(파티창이 닫힌)상태로 리셋..
|
|
}
|
|
}
|
|
|
|
SUIDungeonUnitWnd::~SUIDungeonUnitWnd()
|
|
{
|
|
ButtonReSet();
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::InitControl()
|
|
{
|
|
// 던전 이름
|
|
KUIControlStatic* pDungeonName = dynamicCast<KUIControlStatic*>(GetChild("text_dungeon_01"));
|
|
if(pDungeonName)
|
|
{
|
|
std::string strDungeonName;
|
|
strDungeonName.append( GetStringDB().GetString( m_RaidMgr.getAimDungeonID() ) );
|
|
pDungeonName->SetCaption( CStringUtil::StringFormat( "<font:font_01><size:9><#f7941d><hcenter><vcenter>%s", strDungeonName.c_str() ).c_str() );
|
|
}
|
|
|
|
// 공대장 체크
|
|
// std::string strAttackUnitLeader = m_RaidMgr.getAttackUnitLeaderName();
|
|
m_bItsMeMaster = false;
|
|
|
|
SPartyMgr* pParty = m_PartyMgr.FindPartyByPlayerName( &std::string(m_PlayerInfoMgr.GetName()) );
|
|
if(pParty)
|
|
{
|
|
std::string strPartyName = pParty->GetPartyName();
|
|
size_t nPos = strPartyName.find_first_of("_");
|
|
|
|
if(nPos == -1) // 공대장 파티..
|
|
{
|
|
SPlayerSlot* pPlayer = pParty->FindMember(m_PlayerInfoMgr.GetName());
|
|
if(pPlayer)
|
|
{
|
|
if( pPlayer->IsLeader() )
|
|
m_bItsMeMaster = true;
|
|
else
|
|
m_bItsMeMaster = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 던전스톤에 참여가능한 최대 파티수
|
|
m_nMaxPartyNum = m_RaidMgr.GetMaxGuildPartyNum();
|
|
|
|
// 공대 이름 출력
|
|
KUIControlStatic* pTitle = dynamicCast<KUIControlStatic*>(GetChild("titlebar_text")); // Up 버튼
|
|
if(pTitle)
|
|
{
|
|
std::string strName = m_RaidMgr.getAttackUnitName();
|
|
pTitle->SetCaption( CStringUtil::StringFormat("<font:font_02><size:10><#FFFFFF><hcenter><vcenter>'%s' %s",strName.c_str(), S(12000)).c_str() );
|
|
}
|
|
|
|
if(m_bIsInitAttackUnit == false) // 공대장 체크는 변하지 않으므로 한번만 한다.
|
|
{
|
|
// 레이드 매니저에서 얻어온 정보 컨트롤에 매칭..
|
|
SetRaidInfo();
|
|
|
|
// 공대파티들 초기화..
|
|
InitParty(m_nCurPartyCount,m_nMyPartyNum);
|
|
m_bIsInitAttackUnit = true; // 더이상 안들어오게 막자...
|
|
}
|
|
else
|
|
{
|
|
SetRaidInfo();
|
|
SetButtonStateAll();
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetMyPartyNum()
|
|
{
|
|
std::string nMyName = m_PlayerInfoMgr.GetName();
|
|
|
|
SPartyMgr* pPartyMgr = m_PartyMgr.FindPartyByPlayerName(&nMyName);
|
|
if(pPartyMgr == NULL) // 2011. 12 .21 - marine 파티정보가 채워지기전에 들어올때가 있음..
|
|
return;
|
|
|
|
std::string partyName = pPartyMgr->GetPartyName();
|
|
m_nMyPartyNum = m_RaidMgr.getNumUseAttackUnit(partyName); //파티이름으로 공대창에서 순번을 얻음..
|
|
|
|
assert( m_nMyPartyNum >= m_nCurPartyCount || "현재 공대파티 수보다 내 파티 번호가 큼..");
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetRaidInfo()
|
|
{
|
|
// 파티 이름, 파티 인원
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
m_nCurPartyCount = PartyList.size();
|
|
|
|
// 각 파티의 인원 설정
|
|
for(int i=0 ; i<m_nCurPartyCount ; ++i)
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
if(pParty)
|
|
{
|
|
// 파티 인원
|
|
m_pPartyUserCount[i]->SetCaption(CStringUtil::StringFormat("<font:font_01><size:9><hcenter><#FFFFFF><vcenter>%d/8", pParty->GetMemberCount() ).c_str());
|
|
// 공대 이름
|
|
int Partynum = 12001 + PartyList[i]->GetPartyNum(); // 이번호는 전체공대중에서 내가 몇번째인지를 나타내고
|
|
m_pPartyName[i]->SetCaption(CStringUtil::StringFormat("<font:font_01><size:9><#FFFFFF><hcenter><vcenter>%s",S(Partynum) ).c_str() ) ;
|
|
// 마크 설정
|
|
int nPartyRealNum = m_RaidMgr.getNumberAtPartyName(pParty->GetPartyName())+1; // 이번호는 실제 사용되는 파티이름의 번호이다.(예로 공대가 5개인데 2,3번 공대가 없을 경우 위의 번호와 다르다.)
|
|
m_pPartyMarkStatic[i]->SetAniName(CStringUtil::StringFormat("common_mark_titanium_attackteam_%02d", nPartyRealNum ).c_str());
|
|
}
|
|
}
|
|
|
|
// 자신의 파티번호 설정
|
|
SetMyPartyNum();
|
|
|
|
if( (m_nPrePartyCount != m_nCurPartyCount) && m_bIsInitAttackUnit ) // 공대 파티수가 변했다면..
|
|
{
|
|
InitParty(m_nCurPartyCount, m_nMyPartyNum);
|
|
m_nPrePartyCount = m_nCurPartyCount;
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SaveButtonState()
|
|
{
|
|
for(int i=0 ; i< m_nCurPartyCount ; ++i)
|
|
g_bButtonState[i] = m_pPartyButton[i][DOWN_BTN_STATE]->IsShow();
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetButtonStateAll()
|
|
{
|
|
for(int i=0 ; i< m_nCurPartyCount ; ++i)
|
|
SetButtonState(i);
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetButtonState(int nNumber)
|
|
{
|
|
// 각 파티별로 버튼 상태 설정
|
|
if( nNumber == m_nMyPartyNum) // 내파티 일경우
|
|
{
|
|
SetShowMyParty(nNumber);
|
|
}
|
|
else // 내파티가 아닐 경우
|
|
{
|
|
if(g_bButtonState[nNumber] == UP_BUTTON_STATE)
|
|
{
|
|
m_pPartyButton[nNumber][UP_BUTTON_STATE]->SetShow(true);
|
|
m_pPartyButton[nNumber][DOWN_BTN_STATE]->SetShow(false);
|
|
}
|
|
else
|
|
{
|
|
m_pPartyButton[nNumber][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nNumber][DOWN_BTN_STATE]->SetShow(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::InitPartyControlPackage()
|
|
{
|
|
// 1. 기준 위치.. 버튼의 위치 저장.. 자신의 파티는 스태틱타입이므로 위치를 얻어 써야 하므로 한번 저장한다.
|
|
KUIControlButton *pBaseButton = dynamicCast<KUIControlButton*>(GetChild("button_attack_team_01")); // 요 버튼이 기준임..
|
|
if(!pBaseButton)
|
|
return;
|
|
|
|
KRect rcBaseRect = pBaseButton->GetRect();
|
|
KPoint ptBasePoint;
|
|
ptBasePoint.x = pBaseButton->GetRect().left;
|
|
ptBasePoint.y = pBaseButton->GetRect().top;
|
|
|
|
for(int i=0 ; i<ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
m_ptCheckButtonPos[i] = ptBasePoint;
|
|
m_ptCheckButtonPos[i].y += i*NOMAL_UI_GAP;
|
|
}
|
|
|
|
// 2. 버튼,스태틱이 한세트 뿐이므로 나머지 버튼을 복사해 놓자.
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT-1 ; ++i)
|
|
{
|
|
// 버튼 생성 - Up버튼
|
|
CopyControl(CStringUtil::StringFormat("button_attack_team_01").c_str(), CStringUtil::StringFormat("button_attack_team_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 버튼 생성 - Down버튼
|
|
CopyControl(CStringUtil::StringFormat("button_attack_team_release_01").c_str(), CStringUtil::StringFormat("button_attack_team_release_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 공대 순번
|
|
CopyControl(CStringUtil::StringFormat("text_number_01").c_str(), CStringUtil::StringFormat("text_number_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 공대 이름
|
|
CopyControl(CStringUtil::StringFormat("text_partyname_01").c_str(), CStringUtil::StringFormat("text_partyname_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 공대 인원
|
|
CopyControl(CStringUtil::StringFormat("text_total_01").c_str(), CStringUtil::StringFormat("text_total_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
}
|
|
// 3. UI팀에서 제작한 컨트롤들의 레이어 순서 조절
|
|
// UI팀에서 만든 한세트 컨트롤과 파티마크의 레이어가 아래로 깔려서 안보이므로 조정..
|
|
SetChildAsTop("text_partyname_01"); // 파티이름
|
|
SetChildAsTop("text_number_01"); // 파티 순서 번호
|
|
SetChildAsTop("text_total_01"); // 파티원수
|
|
SetChildAsTop("button_invite_01"); //공대 초대 버튼
|
|
SetChildAsTop("text_attack_team_invite_01"); //공대 초대 스태틱1
|
|
SetChildAsTop("text_attack_team_invite_02"); //공대 초대 스태틱2
|
|
SetChildAsTop("mark_siegeleader_01"); // 공대 리더 마크
|
|
|
|
for( int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i )
|
|
SetChildAsTop(CStringUtil::StringFormat("mark_attack_party_%02d", i+1).c_str());
|
|
|
|
// 4. 버튼, 스태틱들의 포인터 저장
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
m_pPartyButton[i][UP_BUTTON_STATE] = dynamicCast<KUIControlButton*>(GetChild(CStringUtil::StringFormat("button_attack_team_%02d", i+1).c_str())); // Up 버튼
|
|
m_pPartyButton[i][DOWN_BTN_STATE] = dynamicCast<KUIControlButton*>(GetChild(CStringUtil::StringFormat("button_attack_team_release_%02d", i+1).c_str())); // Down 버튼
|
|
m_pPartyNumStatic[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("text_number_%02d", i+1).c_str())); // 공대 순번
|
|
m_pPartyMarkStatic[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("mark_attack_party_%02d", i+1).c_str())); // 공대 표시 마크
|
|
m_pPartyName[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("text_partyname_%02d", i+1).c_str())); // 공대 이름
|
|
m_pPartyUserCount[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("text_total_%02d", i+1).c_str())); // 공대 인원
|
|
}
|
|
m_pMyPartyStatic = dynamicCast<KUIControlStatic*>(GetChild("panel_attack_my_team_01")); // 자신의 공대
|
|
m_pInvitePartyButton = dynamicCast<KUIControlButton*>(GetChild("button_invite_01")); // 공대 초대
|
|
m_pInvitePartyStatic[0] = dynamicCast<KUIControlStatic*>(GetChild("text_attack_team_invite_01")); // 더하기
|
|
m_pInvitePartyStatic[1] = dynamicCast<KUIControlStatic*>(GetChild("text_attack_team_invite_02")); // 공대 초대 text
|
|
m_pInvitePartyStatic[1]->SetCaption( CStringUtil::StringFormat("<font:font_01><size:9><#FFFFFF><hcenter><vcenter>%s",S(12014)).c_str());
|
|
m_pMyPartyMark = dynamicCast<KUIControlStatic*>(GetChild("mark_attack_my_team_01")); // 내파티 마크
|
|
// 5. 위치 저장 및 캡션 설정
|
|
|
|
// y좌표는 공유, x좌표는 각각(단 공대 마크의 위치는 y좌표가 다르다)
|
|
KRect rcPartyNum = m_pPartyNumStatic[0]->GetRect(); // 파티 번호
|
|
int nPartyNumX = rcBaseRect.left;
|
|
|
|
KRect rcPartyMark = m_pPartyMarkStatic[0]->GetRect(); // 파티 마크
|
|
int nPartyMarkX = rcPartyMark.left;
|
|
int nPartymarkY = rcPartyMark.top;
|
|
|
|
KRect rcPartyName = m_pPartyName[0]->GetRect(); // 파티 이름
|
|
int nPartyNameX = rcPartyName.left;
|
|
|
|
KRect rcPartyUserCount = m_pPartyUserCount[0]->GetRect(); // 파티 유저 수
|
|
int nPartyUserCountX = rcPartyUserCount.left;
|
|
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
m_pPartyButton[i][UP_BUTTON_STATE]->MovePos(m_ptCheckButtonPos[i].x, m_ptCheckButtonPos[i].y); // 업버튼
|
|
m_pPartyButton[i][DOWN_BTN_STATE]->MovePos(m_ptCheckButtonPos[i].x, m_ptCheckButtonPos[i].y); // 다운버튼
|
|
|
|
m_pPartyNumStatic[i]->MovePos(nPartyNumX,m_ptCheckButtonPos[i].y); // 파티 번호
|
|
m_pPartyNumStatic[i]->SetCaption(CStringUtil::StringFormat("<font:font_01><size:9><hcenter><#FFFFFF><vcenter>%d", i+1).c_str()); // 파티번호는 바뀌지 않으므로 지금 넣는다.
|
|
m_pPartyMarkStatic[i]->MovePos(nPartyMarkX,m_ptCheckButtonPos[i].y+8); // 파티표시 마크
|
|
m_pPartyName[i]->MovePos(nPartyNameX,m_ptCheckButtonPos[i].y); // 이름
|
|
m_pPartyUserCount[i]->MovePos(nPartyUserCountX,m_ptCheckButtonPos[i].y);// 파티 유저 수
|
|
}
|
|
|
|
// 6. 모두 비활성화..
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
SetShowParty(i,false);
|
|
}
|
|
|
|
// 공대 초대 관련 컨트롤 disable
|
|
m_pInvitePartyButton->SetShow(false);
|
|
m_pInvitePartyStatic[0]->SetShow(false);
|
|
m_pInvitePartyStatic[1]->SetShow(false);
|
|
|
|
// 툴팁
|
|
KUIControlStatic* pLeader = dynamicCast<KUIControlStatic*>(GetChild("mark_siegeleader_01"));
|
|
if(pLeader)
|
|
pLeader->SetTooltip(S(5130)); //"5130:공대장 마크"
|
|
|
|
KUIControlSimpleButton *pMin = dynamicCast<KUIControlSimpleButton*>(GetChild("button_transform_min"));
|
|
if(pMin)
|
|
pMin->SetTooltip(S(5128)); //"5128:간략 보기 버튼"
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetPartyButtonToggle(int nPartyNum, bool bCurButtonState )
|
|
{
|
|
if(nPartyNum == m_nMyPartyNum)
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false);
|
|
}
|
|
else if(bCurButtonState == BUTTON_STATE::UP_BUTTON_STATE) //버튼Up상태면 버튼Down상태로
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(true);
|
|
g_bButtonState[nPartyNum] = BUTTON_STATE::DOWN_BTN_STATE;
|
|
}
|
|
else //버튼Down상태면 버튼UP상태로
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(true);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false);
|
|
g_bButtonState[nPartyNum] = BUTTON_STATE::UP_BUTTON_STATE;
|
|
}
|
|
|
|
// 버튼이 외부메시지로 바뀌면 Select 상태로 변화 되는데 노멀상태로 강제 변환 시킨다..
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetButtonState(KUIControlButton::KBUTTON_NORMAL);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetButtonState(KUIControlButton::KBUTTON_NORMAL);
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::InitParty(int nPartyCount, int nMyPartNum)
|
|
{
|
|
// 현재 파티수 만큼 컨트롤 설정하고
|
|
for( int i=0 ; i<ATTACK_UNIT::MAXPARTYCOUNT ; ++i )
|
|
{
|
|
if(nMyPartNum == i) // 내파티
|
|
SetShowMyParty(i);
|
|
else if( i < nPartyCount ) // 남의 파티
|
|
SetShowParty(i,true);
|
|
else // 없는 파티
|
|
{
|
|
SetShowParty(i,false);
|
|
g_bButtonState[i] = UP_BUTTON_STATE;
|
|
}
|
|
}
|
|
// 공대장일 경우에는 공대 초대 버튼 추가 설정
|
|
if(m_bItsMeMaster)
|
|
{
|
|
if(nPartyCount == m_nMaxPartyNum)
|
|
SetShowInviteControls(nPartyCount,false);
|
|
else
|
|
SetShowInviteControls(nPartyCount,true);
|
|
}
|
|
else
|
|
SetShowInviteControls(nPartyCount,false);
|
|
// 컨트롤 리사이징
|
|
SetResizeFrame(nPartyCount);
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetShowParty(int nPartyNum,bool bShow)
|
|
{
|
|
if(bShow)
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(!g_bButtonState[nPartyNum]); // Up 버튼
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(g_bButtonState[nPartyNum]); // Down 버튼
|
|
}
|
|
else
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false); // Up 버튼
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false); // Down 버튼
|
|
}
|
|
m_pPartyNumStatic[nPartyNum]->SetShow(bShow); // 공대 순번
|
|
m_pPartyMarkStatic[nPartyNum]->SetShow(bShow); // 공대 표시 마크
|
|
m_pPartyName[nPartyNum]->SetShow(bShow); // 공대 이름
|
|
m_pPartyUserCount[nPartyNum]->SetShow(bShow); // 공대 인원
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetShowMyParty(int nMyPartyNum)
|
|
{
|
|
// 컨트롤들 보이기,안보이기 설정
|
|
m_pPartyButton[nMyPartyNum][UP_BUTTON_STATE]->SetShow(false); // Up 버튼
|
|
m_pPartyButton[nMyPartyNum][DOWN_BTN_STATE]->SetShow(false); // Down 버튼
|
|
m_pPartyNumStatic[nMyPartyNum]->SetShow(true); // 공대 순번
|
|
m_pPartyMarkStatic[nMyPartyNum]->SetShow(false); // 공대 표시 마크
|
|
m_pMyPartyMark->SetShow(true); // 내 파티 마크
|
|
m_pPartyName[nMyPartyNum]->SetShow(true); // 공대 이름
|
|
m_pPartyUserCount[nMyPartyNum]->SetShow(true); // 공대 인원
|
|
|
|
// 내파티 스태틱 컨트롤 위치 변경
|
|
m_pMyPartyStatic->SetShow(true);
|
|
|
|
KRect rc = m_pPartyButton[nMyPartyNum][UP_BUTTON_STATE]->GetRect();
|
|
m_pMyPartyStatic->MovePos(rc.left,rc.top);
|
|
|
|
rc = m_pPartyMarkStatic[nMyPartyNum]->GetRect();
|
|
m_pMyPartyMark->MovePos(rc.left,rc.top);
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetShowInviteControls(int nPartyCount, bool bShow )
|
|
{
|
|
if(bShow)
|
|
{
|
|
m_pInvitePartyButton->SetShow(true);
|
|
m_pInvitePartyStatic[0]->SetShow(true);
|
|
m_pInvitePartyStatic[1]->SetShow(true);
|
|
|
|
// 위치 설정
|
|
|
|
KRect rcRect = m_pPartyButton[nPartyCount][UP_BUTTON_STATE]->GetRect();
|
|
m_pInvitePartyButton->MovePos(rcRect.left,rcRect.top); // 버튼 위치 설정
|
|
|
|
rcRect = m_pPartyNumStatic[nPartyCount]->GetRect();
|
|
m_pInvitePartyStatic[0]->MovePos(rcRect.left,rcRect.top); // "+" 스태틱 위치 설정
|
|
|
|
rcRect = m_pPartyName[nPartyCount]->GetRect();
|
|
m_pInvitePartyStatic[1]->MovePos(rcRect.left,rcRect.top); // "공대 초대" 스태틱 위치 설정
|
|
}
|
|
else
|
|
{
|
|
m_pInvitePartyButton->SetShow(false);
|
|
m_pInvitePartyStatic[0]->SetShow(false);
|
|
m_pInvitePartyStatic[1]->SetShow(false);
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::SetResizeFrame(int nPartyCount)
|
|
{
|
|
// 2011. 10. 13 - marine
|
|
// 공대 숫자에 맞춰서 창의 크기를 조절하는데
|
|
// 처음에 공대 숫자가 Max라고 가정하고
|
|
// nPreCount 에서 현재 파티의 숫자를 뺀만큼을 bottom에서 빼서 창크기를 조절..
|
|
// 공대장일 경우에는 공대숫자를 하나 더 늘려서 계산(공대추가버튼)
|
|
|
|
//static nPreCount = ATTACK_UNIT::MAXPARTYCOUNT; // 리사이즈 하기전의 버튼의 갯수
|
|
int nCurrentCount; // 현재 창의 갯수
|
|
|
|
if(m_bIsFirstResize) // 처음 리사이즈 할때는 파티의 갯수를 증가
|
|
{
|
|
nCurrentCount = nPartyCount;
|
|
m_bIsFirstResize = false;
|
|
}
|
|
else
|
|
nCurrentCount = nPartyCount; // 리사이즈 할때의 버튼 갯수
|
|
|
|
if( m_bItsMeMaster && (nCurrentCount != m_nMaxPartyNum) )
|
|
++nCurrentCount;
|
|
|
|
int nFixCount = m_nPreCount-nCurrentCount; // 리사이즈 하기전,후의 차이
|
|
|
|
// 렉트 수정
|
|
KRect rcRect[3];
|
|
KUIControlStatic* pStatic1 = dynamicCast<KUIControlStatic*>(GetChild("outframe"));
|
|
KUIControlStatic* pStatic2 = dynamicCast<KUIControlStatic*>(GetChild("inframe"));
|
|
|
|
rcRect[0] = pStatic1->GetRect();
|
|
rcRect[1] = pStatic2->GetRect();
|
|
rcRect[2] = GetRect();
|
|
|
|
for( int i=0 ; i<3 ; ++i )
|
|
rcRect[i].bottom -= (nFixCount * NOMAL_UI_GAP);
|
|
|
|
pStatic1->Resize(rcRect[0]);
|
|
pStatic2->Resize(rcRect[1]);
|
|
Resize(rcRect[2]);
|
|
|
|
m_nPreCount = nCurrentCount;
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::AddParty()
|
|
{
|
|
if(m_nCurPartyCount == MAXPARTYCOUNT)
|
|
return;
|
|
|
|
SetShowParty(m_nCurPartyCount,true);
|
|
|
|
if( m_nCurPartyCount == MAXPARTYCOUNT-1 ) // 공격대가 Max가 되는 경우
|
|
SetShowInviteControls(m_nCurPartyCount,false);
|
|
else
|
|
{
|
|
SetShowInviteControls(m_nCurPartyCount+1,true);
|
|
SetResizeFrame(m_nCurPartyCount);
|
|
}
|
|
++m_nCurPartyCount;
|
|
}
|
|
|
|
bool SUIDungeonUnitWnd::InitControls( KPoint kPos )
|
|
{
|
|
SetCustomMovingRect( KRect( 0, 0, m_rcRegion.GetWidth(), 20 ) );
|
|
InitPartyControlPackage();
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIDungeonUnitWnd::InitData( bool bReload /*= false*/ )
|
|
{
|
|
return SUIWnd::InitData( bReload );
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
if( bOpen )
|
|
{
|
|
if( m_RaidMgr.GetPartyCount() )
|
|
{
|
|
m_pGameManager->StartSound( "ui_popup_window01.wav" );
|
|
|
|
KRect rc = m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_MINI)->GetRect(); // 2011. 11. 15 - marine
|
|
this->MovePos(rc.left, rc.top);
|
|
InitControl();
|
|
|
|
return;
|
|
}
|
|
else m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT, false ) );
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::findSelectedSlotPartyName( int nNum, std::string &strName )
|
|
{
|
|
std::string strPartyName = "";
|
|
for(int j=0 ; j< m_nCurPartyCount ; ++j)
|
|
{
|
|
SRaidInfo* pRaidInfo = m_RaidMgr.GetRaidInfo(j);
|
|
if(pRaidInfo)
|
|
{
|
|
strPartyName = pRaidInfo->GetPartyName();
|
|
strName = strPartyName;
|
|
size_t nPos = strPartyName.find_first_of("_")+ 2;
|
|
size_t nEndPos = strPartyName.size() - 1;
|
|
|
|
if(nPos < 3 ) // _가 없는경우니까 공대장 파티
|
|
{
|
|
if(nNum == 0)
|
|
return;
|
|
else
|
|
continue;
|
|
}
|
|
|
|
std::string strNumber = strPartyName.substr(nPos, nEndPos);
|
|
int nNumber = atoi( strNumber.c_str())+1;
|
|
if(nNumber == nNum)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
assert(true&&"공대창 슬롯에 해당하는 파티이름을 찾을 수 없다..");
|
|
}
|
|
|
|
int SUIDungeonUnitWnd::findSelectedSltotPartyNumber( std::string &PartyName )
|
|
{
|
|
if(m_nCurPartyCount != (int)m_RaidMgr.GetPartyCount())
|
|
return -1;
|
|
|
|
// 1. 파티 이름으로 내 공대 번호를 찾고
|
|
std::string strPartyName = PartyName;
|
|
|
|
size_t nPos = strPartyName.find_first_of("_")+ 2;
|
|
size_t nEndPos = strPartyName.size() - 1;
|
|
|
|
if(nPos < 3 ) // _가 없는경우니까 공대장 파티
|
|
return 0;
|
|
|
|
std::string strNumber = strPartyName.substr(nPos, nEndPos);
|
|
int nPartyNum = atoi( strNumber.c_str())+1;
|
|
|
|
// 2. 찾은 번호로 공대UI상에서의 순서를 찾는다.
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
for(int i=0 ; i<m_nCurPartyCount ; ++i)
|
|
{
|
|
if( PartyList[i] && (PartyList[i]->GetPartyNum() == nPartyNum) )
|
|
nPartyNum = i;
|
|
}
|
|
return nPartyNum;
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_transform_min" ) == 0 ) //2011. 10 .10 - marine 미니창 전환
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT , false) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_MINI , true) );
|
|
SaveButtonState(); // 현재 버튼 상태 저장
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_invite_01" ) == 0 ) // 공대 파티 초대
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_INVITATION , true) );
|
|
}
|
|
else
|
|
{
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
int nCurPartyNum = 0;
|
|
for( int i=0 ; i<m_nCurPartyCount ; ++i )
|
|
{
|
|
std::string strPartyName;
|
|
if(::_stricmp( lpszControlID, CStringUtil::StringFormat("button_attack_team_%02d", i+1).c_str() ) == 0) //Up버튼일 경우
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
if(pParty)
|
|
nCurPartyNum = pParty->GetPartyNum();
|
|
|
|
SetPartyButtonToggle(i,BUTTON_STATE::UP_BUTTON_STATE);
|
|
findSelectedSlotPartyName(nCurPartyNum,strPartyName);
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_party_wnd2", strPartyName.c_str() ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MINIMAP, "show_party_wnd2", strPartyName.c_str() ) );
|
|
|
|
break;
|
|
}
|
|
if(::_stricmp( lpszControlID, CStringUtil::StringFormat("button_attack_team_release_%02d", i+1).c_str() ) == 0) //Down버튼일 경우
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
if(pParty)
|
|
nCurPartyNum = pParty->GetPartyNum();
|
|
|
|
SetPartyButtonToggle(i,BUTTON_STATE::DOWN_BTN_STATE);
|
|
findSelectedSlotPartyName(nCurPartyNum,strPartyName);
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "hide_party_wnd2", strPartyName.c_str() ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MINIMAP, "hide_party_wnd2", strPartyName.c_str() ) );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KGENWND_MOVE:
|
|
{
|
|
LimitMoveWnd();
|
|
}
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIDungeonUnitWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA* pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
int nPartyNum = findSelectedSltotPartyNumber( pData->m_strText );
|
|
|
|
if(nPartyNum == -1)
|
|
return;
|
|
|
|
if(pData->m_strString == "hide_party_wnd2")
|
|
{
|
|
SetPartyButtonToggle( nPartyNum, BUTTON_STATE::DOWN_BTN_STATE );
|
|
}
|
|
|
|
if(pData->m_strString == "open_party_wnd2")
|
|
{
|
|
SetPartyButtonToggle( nPartyNum, BUTTON_STATE::UP_BUTTON_STATE );
|
|
}
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
case IMSG_UI_DUNGEONUNIT_UPDATE:
|
|
{
|
|
pMsg->bUse = true;
|
|
SIMSG_UI_DUNGEONUNIT_UPDATE* msg = dynamicCast<SIMSG_UI_DUNGEONUNIT_UPDATE*>(pMsg);
|
|
if (!msg)
|
|
return ;
|
|
|
|
if (msg->m_initAttackUnitMember)
|
|
m_bIsInitAttackUnit = false;
|
|
|
|
if( m_RaidMgr.GetPartyCount() == 0 )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT , false) );
|
|
ButtonReSet();
|
|
}
|
|
else
|
|
{
|
|
InitControl();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
SUIDungeonUnitMiniWnd::~SUIDungeonUnitMiniWnd()
|
|
{
|
|
ButtonReSet();
|
|
}
|
|
|
|
bool SUIDungeonUnitMiniWnd::InitControls( KPoint kPos )
|
|
{
|
|
SetCustomMovingRect( KRect( 0, 0, m_rcRegion.GetWidth(), 20 ) );
|
|
InitPartyControlPackage();
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIDungeonUnitMiniWnd::InitData( bool bReload /*= false*/ )
|
|
{
|
|
return SUIWnd::InitData( bReload );
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::findSelectedSlotPartyName( int nNum, std::string &strName )
|
|
{
|
|
std::string strPartyName = "";
|
|
for(int j=0 ; j< m_nCurPartyCount ; ++j)
|
|
{
|
|
SRaidInfo* pRaidInfo = m_RaidMgr.GetRaidInfo(j);
|
|
if(pRaidInfo)
|
|
{
|
|
strPartyName = pRaidInfo->GetPartyName();
|
|
strName = strPartyName;
|
|
size_t nPos = strPartyName.find_first_of("_")+ 2;
|
|
size_t nEndPos = strPartyName.size() - 1;
|
|
|
|
if(nPos < 3 ) // _가 없는경우니까 공대장 파티
|
|
{
|
|
if(nNum == 0)
|
|
return;
|
|
else
|
|
continue;
|
|
}
|
|
|
|
std::string strNumber = strPartyName.substr(nPos, nEndPos);
|
|
int nNumber = atoi( strNumber.c_str())+1;
|
|
if(nNumber == nNum)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
assert(true&&"공대창 슬롯에 해당하는 파티이름을 찾을 수 없다..");
|
|
}
|
|
|
|
int SUIDungeonUnitMiniWnd::findSelectedSltotPartyNumber( std::string &PartyName )
|
|
{
|
|
if(m_nCurPartyCount != (int)m_RaidMgr.GetPartyCount())
|
|
return -1;
|
|
|
|
// 1. 파티 이름으로 내 공대 번호를 찾고
|
|
std::string strPartyName = PartyName;
|
|
|
|
size_t nPos = strPartyName.find_first_of("_")+ 2;
|
|
size_t nEndPos = strPartyName.size() - 1;
|
|
|
|
if(nPos < 3 ) // _가 없는경우니까 공대장 파티
|
|
return 0;
|
|
|
|
std::string strNumber = strPartyName.substr(nPos, nEndPos);
|
|
int nPartyNum = atoi( strNumber.c_str())+1;
|
|
|
|
// 2. 찾은 번호로 공대UI상에서의 순서를 찾는다.
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
for(int i=0 ; i<m_nCurPartyCount ; ++i)
|
|
{
|
|
if( PartyList[i] && (PartyList[i]->GetPartyNum() == nPartyNum) )
|
|
nPartyNum = i;
|
|
}
|
|
return nPartyNum;
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_transform_max" ) == 0 )
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT , true) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_MINI , false) );
|
|
SaveButtonState(); // 버튼 상태 저장
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_invite_01" ) == 0 )
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_INVITATION , true) );
|
|
else
|
|
{
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
int nCurPartyNum = 0;
|
|
for( int i=0 ; i<ATTACK_UNIT::MAXPARTYCOUNT ; ++i )
|
|
{
|
|
std::string strPartyName;
|
|
if(::_stricmp( lpszControlID, CStringUtil::StringFormat("button_attack_team_%02d", i+1).c_str() ) == 0) //Up버튼일 경우
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
if(pParty)
|
|
nCurPartyNum = pParty->GetPartyNum();
|
|
SetPartyButtonToggle(i,BUTTON_STATE::UP_BUTTON_STATE);
|
|
findSelectedSlotPartyName(nCurPartyNum,strPartyName);
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "show_party_wnd2", strPartyName.c_str() ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MINIMAP, "show_party_wnd2", strPartyName.c_str() ) );
|
|
break;
|
|
}
|
|
if(::_stricmp( lpszControlID, CStringUtil::StringFormat("button_attack_team_release_%02d", i+1).c_str() ) == 0) //Down버튼일 경우
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
if(pParty)
|
|
nCurPartyNum = pParty->GetPartyNum();
|
|
SetPartyButtonToggle(i,BUTTON_STATE::DOWN_BTN_STATE);
|
|
findSelectedSlotPartyName(nCurPartyNum,strPartyName);
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_PARTY, "hide_party_wnd2", strPartyName.c_str() ) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SEND_DATA( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_MINIMAP, "hide_party_wnd2", strPartyName.c_str() ) );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KGENWND_MOVE:
|
|
{
|
|
LimitMoveWnd();
|
|
}
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch(pMsg->nType)
|
|
{
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
SIMSG_UI_SEND_DATA* pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
|
|
int nPartyCount = findSelectedSltotPartyNumber(pData->m_strText);
|
|
if(nPartyCount == -1)
|
|
return;
|
|
if(pData->m_strString == "hide_party_wnd2")
|
|
{
|
|
SetPartyButtonToggle( nPartyCount ,BUTTON_STATE::DOWN_BTN_STATE );
|
|
}
|
|
if(pData->m_strString == "open_party_wnd2")
|
|
{
|
|
SetPartyButtonToggle( nPartyCount ,BUTTON_STATE::UP_BUTTON_STATE );
|
|
}
|
|
|
|
pMsg->bUse = true;
|
|
}
|
|
break;
|
|
|
|
case IMSG_MOUSEMOVE:
|
|
{
|
|
if(IsShow() == false)
|
|
break;
|
|
|
|
SIMSG_MOUSEMOVE* pMouseMove = (SIMSG_MOUSEMOVE* )pMsg;
|
|
m_ptMousePos.x = ((int)(short)LOWORD(pMouseMove->lParam));
|
|
m_ptMousePos.y = ((int)(short)HIWORD(pMouseMove->lParam));
|
|
}
|
|
break;
|
|
case IMSG_UI_DUNGEONUNIT_UPDATE:
|
|
{
|
|
if( m_RaidMgr.GetPartyCount() == 0) // 공대가 없어졌을 때
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_MINI , false) );
|
|
ButtonReSet();
|
|
}
|
|
else
|
|
{
|
|
InitControl();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::Process(DWORD dwTime)
|
|
{
|
|
SUIWnd::Process( dwTime );
|
|
|
|
// 2011. 10 .17 - marine 마우스 오버/언오버 상태 체크
|
|
bool b_IsMouseOverBefore = m_bIsMouseOver;
|
|
|
|
(GetRect().IsInRect(m_ptMousePos.x,m_ptMousePos.y))? m_bIsMouseOver = true : m_bIsMouseOver = false;
|
|
|
|
if(b_IsMouseOverBefore == m_bIsMouseOver) // 이전 상태와 비교
|
|
{
|
|
if(m_nFaidFlag == FAID_INOUT::FAID_NONE)
|
|
return;
|
|
else
|
|
FaidInOutProcess(dwTime);
|
|
}
|
|
else
|
|
{
|
|
if(m_bIsMouseOver)
|
|
{
|
|
if( m_nFaidFlag == FAID_INOUT::FAID_NONE ) // 2011. 11. 15 - marine 페이드 인/아웃이 진행되고 있을 때가 아닌경우에만 초기화
|
|
m_fAlpha = 0.0f;
|
|
m_nFaidFlag = FAID_INOUT::FAID_IN;
|
|
}
|
|
else
|
|
{
|
|
if( m_nFaidFlag == FAID_INOUT::FAID_NONE )
|
|
m_fAlpha = 1.0f;
|
|
m_nFaidFlag = FAID_INOUT::FAID_OUT;
|
|
}
|
|
m_lastTime = dwTime;
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::FaidInOutProcess(DWORD dwTime)
|
|
{
|
|
DWORD elapsedtime = dwTime - m_lastTime;
|
|
m_lastTime = dwTime;
|
|
|
|
float t = (float)elapsedtime/1000.0f;
|
|
float v = 3.0f; /// 2012.01.16 속도를 3.0으로 수정함 - prodongi
|
|
float ca = t*v;
|
|
|
|
if(m_nFaidFlag == FAID_INOUT::FAID_IN)
|
|
{
|
|
m_fAlpha += ca;
|
|
if(m_fAlpha >= 1.0f)
|
|
{
|
|
m_fAlpha = 1.0f;
|
|
m_nFaidFlag = FAID_INOUT::FAID_NONE;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
m_fAlpha -= ca;
|
|
if(m_fAlpha <= 0.0f)
|
|
{
|
|
m_fAlpha = 0.0f;
|
|
m_nFaidFlag = FAID_INOUT::FAID_NONE;
|
|
}
|
|
}
|
|
|
|
SetFaidCtrlAlpha(m_fAlpha);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetFaidCtrlAlpha(float fScale)
|
|
{
|
|
for(int i=0 ; i< MOUSEOVER_CTRL ; ++i)
|
|
m_pMouseOverShow[i]->ChangeAlpha(m_fAlpha);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
if( bOpen )
|
|
{
|
|
if( m_RaidMgr.GetPartyCount() )
|
|
{
|
|
KRect rc = m_pGameManager->GetSUI(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT)->GetRect(); // 2011. 11. 15 - marine
|
|
this->MovePos(rc.left, rc.top);
|
|
m_pGameManager->StartSound( "ui_popup_window01.wav" );
|
|
InitControl();
|
|
return;
|
|
}
|
|
else m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT, false ) );
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::InitControl()
|
|
{
|
|
// 공대장 체크
|
|
m_bItsMeMaster = false;
|
|
|
|
SPartyMgr* pParty = m_PartyMgr.FindPartyByPlayerName( &std::string(m_PlayerInfoMgr.GetName()) );
|
|
if(pParty)
|
|
{
|
|
std::string strPartyName = pParty->GetPartyName();
|
|
size_t nPos = strPartyName.find_first_of("_");
|
|
|
|
if(nPos == -1) // 공대장 파티..
|
|
{
|
|
SPlayerSlot* pPlayer = pParty->FindMember(m_PlayerInfoMgr.GetName());
|
|
if(pPlayer)
|
|
{
|
|
if( pPlayer->IsLeader() )
|
|
m_bItsMeMaster = true;
|
|
else
|
|
m_bItsMeMaster = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
// 던전스톤에 참여가능한 최대 파티수
|
|
m_nMaxPartyNum = m_RaidMgr.GetMaxGuildPartyNum();
|
|
|
|
KUIControlStatic* pTitle = dynamicCast<KUIControlStatic*>(GetChild("titlebar_text")); // Up 버튼
|
|
if(pTitle)
|
|
{
|
|
std::string strName = m_RaidMgr.getAttackUnitName();
|
|
pTitle->SetCaption( CStringUtil::StringFormat("<font:font_02><size:10><#FFFFFF><hcenter><vcenter>'%s' %s",strName.c_str(), S(12000)).c_str() );
|
|
}
|
|
|
|
if(m_bIsInitAttackUnit == false) // 공대이름, 공대장 체크는 변하지 않으므로 한번만 한다.
|
|
{
|
|
// 레이드 매니저에서 얻어온 정보 컨트롤에 매칭..
|
|
SetRaidInfo();
|
|
|
|
// 공대파티들 초기화..
|
|
InitParty(m_nCurPartyCount,m_nMyPartyNum);
|
|
m_bIsInitAttackUnit = true; // 더이상 안들어오게 막자...
|
|
}
|
|
else
|
|
{
|
|
SetRaidInfo();
|
|
}
|
|
|
|
SetButtonStateAll();
|
|
SetToolTip();
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetMyPartyNum()
|
|
{
|
|
std::string nMyName = m_PlayerInfoMgr.GetName();
|
|
|
|
SPartyMgr* pPartyMgr = m_PartyMgr.FindPartyByPlayerName(&nMyName);
|
|
if(pPartyMgr == NULL) // 2011. 12 .21 - marine 파티정보가 채워지기전에 들어올때가 있음..
|
|
return;
|
|
|
|
std::string partyName = pPartyMgr->GetPartyName();
|
|
m_nMyPartyNum = m_RaidMgr.getNumUseAttackUnit(partyName); //파티이름으로 공대창에서 순번을 얻음..
|
|
|
|
assert( m_nMyPartyNum >= m_nCurPartyCount || "현재 공대파티 수보다 내 파티 번호가 큼..");
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetRaidInfo()
|
|
{
|
|
// 파티 이름, 파티 인원
|
|
std::vector< SRaidInfo* > PartyList = m_RaidMgr.GetRaidInfoList();
|
|
|
|
// 파티 카운트 설정
|
|
m_nCurPartyCount = PartyList.size();
|
|
|
|
// 파티 수만큼 툴팁,번호 설정
|
|
for(int i=0 ; i<m_nCurPartyCount ; ++i)
|
|
{
|
|
SRaidInfo *pParty = PartyList[i];
|
|
|
|
// 툴팁정보 만들기..
|
|
m_strToolTip[i] = CStringUtil::StringFormat("%d: %s %d/8",i+1, S(12001+i), PartyList[i]->GetMemberCount());
|
|
// 공대 이름
|
|
int Partynum = PartyList[i]->GetPartyNum()+1; // 이번호는 전체 공대 파티중에서 몇번째인지를 나타내고
|
|
m_pPartyNumStatic[i]->SetCaption(CStringUtil::StringFormat("<font:font_01><size:9><#FFFFFF><hcenter><vcenter>%d",Partynum ).c_str() ) ;
|
|
// 마크 설정
|
|
int nPartyRealNum = m_RaidMgr.getNumberAtPartyName(pParty->GetPartyName())+1; // 이번호는 실제 사용되는 파티이름의 번호이다.
|
|
m_pPartyMarkStatic[i]->SetAniName(CStringUtil::StringFormat("common_mark_titanium_attackteam_%02d", nPartyRealNum ).c_str());
|
|
}
|
|
|
|
// 내파티 번호 찾기
|
|
SetMyPartyNum();
|
|
|
|
if( (m_nPrePartyCount != m_nCurPartyCount) && m_bIsInitAttackUnit ) // 공대 파티수가 변했다면..
|
|
{
|
|
InitParty(m_nCurPartyCount,m_nMyPartyNum);
|
|
m_nPrePartyCount = m_nCurPartyCount;
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::InitPartyControlPackage()
|
|
{
|
|
// 1. 컨트롤들 만들기.
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT-1 ; ++i)
|
|
{
|
|
// 버튼 생성 - Up버튼
|
|
CopyControl(CStringUtil::StringFormat("button_attack_team_01").c_str(), CStringUtil::StringFormat("button_attack_team_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 버튼 생성 - Down버튼
|
|
CopyControl(CStringUtil::StringFormat("button_attack_team_release_01").c_str(), CStringUtil::StringFormat("button_attack_team_release_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
// 공대 순번
|
|
CopyControl(CStringUtil::StringFormat("text_number_01").c_str(), CStringUtil::StringFormat("text_number_%02d", i+2).c_str(), KRect(0,0,0,0));
|
|
}
|
|
|
|
// 2. UI팀에서 제작한 컨트롤들의 레이어 순서 조절
|
|
// UI팀에서 만든 한세트 컨트롤과 파티마크의 레이어가 아래로 깔려서 안보이므로 조정..
|
|
SetChildAsTop("text_number_01"); // 공대번호 1번
|
|
SetChildAsTop("text_attack_team_invite_01"); // 공대 초대 스태틱
|
|
SetChildAsTop("mark_siegeleader_01"); // 공대장 마크
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
SetChildAsTop(CStringUtil::StringFormat("mark_attack_party_%02d", i+1).c_str()); //공대 파티 마크
|
|
|
|
// 3. 컨트롤 포인터 저장
|
|
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
m_pPartyButton[i][UP_BUTTON_STATE] = dynamicCast<KUIControlButton*>(GetChild(CStringUtil::StringFormat("button_attack_team_%02d", i+1).c_str())); // Up 버튼
|
|
m_pPartyButton[i][DOWN_BTN_STATE] = dynamicCast<KUIControlButton*>(GetChild(CStringUtil::StringFormat("button_attack_team_release_%02d", i+1).c_str())); // Down 버튼
|
|
m_pPartyNumStatic[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("text_number_%02d", i+1).c_str())); // 공대 순번
|
|
m_pPartyMarkStatic[i] = dynamicCast<KUIControlStatic*>(GetChild(CStringUtil::StringFormat("mark_attack_party_%02d", i+1).c_str())); // 공대 표시 마크
|
|
}
|
|
m_pMyPartyStatic = dynamicCast<KUIControlStatic*>(GetChild("panel_attack_my_team_01")); // 자신의 공대
|
|
m_pInvitePartyButton = dynamicCast<KUIControlButton*>(GetChild("button_invite_01")); // 공대 초대
|
|
m_pInvitePartyStatic = dynamicCast<KUIControlStatic*>(GetChild("text_attack_team_invite_01")); // "+"스태틱
|
|
|
|
// 마우스 오버/ 언오버에 따라 show/unshow 될 컨트롤 들
|
|
m_pMouseOverShow[0] = dynamicCast<KUIControlStatic*>(GetChild("titlebar_text"));
|
|
m_pMouseOverShow[1] = dynamicCast<KUIControlStatic*>(GetChild("titlebar_deco"));
|
|
m_pMouseOverShow[2] = dynamicCast<KUIControlStatic*>(GetChild("titlebar"));
|
|
m_pMouseOverShow[3] = dynamicCast<KUIControlStatic*>(GetChild("inframe"));
|
|
m_pMouseOverShow[4] = dynamicCast<KUIControlStatic*>(GetChild("outframe"));
|
|
m_pMyPartyMark = dynamicCast<KUIControlStatic*>(GetChild("mark_attack_my_team_01")); // 내파티 마크
|
|
|
|
// 4. 컨트롤 들 위치 설정
|
|
|
|
KRect rcButton = m_pPartyButton[0][UP_BUTTON_STATE]->GetRect(); // 버튼
|
|
KRect rcNumber = m_pPartyNumStatic[0]->GetRect(); // 번호
|
|
KRect rcMark = m_pPartyMarkStatic[0]->GetRect(); // 마크
|
|
|
|
for(int i=0 ; i< H_NUM ; ++i)
|
|
{
|
|
for(int j=0 ; j<V_NUM ; j++)
|
|
{
|
|
int k = (i*V_NUM)+j;
|
|
m_pPartyButton[k][UP_BUTTON_STATE]->MovePos(rcButton.left + j*H_SIZE, rcButton.top + i*V_SIZE); // 업버튼
|
|
m_pPartyButton[k][DOWN_BTN_STATE]->MovePos(rcButton.left + j*H_SIZE, rcButton.top + i*V_SIZE); // 다운버튼
|
|
|
|
m_pPartyNumStatic[k]->MovePos(rcNumber.left + j*H_SIZE, rcNumber.top + i*V_SIZE); // 파티 번호
|
|
m_pPartyNumStatic[k]->SetCaption(CStringUtil::StringFormat("<font:font_01><size:9><hcenter><#FFFFFF><vcenter>%d", k+1).c_str()); // 파티번호는 바뀌지 않으므로 지금 넣는다.
|
|
m_pPartyMarkStatic[k]->MovePos(rcMark.left + j*H_SIZE, rcMark.top + i*V_SIZE); // 파티표시 마크
|
|
}
|
|
}
|
|
|
|
// 공대 초대 관련 컨트롤 disable
|
|
m_pInvitePartyButton->SetShow(false);
|
|
m_pInvitePartyStatic->SetShow(false);
|
|
|
|
m_pMyPartyStatic->SetShow(false);
|
|
m_pInvitePartyButton->SetShow(false);
|
|
m_pInvitePartyStatic->SetShow(false);
|
|
|
|
// 업버튼이 보이도록 처리
|
|
for(int i=0 ; i< ATTACK_UNIT::MAXPARTYCOUNT ; ++i)
|
|
{
|
|
m_pPartyButton[i][UP_BUTTON_STATE]->SetShow(true);
|
|
m_pPartyButton[i][DOWN_BTN_STATE]->SetShow(false);
|
|
}
|
|
|
|
// 툴팁
|
|
KUIControlStatic* pLeader = dynamicCast<KUIControlStatic*>(GetChild("mark_siegeleader_01"));
|
|
if(pLeader)
|
|
pLeader->SetTooltip(S(5130)); //"5130:공대장 마크"
|
|
|
|
KUIControlSimpleButton *pMax = dynamicCast<KUIControlSimpleButton*>(GetChild("button_transform_max"));
|
|
if(pMax)
|
|
pMax->SetTooltip(S(5129)); //"5129:기본 보기 버튼"
|
|
|
|
KUIControlButton *pInvite = dynamicCast<KUIControlButton*>(GetChild("button_invite_01"));
|
|
if(pInvite)
|
|
pInvite->SetTooltip(S(12014)); // "12014:공대 파티장 초대"
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetPartyButtonToggle(int nPartyNum, bool bCurButtonState )
|
|
{
|
|
if(nPartyNum == m_nMyPartyNum)
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false);
|
|
}
|
|
else if(bCurButtonState == BUTTON_STATE::UP_BUTTON_STATE) //버튼Up상태면 버튼Down상태로
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(true);
|
|
g_bButtonState[nPartyNum] = BUTTON_STATE::DOWN_BTN_STATE;
|
|
}
|
|
else //버튼Down상태면 버튼UP상태로
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(true);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false);
|
|
g_bButtonState[nPartyNum] = BUTTON_STATE::UP_BUTTON_STATE;
|
|
}
|
|
// 버튼이 외부메시지로 바뀌면 Select 상태로 변화 되는데 노멀상태로 강제 변환 시킨다..
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetButtonState(KUIControlButton::KBUTTON_NORMAL);
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetButtonState(KUIControlButton::KBUTTON_NORMAL);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::InitParty(int nPartyCount, int nMyPartNum)
|
|
{
|
|
// 현재 파티수 만큼 컨트롤 설정하고
|
|
for( int i=0 ; i<ATTACK_UNIT::MAXPARTYCOUNT ; ++i )
|
|
{
|
|
if(nMyPartNum == i) // 내파티
|
|
SetShowMyParty();
|
|
else if( i < nPartyCount ) // 남의 파티
|
|
SetShowParty(i,true);
|
|
else // 없는 파티
|
|
{
|
|
SetShowParty(i,false);
|
|
g_bButtonState[i] = UP_BUTTON_STATE;
|
|
}
|
|
}
|
|
// 공대장일 경우에는 공대 초대 버튼 추가 설정
|
|
if(m_bItsMeMaster)
|
|
{
|
|
if(nPartyCount == m_nMaxPartyNum)
|
|
SetShowInviteControls(nPartyCount,false);
|
|
else
|
|
SetShowInviteControls(nPartyCount,true);
|
|
}
|
|
else
|
|
SetShowInviteControls(nPartyCount,false);
|
|
// 컨트롤 리사이징
|
|
SetResizeFrame(nPartyCount);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetShowParty(int nPartyNum,bool bShow)
|
|
{
|
|
if(bShow)
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(!g_bButtonState[nPartyNum]); // Up 버튼
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(g_bButtonState[nPartyNum]); // Down 버튼
|
|
}
|
|
else
|
|
{
|
|
m_pPartyButton[nPartyNum][UP_BUTTON_STATE]->SetShow(false); // Up 버튼
|
|
m_pPartyButton[nPartyNum][DOWN_BTN_STATE]->SetShow(false); // Down 버튼
|
|
}
|
|
m_pPartyNumStatic[nPartyNum]->SetShow(bShow); // 공대 순번
|
|
m_pPartyMarkStatic[nPartyNum]->SetShow(bShow); // 공대 표시 마크
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetShowMyParty()
|
|
{
|
|
// 컨트롤들 보이기,안보이기 설정
|
|
m_pPartyButton[m_nMyPartyNum][UP_BUTTON_STATE]->SetShow(false); // Up 버튼
|
|
m_pPartyButton[m_nMyPartyNum][DOWN_BTN_STATE]->SetShow(false); // Down 버튼
|
|
m_pPartyNumStatic[m_nMyPartyNum]->SetShow(true); // 공대 순번
|
|
m_pPartyMarkStatic[m_nMyPartyNum]->SetShow(false); // 공대 표시 마크
|
|
m_pMyPartyMark->SetShow(true);
|
|
|
|
// 내파티 스태틱 컨트롤 위치 변경
|
|
m_pMyPartyStatic->SetShow(true);
|
|
KRect rc = m_pPartyButton[m_nMyPartyNum][UP_BUTTON_STATE]->GetRect();
|
|
m_pMyPartyStatic->MovePos(rc.left,rc.top);
|
|
|
|
rc = m_pPartyMarkStatic[m_nMyPartyNum]->GetRect();
|
|
m_pMyPartyMark->MovePos(rc.left,rc.top);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetShowInviteControls(int nPartyCount, bool bShow )
|
|
{
|
|
if(bShow)
|
|
{
|
|
m_pInvitePartyButton->SetShow(true);
|
|
m_pInvitePartyStatic->SetShow(true);
|
|
|
|
// 위치 설정
|
|
|
|
KRect rcRect = m_pPartyButton[nPartyCount][UP_BUTTON_STATE]->GetRect();
|
|
m_pInvitePartyButton->MovePos(rcRect.left,rcRect.top); // 버튼 위치 설정
|
|
|
|
rcRect = m_pPartyNumStatic[nPartyCount]->GetRect();
|
|
m_pInvitePartyStatic->MovePos(rcRect.left,rcRect.top); // "+" 스태틱 위치 설정
|
|
}
|
|
else
|
|
{
|
|
m_pInvitePartyButton->SetShow(false);
|
|
m_pInvitePartyStatic->SetShow(false);
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetResizeFrame(int nPartyCount)
|
|
{
|
|
// 2011. 10. 17 - marine
|
|
// 공대 숫자에 맞춰서 창의 크기를 조절하는데
|
|
// 처음에 공대 숫자가 Max라고 가정하고
|
|
// nPreCount 에서 현재 파티의 숫자를 뺀만큼을 bottom에서 빼서 창크기를 조절..
|
|
// 공대장일 경우에는 공대숫자를 하나 더 늘려서 계산(공대추가버튼)
|
|
|
|
//static int m_nPreCount = MAXPARTYCOUNT; // 리사이즈 하기전의 버튼의 갯수
|
|
int nCurrentCount; // 현재 창의 갯수
|
|
|
|
if(m_bIsFirstResize) // 처음 리사이즈 할때는 파티의 갯수를 증가
|
|
{
|
|
nCurrentCount = nPartyCount;
|
|
m_bIsFirstResize = false;
|
|
}
|
|
else
|
|
nCurrentCount = nPartyCount; // 리사이즈 할때의 버튼 갯수
|
|
|
|
if(m_bItsMeMaster && (nCurrentCount != m_nMaxPartyNum)) // 공대마스터일 경우 초대 버튼이 있으므로 하나 증가
|
|
++nCurrentCount;
|
|
|
|
//////////////// 2. 라인수 계산 ////////////////
|
|
int nPreLine = m_nPreCount/V_NUM; // 라인수 계산
|
|
if(m_nPreCount%V_NUM)
|
|
++nPreLine;
|
|
|
|
int nCurLine = nCurrentCount/V_NUM;
|
|
if(nCurrentCount%V_NUM)
|
|
++nCurLine;
|
|
|
|
int nFixCount = nPreLine - nCurLine; // 리사이즈 하기전,후의 차이
|
|
|
|
if(nFixCount == 0)
|
|
{
|
|
m_nPreCount = nCurrentCount;
|
|
return;
|
|
}
|
|
|
|
/////////////////// 3. 렉트 수정 ////////////////
|
|
KRect rcRect[3];
|
|
KUIControlStatic* pStatic1 = dynamicCast<KUIControlStatic*>(GetChild("outframe"));
|
|
KUIControlStatic* pStatic2 = dynamicCast<KUIControlStatic*>(GetChild("inframe"));
|
|
|
|
rcRect[0] = pStatic1->GetRect();
|
|
rcRect[1] = pStatic2->GetRect();
|
|
rcRect[2] = GetRect();
|
|
|
|
for( int i=0 ; i<3 ; ++i )
|
|
rcRect[i].bottom -= (nFixCount * V_SIZE);
|
|
|
|
pStatic1->Resize(rcRect[0]);
|
|
pStatic2->Resize(rcRect[1]);
|
|
Resize(rcRect[2]);
|
|
|
|
m_nPreCount = nCurrentCount;
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::AddParty()
|
|
{
|
|
if(m_nCurPartyCount == MAXPARTYCOUNT)
|
|
return;
|
|
|
|
SetShowParty(m_nCurPartyCount,true);
|
|
|
|
if( m_nCurPartyCount == MAXPARTYCOUNT-1 ) // 공격대가 Max가 되는 경우
|
|
SetShowInviteControls(m_nCurPartyCount,false);
|
|
else
|
|
{
|
|
SetShowInviteControls(m_nCurPartyCount+1,true);
|
|
SetResizeFrame(m_nCurPartyCount);
|
|
}
|
|
++m_nCurPartyCount;
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetMouseOver(bool bIsMouseOver)
|
|
{
|
|
if(bIsMouseOver)
|
|
{
|
|
for(int i=0 ; i<MOUSEOVER_CTRL ; ++i)
|
|
m_pMouseOverShow[i]->SetShow(m_bIsMouseOver);
|
|
}
|
|
else
|
|
{
|
|
for(int i=0 ; i<MOUSEOVER_CTRL ; ++i)
|
|
m_pMouseOverShow[i]->SetShow(m_bIsMouseOver);
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SaveButtonState()
|
|
{
|
|
for(int i=0 ; i< m_nCurPartyCount ; ++i)
|
|
g_bButtonState[i] = m_pPartyButton[i][DOWN_BTN_STATE]->IsShow();
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetButtonStateAll()
|
|
{
|
|
// 전체 버튼 설정
|
|
for(int i=0 ; i< m_nCurPartyCount ; ++i)
|
|
SetButtonState(i);
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetButtonState(int nNumber)
|
|
{
|
|
// 각 파티별로 버튼 상태 설정
|
|
if( nNumber == m_nMyPartyNum) // 내파티 일경우
|
|
{
|
|
SetShowMyParty();
|
|
}
|
|
else // 내파티가 아닐 경우
|
|
{
|
|
if(g_bButtonState[nNumber] == UP_BUTTON_STATE)
|
|
{
|
|
m_pPartyButton[nNumber][UP_BUTTON_STATE]->SetShow(true);
|
|
m_pPartyButton[nNumber][DOWN_BTN_STATE]->SetShow(false);
|
|
}
|
|
else
|
|
{
|
|
m_pPartyButton[nNumber][UP_BUTTON_STATE]->SetShow(false);
|
|
m_pPartyButton[nNumber][DOWN_BTN_STATE]->SetShow(true);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitMiniWnd::SetToolTip()
|
|
{
|
|
for(int i=0 ; i< m_nCurPartyCount ; ++i )
|
|
{
|
|
if( i == m_nMyPartyNum) // 내파티일경우
|
|
{
|
|
m_pMyPartyStatic->SetTooltip( m_strToolTip[i].c_str());
|
|
}
|
|
else // 다른파티일경우
|
|
{
|
|
m_pPartyButton[i][UP_BUTTON_STATE]->SetTooltip(m_strToolTip[i].c_str()); // 버튼 상태가 변하면 다시 설정해야 해서 둘다 하자..
|
|
m_pPartyButton[i][DOWN_BTN_STATE]->SetTooltip(m_strToolTip[i].c_str());
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
SUIDungeonUnitInvitation::~SUIDungeonUnitInvitation()
|
|
{
|
|
|
|
}
|
|
|
|
bool SUIDungeonUnitInvitation::InitControls( KPoint kPos )
|
|
{
|
|
KUIControlEdit * pEdit = dynamicCast< KUIControlEdit * >( GetChild( "box_edit_01" ) );
|
|
|
|
if( pEdit )
|
|
{
|
|
pEdit->SetLimitation( g_LimitText );
|
|
pEdit->SetLineChange( false );
|
|
pEdit->SetText("");
|
|
pEdit->SetCaption("");
|
|
pEdit->UseEmoticonFilter( false );
|
|
pEdit->SetFont( "font_02" );
|
|
}
|
|
m_EditName = pEdit;
|
|
|
|
return SUIWnd::InitControls( kPos );
|
|
}
|
|
|
|
bool SUIDungeonUnitInvitation::InitData( bool bReload /*= false*/ )
|
|
{
|
|
return SUIWnd::InitData( bReload );
|
|
}
|
|
|
|
void SUIDungeonUnitInvitation::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
{
|
|
switch( nMessage )
|
|
{
|
|
case KUI_MESSAGE::KBUTTON_CLICK:
|
|
{
|
|
if( ::_stricmp( lpszControlID, "button_ok" ) == 0 )
|
|
{
|
|
// 초대 메시지 보내자....
|
|
// 공대결성 메세지 전송.
|
|
SMSG_CHATTING_REQUEST msg;
|
|
msg.type = CHAT_TYPE::CHAT_NORMAL;
|
|
msg.strText = "/rp_ginvite ";
|
|
msg.strText.append( m_EditName->GetText() );
|
|
m_pGameManager->ProcMsgAtStatic( &msg );
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_cancel" ) == 0 ) // 닫기 버튼
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_INVITATION , false) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MEMBER_LIST, false ) );
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_close_trim_01" ) == 0 ) // 닫기 버튼(x)
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_DUNGEON_UNIT_INVITATION , false) );
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MEMBER_LIST, false ) );
|
|
}
|
|
else if( ::_stricmp( lpszControlID, "button_close_trim_02" ) == 0 ) // 길드원 리스트
|
|
{
|
|
m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_GUILD_MEMBER_LIST , true) );
|
|
}
|
|
break;
|
|
|
|
}
|
|
break;
|
|
case KUI_MESSAGE::KGENWND_MOVE:
|
|
{
|
|
LimitMoveWnd();
|
|
}
|
|
}
|
|
|
|
SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
}
|
|
|
|
DWORD SUIDungeonUnitInvitation::OnMouseMessage(DWORD dwMessage, int x, int y)
|
|
{
|
|
switch( dwMessage )
|
|
{
|
|
case KLBUTTON_DOWN :
|
|
{
|
|
if( m_EditName->GetRect().IsInRect( x, y ) )
|
|
m_EditName->SetFocus( true );
|
|
|
|
}break;
|
|
}
|
|
|
|
return SUIWnd::OnMouseMessage(dwMessage, x, y);
|
|
}
|
|
|
|
void SUIDungeonUnitInvitation::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
{
|
|
if( bOpen )
|
|
{
|
|
m_EditName->SetText("");
|
|
}
|
|
}
|
|
|
|
void SUIDungeonUnitInvitation::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
{
|
|
switch( pMsg->nType )
|
|
{
|
|
case IMSG_UI_SEND_DATA:
|
|
{
|
|
// 2011. 10. 26 - marine 길드창에서 선택된 길드원 이름을 얻는다.
|
|
SIMSG_UI_SEND_DATA *pData = (SIMSG_UI_SEND_DATA *)pMsg;
|
|
m_EditName->SetText("");
|
|
m_EditName->SetText(pData->m_strString.c_str());
|
|
}
|
|
}
|
|
} |