2001-03-27 19:51:56 +02:00
|
|
|
// GUILayerActor.cpp : implementation file
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "mapedit.h"
|
|
|
|
#include "GUILayerActor.h"
|
|
|
|
|
2001-03-29 19:59:01 +02:00
|
|
|
#include "MapEditDoc.h"
|
|
|
|
#include "MainFrm.h"
|
|
|
|
|
2001-03-27 19:51:56 +02:00
|
|
|
#ifdef _DEBUG
|
|
|
|
#define new DEBUG_NEW
|
|
|
|
#undef THIS_FILE
|
|
|
|
static char THIS_FILE[] = __FILE__;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CGUILayerActor dialog
|
|
|
|
|
|
|
|
|
|
|
|
CGUILayerActor::CGUILayerActor(CWnd* pParent /*=NULL*/)
|
|
|
|
: CDialog(CGUILayerActor::IDD, pParent)
|
|
|
|
{
|
2001-03-29 19:59:01 +02:00
|
|
|
DisableCallback(true);
|
2001-03-27 19:51:56 +02:00
|
|
|
//{{AFX_DATA_INIT(CGUILayerActor)
|
|
|
|
//}}AFX_DATA_INIT
|
2001-03-29 19:59:01 +02:00
|
|
|
DisableCallback(false);
|
2001-03-27 19:51:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CGUILayerActor::DoDataExchange(CDataExchange* pDX)
|
|
|
|
{
|
|
|
|
CDialog::DoDataExchange(pDX);
|
|
|
|
//{{AFX_DATA_MAP(CGUILayerActor)
|
2001-03-29 19:59:01 +02:00
|
|
|
DDX_Control(pDX, IDC_ACTOR_COLLISION, m_Collision);
|
|
|
|
DDX_Control(pDX, IDC_ACTOR_PLAYER, m_Player);
|
|
|
|
DDX_Control(pDX, IDC_ACTOR_TURNRATE, m_TurnRate);
|
|
|
|
DDX_Control(pDX, IDC_ACTOR_SPEED, m_Speed);
|
|
|
|
DDX_Control(pDX, IDC_ACTOR_ATTACK, m_Attack);
|
|
|
|
DDX_Control(pDX, IDC_ACTOR_HEALTH, m_Health);
|
2001-03-27 19:51:56 +02:00
|
|
|
//}}AFX_DATA_MAP
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CGUILayerActor, CDialog)
|
|
|
|
//{{AFX_MSG_MAP(CGUILayerActor)
|
2001-03-29 19:59:01 +02:00
|
|
|
ON_EN_CHANGE(IDC_ACTOR_HEALTH, OnChangeParam)
|
|
|
|
ON_EN_CHANGE(IDC_ACTOR_ATTACK, OnChangeParam)
|
|
|
|
ON_BN_CLICKED(IDC_ACTOR_COLLISION, OnChangeParam)
|
|
|
|
ON_EN_CHANGE(IDC_ACTOR_SPEED, OnChangeParam)
|
|
|
|
ON_EN_CHANGE(IDC_ACTOR_TURNRATE, OnChangeParam)
|
2001-03-27 19:51:56 +02:00
|
|
|
//}}AFX_MSG_MAP
|
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
2001-03-29 19:59:01 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
void CGUILayerActor::SetVal(CEdit &Dlg,int Val)
|
|
|
|
{
|
|
|
|
CString Str;
|
|
|
|
if (!Dlg) return;
|
|
|
|
DisableCallback(true);
|
|
|
|
Str.Format("%i",Val);
|
|
|
|
Dlg.SetWindowText(Str);
|
|
|
|
DisableCallback(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
int CGUILayerActor::GetVal(CEdit &Dlg)
|
|
|
|
{
|
|
|
|
CString Str;
|
|
|
|
int Val=0;
|
|
|
|
if (!Dlg) return(0);
|
|
|
|
Dlg.GetWindowText(Str);
|
|
|
|
if (Str.GetLength())
|
|
|
|
Val=atoi(Str);
|
|
|
|
return(Val);
|
|
|
|
}
|
|
|
|
|
2001-03-27 19:51:56 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CGUILayerActor message handlers
|
2001-03-29 19:59:01 +02:00
|
|
|
|
|
|
|
void CGUILayerActor::OnChangeParam() {if (!CallbackFlag) theApp.GetCurrent()->GUIChanged();}
|