[dad864]: CreatureLevels.cpp  Maximize  Restore  History

Download this file

88 lines (69 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// CreatureLevels.cpp : implementation file
//
#include "stdafx.h"
#include "chitem.h"
#include "CreatureLevels.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCreatureLevels dialog
CCreatureLevels::CCreatureLevels(CWnd* pParent /*=NULL*/)
: CDialog(CCreatureLevels::IDD, pParent)
{
//{{AFX_DATA_INIT(CCreatureLevels)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCreatureLevels::DoDataExchange(CDataExchange* pDX)
{
int i;
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCreatureLevels)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
DDX_Text(pDX, IDC_U1, the_creature.iwd2header.totlevel);
for(i=0;i<11;i++)
{
DDX_Text(pDX, IDC_U2+i, the_creature.iwd2header.levels[i]);
}
}
BEGIN_MESSAGE_MAP(CCreatureLevels, CDialog)
//{{AFX_MSG_MAP(CCreatureLevels)
ON_EN_KILLFOCUS(IDC_U1, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U2, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U3, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U4, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U5, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U6, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U7, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U8, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U9, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U10, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U11, OnDefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U12, OnDefaultKillfocus)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCreatureLevels message handlers
BOOL CCreatureLevels::OnInitDialog()
{
CDialog::OnInitDialog();
GetDlgItem(IDC_U1)->EnableWindow(0);
UpdateData(UD_DISPLAY);
return TRUE;
}
void CCreatureLevels::OnDefaultKillfocus()
{
int i, sum;
UpdateData(UD_RETRIEVE);
sum=0;
for(i=0;i<11;i++)
{
sum+=the_creature.iwd2header.levels[i];
}
the_creature.iwd2header.totlevel=(unsigned char) sum;
UpdateData(UD_DISPLAY);
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks