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>
155 lines
3.8 KiB
C++
155 lines
3.8 KiB
C++
// CharSheetView.cpp : 구현 파일입니다.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "AdminToolClient.h"
|
|
#include "AdminStoreDlgBar.h"
|
|
#include "CharSheetView.h"
|
|
#include "PacketManager.h"
|
|
#include "GlobalFunctions.h"
|
|
|
|
#include <UserInfoDoc.h>
|
|
#include <Character/ModifyCharacter.h>
|
|
|
|
// CCharSheetView
|
|
|
|
IMPLEMENT_DYNCREATE(CCharSheetView, CFormView)
|
|
|
|
CCharSheetView::CCharSheetView()
|
|
: CFormView(CCharSheetView::IDD)
|
|
, m_strSheetInfo(_T("[Not select character]"))
|
|
, m_lpModifyCharInfo(NULL)
|
|
, m_dwDocKey(0)
|
|
{
|
|
m_strSheetInfo = GetLocalString("MSG_0131");
|
|
}
|
|
|
|
CCharSheetView::~CCharSheetView()
|
|
{
|
|
if( NULL != m_pCharPropertySheet )
|
|
{
|
|
delete m_pCharPropertySheet;
|
|
}
|
|
}
|
|
|
|
void CCharSheetView::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CFormView::DoDataExchange(pDX);
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(CCharSheetView, CFormView)
|
|
ON_WM_CTLCOLOR()
|
|
ON_BN_CLICKED(IDC_CHARUPDATE_BTN, OnBnClickedCharupdateBtn)
|
|
ON_BN_CLICKED(IDC_OVERLAPITEMLIST_BTN, OnBnClickedOverlapitemlistBtn)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
// CCharSheetView 진단입니다.
|
|
|
|
#ifdef _DEBUG
|
|
void CCharSheetView::AssertValid() const
|
|
{
|
|
CFormView::AssertValid();
|
|
}
|
|
|
|
void CCharSheetView::Dump(CDumpContext& dc) const
|
|
{
|
|
CFormView::Dump(dc);
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
|
|
// CCharSheetView 메시지 처리기입니다.
|
|
|
|
void CCharSheetView::OnInitialUpdate()
|
|
{
|
|
CFormView::OnInitialUpdate();
|
|
|
|
CWnd* pwndPropSheetHolder = GetDlgItem(IDC_PLACEHOLDER); // 프로퍼티 시트의 홀더로 픽쳐 컨트롤 사용
|
|
|
|
m_pCharPropertySheet = new CCharPropertySheet(_T("Character Property Sheet"), pwndPropSheetHolder);
|
|
|
|
if(!m_pCharPropertySheet->Create(pwndPropSheetHolder, WS_CHILD | WS_VISIBLE, 0))
|
|
{
|
|
delete m_pCharPropertySheet;
|
|
m_pCharPropertySheet = NULL;
|
|
return;
|
|
}
|
|
|
|
// 픽쳐 컨트롤 크기에 맞게 프로퍼티 시트 사이즈 설정
|
|
CRect rectPropSheet;
|
|
pwndPropSheetHolder->GetWindowRect(rectPropSheet);
|
|
m_pCharPropertySheet->SetWindowPos(NULL, 0, 0,
|
|
rectPropSheet.Width(), rectPropSheet.Height(), SWP_NOZORDER | SWP_NOACTIVATE);
|
|
|
|
SetUIString(this->m_hWnd, IDC_CHARUPDATE_BTN, "IDC_CHARUPDATE_BTN");
|
|
SetUIString(this->m_hWnd, IDC_OVERLAPITEMLIST_BTN, "IDC_OVERLAPITEMLIST_BTN");
|
|
}
|
|
|
|
HBRUSH CCharSheetView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
|
|
{
|
|
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
|
|
|
|
pDC->SetTextColor(RGB(0,0,255));
|
|
|
|
return hbr;
|
|
}
|
|
|
|
bool CCharSheetView::SetCharSheetInfo(unsigned int dwDocKey, CModifyCharacter* lpCharacter)
|
|
{
|
|
GetDlgItem(IDC_OVERLAPITEMLIST_BTN)->EnableWindow(false);
|
|
|
|
if(0 != dwDocKey && NULL != lpCharacter)
|
|
{
|
|
m_lpModifyCharInfo = lpCharacter;
|
|
m_dwDocKey = dwDocKey;
|
|
|
|
// 중복 아이템 검사에 필요한 변수 초기화
|
|
m_lpModifyCharInfo->m_ModifyCharItemSerialInfo.clear();
|
|
m_lpModifyCharInfo->m_OverlapSerialInfo.clear();
|
|
m_lpModifyCharInfo->SetOwnCopyItemState(false);
|
|
|
|
m_pCharPropertySheet->SetAllPage(dwDocKey, lpCharacter); // 프로퍼티 시트내에서 모든 페이지 정보 표시
|
|
|
|
GetDlgItem(IDC_CHARUPDATE_BTN)->EnableWindow(true);
|
|
|
|
if(m_lpModifyCharInfo->IsOwnCopyItem())
|
|
{
|
|
GetDlgItem(IDC_OVERLAPITEMLIST_BTN)->EnableWindow(true);
|
|
Report(GetLocalString("MSG_0132"), NOTIFY);
|
|
}
|
|
|
|
UpdateData(false);
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
void CCharSheetView::PostNcDestroy()
|
|
{
|
|
CFormView::PostNcDestroy();
|
|
}
|
|
|
|
void CCharSheetView::OnBnClickedCharupdateBtn()
|
|
{
|
|
CPacketMgr::GetInstance()->SendSetCharacter(
|
|
m_lpModifyCharInfo->GetServerGroup(), m_lpModifyCharInfo->GetCID(),
|
|
m_lpModifyCharInfo->GetUID(), m_dwDocKey, m_lpModifyCharInfo->GetOldServerGroupID());
|
|
}
|
|
|
|
void CCharSheetView::OnBnClickedOverlapitemlistBtn()
|
|
{
|
|
CModifyCharacter::OverlapSerialInfo::iterator itr = m_lpModifyCharInfo->m_OverlapSerialInfo.begin();
|
|
CModifyCharacter::OverlapSerialInfo::iterator end = m_lpModifyCharInfo->m_OverlapSerialInfo.end();
|
|
|
|
CString strFormat;
|
|
Report(_T("[Copy Item Serial List]"), NOTIFY);
|
|
for(;itr != end; ++itr)
|
|
{
|
|
strFormat.Format(_T("0x%016I64x"), (*itr));
|
|
Report(strFormat, NOTIFY);
|
|
}
|
|
} |