2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 // CreateWingDlg.cpp : implementation file
14 #include "createwingdlg.h"
22 static char THIS_FILE[] = __FILE__;
25 /////////////////////////////////////////////////////////////////////////////
26 // create_wing_dlg dialog
28 create_wing_dlg::create_wing_dlg(CWnd* pParent /*=NULL*/)
29 : CDialog(create_wing_dlg::IDD, pParent)
31 //{{AFX_DATA_INIT(create_wing_dlg)
36 void create_wing_dlg::DoDataExchange(CDataExchange* pDX)
38 CDialog::DoDataExchange(pDX);
39 //{{AFX_DATA_MAP(create_wing_dlg)
40 DDX_Text(pDX, IDC_NAME, m_name);
43 DDV_MaxChars(pDX, m_name, NAME_LENGTH - 4);
46 BEGIN_MESSAGE_MAP(create_wing_dlg, CDialog)
47 //{{AFX_MSG_MAP(create_wing_dlg)
48 // NOTE: the ClassWizard will add message map macros here
52 /////////////////////////////////////////////////////////////////////////////
53 // create_wing_dlg message handlers
55 void create_wing_dlg::OnOK()
63 m_name = drop_white_space((char *)(LPCSTR) m_name);
64 if (m_name.IsEmpty()) {
65 MessageBox("You must give a name before you can continue.");
69 if (!strnicmp(m_name, "player ", 7)) {
70 MessageBox("Wing names can't start with the word 'player'");
74 for (i=0; i<MAX_WINGS; i++)
75 if (!stricmp(Wings[i].name, m_name) && Wings[i].wave_count) {
76 sprintf(msg, "The name \"%s\" is already being used by another wing", m_name);
81 ptr = GET_FIRST(&obj_used_list);
82 while (ptr != END_OF_LIST(&obj_used_list)) {
83 if (ptr->type == OBJ_SHIP) {
85 if (!strnicmp(m_name, Ships[i].ship_name, strlen(m_name))) {
88 namep = Ships[i].ship_name + strlen(m_name);
100 MessageBox("This wing name is already being used by a ship");
109 for (i=0; i<MAX_WAYPOINT_LISTS; i++)
110 if (Waypoint_lists[i].count && !stricmp(Waypoint_lists[i].name, m_name)) {
111 MessageBox("This wing name is already being used by a waypoint path");