1 // CreateWingDlg.cpp : implementation file
6 #include "createwingdlg.h"
14 static char THIS_FILE[] = __FILE__;
17 /////////////////////////////////////////////////////////////////////////////
18 // create_wing_dlg dialog
20 create_wing_dlg::create_wing_dlg(CWnd* pParent /*=NULL*/)
21 : CDialog(create_wing_dlg::IDD, pParent)
23 //{{AFX_DATA_INIT(create_wing_dlg)
28 void create_wing_dlg::DoDataExchange(CDataExchange* pDX)
30 CDialog::DoDataExchange(pDX);
31 //{{AFX_DATA_MAP(create_wing_dlg)
32 DDX_Text(pDX, IDC_NAME, m_name);
35 DDV_MaxChars(pDX, m_name, NAME_LENGTH - 4);
38 BEGIN_MESSAGE_MAP(create_wing_dlg, CDialog)
39 //{{AFX_MSG_MAP(create_wing_dlg)
40 // NOTE: the ClassWizard will add message map macros here
44 /////////////////////////////////////////////////////////////////////////////
45 // create_wing_dlg message handlers
47 void create_wing_dlg::OnOK()
55 m_name = drop_white_space((char *)(LPCSTR) m_name);
56 if (m_name.IsEmpty()) {
57 MessageBox("You must give a name before you can continue.");
61 if (!strnicmp(m_name, "player ", 7)) {
62 MessageBox("Wing names can't start with the word 'player'");
66 for (i=0; i<MAX_WINGS; i++)
67 if (!stricmp(Wings[i].name, m_name) && Wings[i].wave_count) {
68 sprintf(msg, "The name \"%s\" is already being used by another wing", m_name);
73 ptr = GET_FIRST(&obj_used_list);
74 while (ptr != END_OF_LIST(&obj_used_list)) {
75 if (ptr->type == OBJ_SHIP) {
77 if (!strnicmp(m_name, Ships[i].ship_name, strlen(m_name))) {
80 namep = Ships[i].ship_name + strlen(m_name);
92 MessageBox("This wing name is already being used by a ship");
101 for (i=0; i<MAX_WAYPOINT_LISTS; i++)
102 if (Waypoint_lists[i].count && !stricmp(Waypoint_lists[i].name, m_name)) {
103 MessageBox("This wing name is already being used by a waypoint path");