EDITFILE.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:2k
源码类别:
游戏
开发平台:
Visual C++
- // EditFile.cpp : implementation file
- //
- #include "stdafx.h"
- #include "dudes.h"
- #include "EditFile.h"
- #include "3dwrap.h"
- /////////////////////////////////////////////////////////////////////////////
- // CEditFile dialog
- CEditFile::CEditFile(CWnd* pParent /*=NULL*/)
- : CDialog(CEditFile::IDD, pParent)
- {
- m_per = *(Game->Hero());
- //{{AFX_DATA_INIT(CEditFile)
- //}}AFX_DATA_INIT
- }
- void CEditFile::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CEditFile)
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CEditFile, CDialog)
- //{{AFX_MSG_MAP(CEditFile)
- ON_BN_CLICKED(IDC_FEMALE, OnFemale)
- ON_BN_CLICKED(IDC_MALE, OnMale)
- ON_BN_CLICKED(IDC_SKINCOLOR, OnSkincolor)
- ON_BN_CLICKED(IDC_BUTTONFACE, OnButtonface)
- ON_BN_CLICKED(IDC_BUTTONHIA, OnButtonhia)
- ON_BN_CLICKED(IDC_BUTTONLAUGH, OnButtonlaugh)
- ON_BN_CLICKED(IDC_BUTTONUGH, OnButtonugh)
- ON_BN_CLICKED(IDC_HAIRCOLOR, OnHaircolor)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CEditFile message handlers
- void CEditFile::OnFemale()
- {
- m_per.setgender(FEMALE);
- }
- void CEditFile::OnMale()
- {
- m_per.setgender(MALE);
- }
- void CEditFile::GetFile(CString& file, CString& setto)
- {
- CFileDialog dialog(TRUE, NULL, file,
- OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
- NULL, m_pParentWnd);
- dialog.m_ofn.Flags |= OFN_NOCHANGEDIR;
- if (dialog.DoModal() == IDOK)
- setto = dialog.GetPathName();
- }
- void CEditFile::OnSkincolor()
- {
- CColorDialog dialog(m_per.skincolor(), 0, m_pParentWnd);
- if (dialog.DoModal() == IDOK)
- m_per.setskincolor(dialog.GetColor());
- }
- void CEditFile::OnButtonface()
- {
- CString m_face;
- GetFile((CString)"dudes\*.bmp", m_face);
- m_per.setface(m_face);
- }
- void CEditFile::OnButtonhia()
- {
- CString m_hia;
- GetFile((CString)"dudes\*.wav", m_hia);
- m_per.sethia(m_hia);
- }
- void CEditFile::OnButtonlaugh()
- {
- CString m_laugh;
- GetFile((CString)"dudes\*.wav", m_laugh);
- m_per.setlaugh(m_laugh);
- }
- void CEditFile::OnButtonugh()
- {
- CString m_ugh;
- GetFile((CString)"dudes\*.wav", m_ugh);
- m_per.setugh(m_ugh);
- }
- void CEditFile::OnHaircolor()
- {
- CColorDialog dialog(m_per.haircolor(), 0, m_pParentWnd);
- if (dialog.DoModal() == IDOK)
- m_per.sethaircolor(dialog.GetColor());
- }