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>
142 lines
3.8 KiB
C++
142 lines
3.8 KiB
C++
// NewAreaMatrixDlg.cpp : 구현 파일입니다.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "AdminToolClient.h"
|
|
#include "NewAreaMatrixDlg.h"
|
|
#include "CharacterDoc.h"
|
|
#include "CharEXInfoPage.h"
|
|
#include "GlobalFunctions.h"
|
|
|
|
#include <Network/Packet/PacketStruct/ServerInfo.h>
|
|
|
|
|
|
// CNewAreaMatrixDlg 대화 상자입니다.
|
|
|
|
IMPLEMENT_DYNAMIC(CNewAreaMatrixDlg, CDialog)
|
|
CNewAreaMatrixDlg::CNewAreaMatrixDlg(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CNewAreaMatrixDlg::IDD, pParent)
|
|
{
|
|
m_pParent = pParent;
|
|
m_fPosX = 0.0;
|
|
m_fPosZ = 0.0;
|
|
}
|
|
|
|
CNewAreaMatrixDlg::~CNewAreaMatrixDlg()
|
|
{
|
|
}
|
|
|
|
void CNewAreaMatrixDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
|
|
DDX_Text(pDX, IDC_AREANAME, m_strAreaName);
|
|
DDX_Text(pDX, IDC_POSX, m_fPosX);
|
|
DDX_Text(pDX, IDC_POSZ, m_fPosZ);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CNewAreaMatrixDlg, CDialog)
|
|
ON_BN_CLICKED(IDC_NEWAREA_REG, OnBnClickedNewAreaReg)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
// CNewAreaMatrixDlg 메시지 처리기입니다.
|
|
|
|
BOOL CNewAreaMatrixDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
CComboBox* lpZoneCb = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_ZONE));
|
|
|
|
for(int nIndex = 0; nIndex < SERVER_ID::MAX_ZONE_NUM; ++nIndex)
|
|
{
|
|
lpZoneCb->InsertString(nIndex, GetZoneString(nIndex));
|
|
}
|
|
|
|
CCharEXInfoPage* lpExpInfo = static_cast<CCharEXInfoPage*>(m_pParent);
|
|
|
|
if(lpExpInfo->GetState() == CCharEXInfoPage::EDIT)
|
|
{
|
|
CString strPosX, strPosZ;
|
|
|
|
CListCtrl* lpCtrl = static_cast<CListCtrl*>(lpExpInfo->GetDlgItem(IDC_AREALIST));
|
|
|
|
if(NULL != lpCtrl)
|
|
{
|
|
int iItemCount = lpCtrl->GetNextItem(-1, LVIS_SELECTED);
|
|
int vecIdx = lpCtrl->GetItemCount() - (iItemCount + 1);
|
|
|
|
m_strAreaName = lpCtrl->GetItemText(iItemCount, 0);
|
|
strPosX = lpCtrl->GetItemText(iItemCount, 2);
|
|
strPosZ = lpCtrl->GetItemText(iItemCount, 3);
|
|
|
|
lpZoneCb->SetCurSel(CCharacterDoc::GetInstance().GetZoneList().ZoneInfo[vecIdx].m_Zone - 1);
|
|
|
|
m_fPosX = (float)_tstof(strPosX);
|
|
m_fPosZ = (float)_tstof(strPosZ);
|
|
|
|
UpdateData(false);
|
|
}
|
|
}
|
|
|
|
SetWindowText(GetLocalString("IDD_NEWAREAMATRIXDLG"));
|
|
|
|
SetUIString(this->m_hWnd, IDC_NEWAREA_01, "IDC_NEWAREA_01");
|
|
SetUIString(this->m_hWnd, IDC_NEWAREA_02, "IDC_NEWAREA_02");
|
|
SetUIString(this->m_hWnd, IDC_NEWAREA_03, "IDC_NEWAREA_03");
|
|
SetUIString(this->m_hWnd, IDC_NEWAREA_REG, "IDC_NEWAREA_REG");
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void CNewAreaMatrixDlg::OnBnClickedNewAreaReg()
|
|
{
|
|
UpdateData(true);
|
|
|
|
CCharacterDoc::ZoneList& ZoneList = CCharacterDoc::GetInstance().GetZoneList();
|
|
|
|
CCharacterDoc::Zone ZoneInfo;
|
|
|
|
if(30 < (ZoneList.ZoneInfo.size() + 1))
|
|
{
|
|
Report(GetLocalString("MSG_0109"), CAUTION);
|
|
}
|
|
|
|
if((m_fPosX < 0.0) || (m_fPosZ < 0.0) || (m_strAreaName.GetLength() == 0))
|
|
{
|
|
Report(GetLocalString("MSG_0110"), CAUTION);
|
|
return;
|
|
}
|
|
|
|
if(static_cast<CCharEXInfoPage*>(m_pParent)->GetState() == CCharEXInfoPage::INSERT)
|
|
{
|
|
ZoneInfo.m_fPosX = m_fPosX;
|
|
ZoneInfo.m_fPosZ = m_fPosZ;
|
|
ZoneInfo.m_Zone =
|
|
(unsigned char)(static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_ZONE))->GetCurSel() + 1);
|
|
|
|
_sntprintf(ZoneInfo.m_szName, ZoneInfo.MAX_NAME, _T("%s"), m_strAreaName);
|
|
|
|
ZoneList.ZoneInfo.push_back(ZoneInfo);
|
|
}
|
|
else if(static_cast<CCharEXInfoPage*>(m_pParent)->GetState() == CCharEXInfoPage::EDIT)
|
|
{
|
|
CCharEXInfoPage* lpExInfo = static_cast<CCharEXInfoPage*>(m_pParent);
|
|
CListCtrl* lpCtrl = static_cast<CListCtrl*>(lpExInfo->GetDlgItem(IDC_AREALIST));
|
|
|
|
int iItemCount = lpCtrl->GetNextItem(-1, LVIS_SELECTED);
|
|
int vecIdx = lpCtrl->GetItemCount() - (iItemCount + 1);
|
|
|
|
ZoneList.ZoneInfo[vecIdx].m_fPosX = m_fPosX;
|
|
ZoneList.ZoneInfo[vecIdx].m_fPosZ = m_fPosZ;
|
|
ZoneList.ZoneInfo[vecIdx].m_Zone =
|
|
(unsigned char)(static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_ZONE))->GetCurSel() + 1);
|
|
|
|
_sntprintf(ZoneList.ZoneInfo[vecIdx].m_szName, ZoneInfo.MAX_NAME, _T("%s"), m_strAreaName);
|
|
}
|
|
|
|
static_cast<CCharEXInfoPage*>(m_pParent)->RefreshZoneList();
|
|
|
|
EndDialog(true);
|
|
} |