// DMSmcSrmModDlg.h : ヘッダー ファイル
//

#if !defined(AFX_DMSMCSRMMODDLG_H__5B70C424_FD46_4B0E_B21A_4A2BDFC39266__INCLUDED_)
#define AFX_DMSMCSRMMODDLG_H__5B70C424_FD46_4B0E_B21A_4A2BDFC39266__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "DMSkillCombo.h"
#include "DMAtlasStatic.h"

/////////////////////////////////////////////////////////////////////////////
// CDMSmcSrmModDlg ダイアログ

class CDMSmcSrmModDlg : public CDialog
{
	// 
	struct PlayerState {
		// 
		UINT nCurHP, nMaxHP, nCurSta, nMaxSta, nCurMana, nMaxMana, nFood, nWater;
		// 
		UINT nCurStr, nMaxStr, nCurDex, nMaxDex, nCurWiz, nMaxWiz, nCurVit, nMaxVit, nCurAM, nMaxAM, nCurAF, nMaxAF;
		// 
		UINT nSk1, nSk2, nSk3, nSk4;

		// 
		PlayerState()
		{
			nCurHP = nMaxHP = nCurSta = nMaxSta = nCurMana = nMaxMana = nFood = nWater = 0;
			nCurStr = nMaxStr = nCurDex = nMaxDex = nCurWiz = nMaxWiz = nCurVit = nMaxVit = nCurAM = nMaxAM = nCurAF = nMaxAF = 0;
			nSk1 = nSk2 = nSk3 = nSk4 = 0;
		}
	};
	// 
	CFont m_font;

	// 
	PlayerState m_p4s[4];
	// 
	UINT m_nDir;
	// 
	UINT m_nPlayers;
	// 
	UINT m_nLevel;
	// 
	UINT m_iOffset;

	// 
	BOOL LoadFrom(LPCTSTR pszFileIn);
	// 
	BOOL SaveTo(LPCTSTR pszFileIn);
	// 
	BOOL Serialize(LPCTSTR pszFileIn, BOOL fLoad);
	// 
	void revertPlayer(UINT i, BOOL fRevert);
	// 
	bool chkSaveData(CFile &file);
	// 
	void serializeByteAt(CFile &file, UINT nPos, UINT &x, BOOL fLoad);
	// 
	void serializeWordAt(CFile &file, UINT nPos, UINT &x, BOOL fLoad);

public:
	// 
	CDMSmcSrmModDlg(CWnd* pParent = NULL);	// 標準のコンストラクタ
	// 
	void OnSelChangeMap();

// ダイアログ データ
	//{{AFX_DATA(CDMSmcSrmModDlg)
	enum { IDD = IDD_DMSMCSRMMOD_DIALOG };
	CComboBox	m_wndLv;
	CDMAtlasStatic	m_wndAtlas;
	CComboBox	m_wndDir;
	CEdit	m_wndSRMFile;
	CDMSkillCombo	m_wndSk4;
	CDMSkillCombo	m_wndSk3;
	CDMSkillCombo	m_wndSk2;
	CDMSkillCombo	m_wndSk1;
	CTabCtrl	m_wndPlayer;
	UINT	m_nCurAntiFire;
	UINT	m_nMaxAntiFire;
	UINT	m_nCurAntiMajic;
	UINT	m_nMaxAntiMajic;
	UINT	m_nCurDex;
	UINT	m_nMaxDex;
	UINT	m_nCurHP;
	UINT	m_nMaxHP;
	UINT	m_nCurMana;
	UINT	m_nMaxMana;
	CString	m_strFile;
	UINT	m_nCurSta;
	UINT	m_nMaxSta;
	UINT	m_nCurStr;
	UINT	m_nMaxStr;
	UINT	m_nCurVit;
	UINT	m_nMaxVit;
	UINT	m_nCurFood;
	UINT	m_nCurWater;
	UINT	m_nCurWiz;
	UINT	m_nMaxWiz;
	UINT	m_iX;
	UINT	m_iY;
	CString	m_strSk1;
	CString	m_strSk2;
	CString	m_strSk3;
	CString	m_strSk4;
	CString	m_strPlayers;
	CString	m_strLv;
	//}}AFX_DATA

	// ClassWizard は仮想関数のオーバーライドを生成します。
	//{{AFX_VIRTUAL(CDMSmcSrmModDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV のサポート
	//}}AFX_VIRTUAL

// インプリメンテーション
protected:
	HICON m_hIcon;

	// 生成されたメッセージ マップ関数
	//{{AFX_MSG(CDMSmcSrmModDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonRef();
	afx_msg void OnSelChangingTabPlayer(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelChangeTabPlayer(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnButtonSrmRead();
	afx_msg void OnButtonSrmWrite();
	afx_msg void OnEditChangeComboLevel();
	afx_msg void OnSelChangeComboLevel();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ は前行の直前に追加の宣言を挿入します。

#endif // !defined(AFX_DMSMCSRMMODDLG_H__5B70C424_FD46_4B0E_B21A_4A2BDFC39266__INCLUDED_)
