Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
180 lines
4.7 KiB
C++
180 lines
4.7 KiB
C++
// SettingPatchInfo.cpp : 구현 파일입니다.
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "PatchMaker.h"
|
|
#include "SettingPatchInfo.h"
|
|
#include "SingleInputDlg.h"
|
|
|
|
#include "UtilityFunc.h"
|
|
#include "PMSetting.h"
|
|
|
|
// CSettingPatchInfo 대화 상자입니다.
|
|
|
|
IMPLEMENT_DYNAMIC(CSettingPatchInfo, CDialog)
|
|
CSettingPatchInfo::CSettingPatchInfo(CWnd* pParent /*=NULL*/)
|
|
: CDialog(CSettingPatchInfo::IDD, pParent)
|
|
, m_dwPatchVersion(100)
|
|
, m_bSelectedNewFile(false)
|
|
, m_szSetupFileName(_T(""))
|
|
, m_szSetupName(_T(""))
|
|
{
|
|
}
|
|
|
|
CSettingPatchInfo::~CSettingPatchInfo()
|
|
{
|
|
}
|
|
|
|
void CSettingPatchInfo::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_CB_SEL_OPTION, m_cbSettingOptFile);
|
|
DDX_Text(pDX, IDC_ED_PATCHVER, m_dwPatchVersion);
|
|
DDV_MinMaxUInt(pDX, m_dwPatchVersion, 100, 10000);
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CSettingPatchInfo, CDialog)
|
|
ON_CBN_SELCHANGE(IDC_CB_SEL_OPTION, OnCbnSelchangeCbSelOption)
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
// CSettingPatchInfo 메시지 처리기입니다.
|
|
|
|
// 버전명, 선택한 셋업 파일 이름 등이 유효한가 여부 리턴
|
|
bool CSettingPatchInfo::CheckPatchInfo()
|
|
{
|
|
|
|
return true;
|
|
}
|
|
|
|
BOOL CSettingPatchInfo::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
// TODO: 여기에 추가 초기화 작업을 추가합니다.
|
|
|
|
m_cbSettingOptFile.InsertString(0, _T("< new >"));
|
|
m_cbSettingOptFile.SetCurSel(0);
|
|
|
|
CString szFilePathName;
|
|
PMUtil::GetCurrentFolderName(szFilePathName);
|
|
szFilePathName.AppendFormat(_T("*%s"), GetExtension());
|
|
|
|
// 실행 파일 위치에서, 설정 파일을 검색해서 화면에 뿌려준다.
|
|
CFileFind fileFind;
|
|
BOOL bWorking = fileFind.FindFile(szFilePathName);
|
|
for (int nIndex = 1; bWorking; ++nIndex)
|
|
{
|
|
bWorking = fileFind.FindNextFile();
|
|
m_cbSettingOptFile.InsertString(nIndex, fileFind.GetFileTitle());
|
|
}
|
|
fileFind.Close();
|
|
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
|
// 예외: OCX 속성 페이지는 FALSE를 반환해야 합니다.
|
|
}
|
|
|
|
void CSettingPatchInfo::OnOK()
|
|
{
|
|
// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
|
|
|
|
// 세팅된 데이터를 읽어옵니다.
|
|
UpdateData(TRUE);
|
|
|
|
int nSel = m_cbSettingOptFile.GetCurSel();
|
|
m_szSetupFileName.SetString("");
|
|
m_bSelectedNewFile = false;
|
|
|
|
if (0 == nSel)
|
|
{
|
|
// 파일 이름이, 가능한 파일 이름인지 확인한다.
|
|
CSingleInputDlg singleInput(
|
|
_T("새 패치 설정 파일 이름을 입력하세요"),
|
|
_T("패치 설정 파일 이름 : "));
|
|
|
|
CFile file;
|
|
|
|
TCHAR szTempPath[MAX_PATH];
|
|
GetTempPath(MAX_PATH - 1, szTempPath);
|
|
szTempPath[MAX_PATH - 1] = 0;
|
|
|
|
CString szFullPathName;
|
|
|
|
while(!m_bSelectedNewFile)
|
|
{
|
|
if (IDOK == singleInput.DoModal())
|
|
{
|
|
szFullPathName.Format("%s%s%s", szTempPath,
|
|
singleInput.GetSingleInput(), GetExtension());
|
|
|
|
if (file.Open(szFullPathName, CFile::modeCreate))
|
|
{
|
|
m_szSetupFileName.SetString(singleInput.GetSingleInput());
|
|
m_bSelectedNewFile = true;
|
|
|
|
file.Close();
|
|
DeleteFile(szFullPathName);
|
|
}
|
|
else
|
|
{
|
|
AfxMessageBox(_T("생성할 수 없는 파일 이름입니다.\n다시 입력해 주십시오"),
|
|
MB_OK | MB_ICONEXCLAMATION);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
m_szSetupFileName.SetString("");
|
|
m_bSelectedNewFile = true;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
m_cbSettingOptFile.GetLBText(nSel, m_szSetupFileName);
|
|
}
|
|
|
|
if (0 < m_szSetupFileName.GetLength())
|
|
{
|
|
// 파일 이름 저장
|
|
m_szSetupName.SetString(m_szSetupFileName.GetString());
|
|
m_szSetupFileName.Append(GetExtension());
|
|
|
|
// 버전 정보 저장
|
|
CString szKey;
|
|
CString szValue;
|
|
|
|
szKey.SetString(m_szSetupName);
|
|
szKey.Replace(_T("="), _T("_"));
|
|
|
|
szValue.Format(_T("%u"), m_dwPatchVersion);
|
|
|
|
CPMSetting& pmSetting = CPMDefaultSetting::GetInstance();
|
|
pmSetting.SetSettingData(szKey, szValue);
|
|
pmSetting.SaveSetting();
|
|
|
|
CDialog::OnOK();
|
|
}
|
|
}
|
|
|
|
void CSettingPatchInfo::OnCbnSelchangeCbSelOption()
|
|
{
|
|
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
|
|
|
CString szKey;
|
|
CString szValue;
|
|
|
|
int nCurSel = m_cbSettingOptFile.GetCurSel();
|
|
if (CB_ERR != nCurSel)
|
|
{
|
|
m_cbSettingOptFile.GetLBText(nCurSel, szKey);
|
|
szKey.Replace(_T("="), _T("_"));
|
|
|
|
if (CPMDefaultSetting::GetInstance().GetSettingData(szKey, szValue))
|
|
{
|
|
m_dwPatchVersion = atol(szValue);
|
|
UpdateData(FALSE);
|
|
}
|
|
}
|
|
}
|