[Sphere-axis-commits] CVS: Axis/S_Sphere52 Account.cpp,NONE,1.1 Account.h,NONE,1.1 addserver.cpp,NON
Brought to you by:
pesterle
Update of /cvsroot/sphere-axis/Axis/S_Sphere52 In directory sc8-pr-cvs1:/tmp/cvs-serv25651/S_Sphere52 Modified Files: AccountDlg.cpp DefEditDlg.cpp itemeditdlg.cpp itemeditdlg.h lootitemeditdlg.cpp MapScriptEditDlg.cpp NameEditDlg.cpp NotoTitleEditDlg.cpp NPC.h npceditdlg.cpp npceditdlg.h OreEditDlg.cpp PotionEdit.cpp PotionEdit.h Resource.h S_Sphere52.rc S_Sphere52.vcproj serverconfigdlg.cpp serverconfigdlg.h skilleditdlg.cpp SkillMenuEditDlg.cpp SkillMenuEditDlg.h SkillMenuGroup.cpp SkillTableEditDlg.cpp SkillTableEditDlg.h SpellEditDlg.cpp SpellEditDlg.h StatRateEditDlg.cpp StatRateEditDlg.h strings.h TemplateEditDlg.cpp TemplateEditDlg.h weighteditemdlg.cpp WOPEditDlg.cpp Added Files: Account.cpp Account.h addserver.cpp addserver.h foodtypeeditdlg.cpp foodtypeeditdlg.h TriggerEditDlg.cpp TriggerEditDlg.h Log Message: no message --- NEW FILE: Account.cpp --- #include "StdAfx.h" #include "account.h" CAccount::CAccount(void) { m_iPLevel = 1; m_wPrivs = 0; } CAccount::~CAccount(void) { } --- NEW FILE: Account.h --- #pragma once #include "scriptbase.h" class CAccount : public CScriptBase { public: CString m_csName; CString m_csPassword; WORD m_wPrivs; int m_iPLevel; CString m_csLang; CString m_csChat; CString m_csTime; CString m_csIP; CString m_csLastTime; CString m_csLastDate; CString m_csFirstIP; CString m_csFirstDate; CString m_csUID; CString m_csEMail; CString m_csFailures; CString m_csComment; CAccount(void); ~CAccount(void); }; --- NEW FILE: addserver.cpp --- /* $Id: addserver.cpp,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // AddServer.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "AddServer.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAddServer dialog CAddServer::CAddServer(CWnd* pParent /*=NULL*/) : CDialog(CAddServer::IDD, pParent) { //{{AFX_DATA_INIT(CAddServer) m_csServerName = _T(""); m_csServerIP = _T(""); m_csServerPort = _T(""); //}}AFX_DATA_INIT } void CAddServer::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAddServer) DDX_Text(pDX, IDC_NEWSERVERNAME, m_csServerName); DDX_Text(pDX, IDC_NEWSERVERIP, m_csServerIP); DDX_Text(pDX, IDC_NEWSERVERPORT, m_csServerPort); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_AS_STATIC1, m_sName); DDX_Control(pDX, IDC_AS_STATIC2, m_sIP); DDX_Control(pDX, IDC_AS_STATIC3, m_sPort); DDX_Control(pDX, IDC_NEWSERVERNAME, m_eName); DDX_Control(pDX, IDC_NEWSERVERIP, m_eIP); DDX_Control(pDX, IDC_NEWSERVERPORT, m_ePort); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAddServer, CDialog) //{{AFX_MSG_MAP(CAddServer) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CAddServer message handlers void CAddServer::OnOK() { UpdateData(true); CDialog::OnOK(); } BOOL CAddServer::OnInitDialog() { CDialog::OnInitDialog(); Localize(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CAddServer::Localize(void) { locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_AS_STATIC1, (CWnd*)&m_sName, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_AS_STATIC2, (CWnd*)&m_sIP, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_AS_STATIC3, (CWnd*)&m_sPort, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_NEWSERVERNAME, (CWnd*)&m_eName, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_NEWSERVERIP, (CWnd*)&m_eIP, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_NEWSERVERPORT, (CWnd*)&m_ePort, (CWnd*)this); } --- NEW FILE: addserver.h --- /* $Id: addserver.h,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_ADDSERVER_H__0C7A30E1_0AB1_11D3_B244_004F4905E937__INCLUDED_) #define AFX_ADDSERVER_H__0C7A30E1_0AB1_11D3_B244_004F4905E937__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // AddServer.h : header file // ///////////////////////////////////////////////////////////////////////////// // CAddServer dialog class CAddServer : public CDialog { // Construction public: CAddServer(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CAddServer) enum { IDD = IDD_ADDSERVER_DLG }; CString m_csServerName; CString m_csServerIP; CString m_csServerPort; CButton m_bOK; CButton m_bCancel; CStatic m_sName; CStatic m_sIP; CStatic m_sPort; CEdit m_eName; CEdit m_eIP; CEdit m_ePort; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAddServer) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CAddServer) virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); virtual BOOL OnInitDialog(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_ADDSERVER_H__0C7A30E1_0AB1_11D3_B244_004F4905E937__INCLUDED_) --- NEW FILE: foodtypeeditdlg.cpp --- /* $Id: foodtypeeditdlg.cpp,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // FoodTypeEditDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "FoodTypeEditDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CFoodTypeEditDlg dialog CFoodTypeEditDlg::CFoodTypeEditDlg(CWnd* pParent /*=NULL*/) : CDialog(CFoodTypeEditDlg::IDD, pParent) { //{{AFX_DATA_INIT(CFoodTypeEditDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CFoodTypeEditDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CFoodTypeEditDlg) DDX_Control(pDX, IDC_FOODTYPE_NAME, m_ceFoodTypeName); DDX_Control(pDX, IDC_FOODTYPE_BITES, m_ceFoodTypeBites); DDX_Control(pDX, IDC_FOODTYPE_AMOUNT, m_ceFoodTypeAmount); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_FTE_STATIC1, m_sFoodyType); DDX_Control(pDX, IDC_FTE_STATIC2, m_sAmount); DDX_Control(pDX, IDC_FTE_STATIC3, m_sPerBite); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CFoodTypeEditDlg, CDialog) //{{AFX_MSG_MAP(CFoodTypeEditDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CFoodTypeEditDlg message handlers void CFoodTypeEditDlg::OnOK() { CWaitCursor hourglass; this->m_ceFoodTypeAmount.GetWindowText(m_csAmount); this->m_ceFoodTypeBites.GetWindowText(m_csBites); CDialog::OnOK(); } BOOL CFoodTypeEditDlg::OnInitDialog() { CDialog::OnInitDialog(); m_csAmount.TrimLeft(); m_csAmount.TrimRight(); m_csBites.TrimLeft(); m_csBites.TrimRight(); this->m_ceFoodTypeName.SetWindowText(m_csName); this->m_ceFoodTypeAmount.SetWindowText(m_csAmount); this->m_ceFoodTypeBites.SetWindowText(m_csBites); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CFoodTypeEditDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FOODTYPE_NAME, (CWnd*)&m_ceFoodTypeName, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FOODTYPE_BITES, (CWnd*)&m_ceFoodTypeBites, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FOODTYPE_AMOUNT, (CWnd*)&m_ceFoodTypeAmount, (CWnd*)this); locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FTE_STATIC1, (CWnd*)&m_sFoodyType, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FTE_STATIC2, (CWnd*)&m_sAmount, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_FTE_STATIC3, (CWnd*)&m_sPerBite, (CWnd*)this); } --- NEW FILE: foodtypeeditdlg.h --- /* $Id: foodtypeeditdlg.h,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_FOODTYPEEDITDLG_H__D641A8B4_E95A_11D2_A61F_004F4905E937__INCLUDED_) #define AFX_FOODTYPEEDITDLG_H__D641A8B4_E95A_11D2_A61F_004F4905E937__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // FoodTypeEditDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CFoodTypeEditDlg dialog class CFoodTypeEditDlg : public CDialog { // Construction public: CString m_csBites; CString m_csAmount; CString m_csName; CFoodTypeEditDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CFoodTypeEditDlg) enum { IDD = IDD_FOODTYPE_EDIT_DLG }; CEdit m_ceFoodTypeName; CEdit m_ceFoodTypeBites; CEdit m_ceFoodTypeAmount; CButton m_bOK; CButton m_bCancel; CStatic m_sFoodyType; CStatic m_sAmount; CStatic m_sPerBite; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CFoodTypeEditDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CFoodTypeEditDlg) virtual void OnOK(); virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_FOODTYPEEDITDLG_H__D641A8B4_E95A_11D2_A61F_004F4905E937__INCLUDED_) --- NEW FILE: TriggerEditDlg.cpp --- /* $Id: TriggerEditDlg.cpp,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ // TriggerEditDlg.cpp : implementation file // #include "stdafx.h" #include "Scripts.h" #include "TriggerEditDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CTriggerEditDlg dialog CTriggerEditDlg::CTriggerEditDlg(CWnd* pParent /*=NULL*/) : CDialog(CTriggerEditDlg::IDD, pParent) { //{{AFX_DATA_INIT(CTriggerEditDlg) //}}AFX_DATA_INIT m_bSingleMode = true; m_iSel = -1; m_dwNextRegion = 65000; m_dwNextTrig = 1400; } void CTriggerEditDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTriggerEditDlg) DDX_Control(pDX, IDC_NEWREGIONTRIG, m_cbNewRegionTrig); DDX_Control(pDX, IDC_NEWTRIGGER, m_cbNewTrigger); DDX_Control(pDX, IDC_OLDCLIP, m_ceOldClip); DDX_Control(pDX, IDC_QUICKCLIP, m_ceQuickClip); DDX_Control(pDX, IDC_TOPERATORS, m_ccbOperators); DDX_Control(pDX, IDC_TRIGGEREDITBOX, m_ceTrigEdit); DDX_Control(pDX, IDC_TVERBS, m_ccbVerbs); DDX_Control(pDX, IDC_TEVALUATORS, m_ccbEvaluators); DDX_Control(pDX, IDC_TREFERENCES, m_ccbReferences); DDX_Control(pDX, IDC_TCONDITIONS, m_ccbConditions); DDX_Control(pDX, IDC_TATTRIBUTES, m_ccbAttributes); DDX_Control(pDX, IDC_TRIGGER_EVENT, m_ccbEvent); DDX_Control(pDX, IDC_TRIG_ID, m_ccbTriggerID); DDX_Control(pDX, IDOK, m_bOK); DDX_Control(pDX, IDCANCEL, m_bCancel); DDX_Control(pDX, IDC_INSRTEVNT, m_bInsertEvent); DDX_Control(pDX, IDC_INSRTCOND, m_bInsertCondition); DDX_Control(pDX, IDC_INSRTATTR, m_bInsertAttr); DDX_Control(pDX, IDC_INSRTREF, m_bInsertRef); DDX_Control(pDX, IDC_INSRTVERB, m_bInsertVerb); DDX_Control(pDX, IDC_INSRTEVAL, m_bInsertEval); DDX_Control(pDX, IDC_INSRTOP, m_bInsertOperator); DDX_Control(pDX, IDC_TRIGEDIT_STATIC1, m_sStatic1); DDX_Control(pDX, IDC_TRIGEDIT_STATIC2, m_sStatic2); DDX_Control(pDX, IDC_TRIGEDIT_STATIC3, m_sStatic3); DDX_Control(pDX, IDC_TRIGEDIT_STATIC4, m_sStatic4); DDX_Control(pDX, IDC_TRIGEDIT_STATIC5, m_sStatic5); DDX_Control(pDX, IDC_TRIGEDIT_STATIC6, m_sStatic6); DDX_Control(pDX, IDC_TRIGEDIT_STATIC7, m_sStatic7); DDX_Control(pDX, IDC_TRIGEDIT_STATIC8, m_sStatic8); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CTriggerEditDlg, CDialog) //{{AFX_MSG_MAP(CTriggerEditDlg) ON_BN_CLICKED(IDC_NEWTRIGGER, OnNewtrigger) ON_BN_CLICKED(IDOK, OnOk) ON_BN_CLICKED(IDC_INSRTATTR, OnInsrtattr) ON_BN_CLICKED(IDC_INSRTCOND, OnInsrtcond) ON_BN_CLICKED(IDC_INSRTEVAL, OnInsrteval) ON_BN_CLICKED(IDC_INSRTEVNT, OnInsrtevnt) ON_BN_CLICKED(IDC_INSRTREF, OnInsrtref) ON_BN_CLICKED(IDC_INSRTVERB, OnInsrtverb) ON_BN_CLICKED(IDC_INSRTOP, OnInsrtop) ON_CBN_SELCHANGE(IDC_TRIG_ID, OnSelchangeTrigId) ON_EN_CHANGE(IDC_TRIGGEREDITBOX, OnChangeTriggereditbox) ON_BN_CLICKED(IDC_NEWREGIONTRIG, OnNewregiontrig) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTriggerEditDlg message handlers void CTriggerEditDlg::OnNewtrigger() { CString csID; csID.Format(_T("TRIG %ld"), m_dwNextTrig); CTrigger * pNewTrigger = new (CTrigger); pNewTrigger->m_csID = csID; pNewTrigger->m_bIsCustom = true; m_dwNextTrig++; int iIndex = this->m_ccbTriggerID.AddString( csID ); this->m_ccbTriggerID.SetItemDataPtr( iIndex, (void *) pNewTrigger ); this->m_ccbTriggerID.SelectString( -1, csID ); } void CTriggerEditDlg::OnOk() { if ( this->m_bSingleMode ) { CDialog::OnOK(); return; } // Save all of the triggers. CStdioFile csfTriggers; if (csfTriggers.Open( TMP_TRIGGER_FILE, CFile::modeWrite | CFile::modeCreate | CFile::shareDenyNone ) ) { for ( int i = 0; i < this->m_ccbTriggerID.GetCount(); i++ ) { CTrigger * pTrigger = (CTrigger *) this->m_ccbTriggerID.GetItemDataPtr( i ); if ( pTrigger && pTrigger->m_bIsCustom ) { CString csLine; csLine.Format(_T("[%s]\n"), pTrigger->m_csID ); csfTriggers.WriteString(csLine); for ( int j = 0; j <= pTrigger->m_csaEvents.GetUpperBound(); j++ ) { csLine.Format(_T("%s\n"), pTrigger->m_csaEvents.GetAt(j)); csfTriggers.WriteString(csLine); } csfTriggers.WriteString(_T("\n")); } } } csfTriggers.Close(); CDialog::OnOK(); } BOOL CTriggerEditDlg::OnInitDialog() { CWaitCursor hourglass; CDialog::OnInitDialog(); Localize(); FillEvents(); FillEvaluators(); FillAttributes(); FillVerbs(); FillReferences(); FillConditions(); if ( this->m_bSingleMode ) { // don't read the tustrig.scp file // fill the edit box with the stuff from the trigger if ( m_pCurrentTrigger ) { for ( int i = 0; i <= this->m_pCurrentTrigger->m_csaEvents.GetUpperBound(); i++ ) { CString csTrigger; for ( int i = 0; i <= m_pCurrentTrigger->m_csaEvents.GetUpperBound(); i++ ) { CString csTemp = csTrigger; if ( csTrigger != _T("") ) csTemp.Format(_T("%s%c%c%s"), csTrigger, 0x0d, 0x0a, m_pCurrentTrigger->m_csaEvents.GetAt(i)); else csTemp.Format(_T("%s"), m_pCurrentTrigger->m_csaEvents.GetAt(i)); csTrigger = csTemp; } this->m_ceTrigEdit.SetWindowText(csTrigger); } } this->m_ccbTriggerID.ShowWindow( SW_HIDE ); this->m_cbNewTrigger.ShowWindow( SW_HIDE ); this->m_cbNewRegionTrig.ShowWindow( SW_HIDE ); } else { // read the files from the trigger scripts CStdioFile csfTrigFile; CString csScpPath = Main->m_pScripts->GetScriptPath(); CString csFile; if ( Main->GetProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) csFile = TRIGGER_FILE; else csFile.Format(_T("%s%s"), csScpPath, TRIGGER_FILE); if (csfTrigFile.Open( csFile, CFile::modeRead | CFile::shareDenyNone )) { ReadFile( &csfTrigFile, false ); csfTrigFile.Close(); } if ( Main->GetProfileType() == PROFILE_REMOTE ) { Main->m_pAxis->GetRemoteFile(_T("spheretrig.scp"), _T("spheretrig.scp")); } if ( Main->GetProfileType() == PROFILE_REMOTE || csScpPath == _T("") ) csFile = Main->GetProfileType() == PROFILE_REMOTE ? RMT_TRIGGER_FILE : USER_TRIGGER_FILE; else csFile.Format(_T("%s%s"), csScpPath, USER_TRIGGER_FILE); if (csfTrigFile.Open( csFile, CFile::modeRead | CFile::shareDenyNone ) ) { ReadFile( &csfTrigFile, true ); csfTrigFile.Close(); } } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CTriggerEditDlg::FillEvents() { this->m_ccbEvent.AddString(_T("DAMAGE")); this->m_ccbEvent.AddString(_T("DCLICK")); this->m_ccbEvent.AddString(_T("DROPON_CHAR")); this->m_ccbEvent.AddString(_T("DROPON_GROUND")); this->m_ccbEvent.AddString(_T("DROPON_ITEM")); this->m_ccbEvent.AddString(_T("DROPON_TYPE")); this->m_ccbEvent.AddString(_T("EQUIP")); this->m_ccbEvent.AddString(_T("HEAR")); this->m_ccbEvent.AddString(_T("PICKUP_GROUND")); this->m_ccbEvent.AddString(_T("PICKUP_PACK")); this->m_ccbEvent.AddString(_T("SPELL")); this->m_ccbEvent.AddString(_T("STEP")); this->m_ccbEvent.AddString(_T("TARGON_CHAR")); this->m_ccbEvent.AddString(_T("TARGON_GROUND")); this->m_ccbEvent.AddString(_T("TARGON_ITEM")); this->m_ccbEvent.AddString(_T("TARGON_TYPE")); this->m_ccbEvent.AddString(_T("TIMER")); this->m_ccbEvent.AddString(_T("UNEQUIP")); } void CTriggerEditDlg::FillAttributes() { // CObjBase stuff m_ccbAttributes.AddString(_T("TYPEDEF")); m_ccbAttributes.AddString(_T("NAME")); m_ccbAttributes.AddString(_T("TIMER")); m_ccbAttributes.AddString(_T("COLOR")); m_ccbAttributes.AddString(_T("UID")); m_ccbAttributes.AddString(_T("P")); m_ccbAttributes.AddString(_T("Z")); // CItem stuff m_ccbAttributes.AddString(_T("ID")); m_ccbAttributes.AddString(_T("AMOUNT")); m_ccbAttributes.AddString(_T("TYPE")); m_ccbAttributes.AddString(_T("ATTR")); m_ccbAttributes.AddString(_T("LINK")); m_ccbAttributes.AddString(_T("MORE1")); m_ccbAttributes.AddString(_T("MORE2")); m_ccbAttributes.AddString(_T("MOREP")); m_ccbAttributes.AddString(_T("MOREX")); m_ccbAttributes.AddString(_T("MOREY")); m_ccbAttributes.AddString(_T("MOREZ")); m_ccbAttributes.AddString(_T("HITPOINTS")); m_ccbAttributes.AddString(_T("FRUIT")); // CChar stuff m_ccbAttributes.AddString(_T("DIR")); m_ccbAttributes.AddString(_T("BODY")); m_ccbAttributes.AddString(_T("XBODY")); m_ccbAttributes.AddString(_T("XSKIN")); m_ccbAttributes.AddString(_T("HOME")); m_ccbAttributes.AddString(_T("FONT")); m_ccbAttributes.AddString(_T("FLAGS")); m_ccbAttributes.AddString(_T("ACTION")); m_ccbAttributes.AddString(_T("TITLE")); m_ccbAttributes.AddString(_T("HITS")); m_ccbAttributes.AddString(_T("STAMINA")); m_ccbAttributes.AddString(_T("MANA")); m_ccbAttributes.AddString(_T("FOOD")); m_ccbAttributes.AddString(_T("CREATE")); m_ccbAttributes.AddString(_T("ACTARG1")); m_ccbAttributes.AddString(_T("ACTARG2")); m_ccbAttributes.AddString(_T("STR")); m_ccbAttributes.AddString(_T("DEX")); m_ccbAttributes.AddString(_T("INT")); m_ccbAttributes.AddString(_T("KARMA")); m_ccbAttributes.AddString(_T("FAME")); m_ccbAttributes.AddString(_T("KILLS")); // Skills...ugh } void CTriggerEditDlg::FillVerbs() { // CObjBase stuff m_ccbVerbs.AddString(_T("REMOVE")); m_ccbVerbs.AddString(_T("MESSAGE")); m_ccbVerbs.AddString(_T("SPEAK")); m_ccbVerbs.AddString(_T("SOUND")); m_ccbVerbs.AddString(_T("EFFECT")); m_ccbVerbs.AddString(_T("FIX")); m_ccbVerbs.AddString(_T("FLIP")); m_ccbVerbs.AddString(_T("SHOW")); m_ccbVerbs.AddString(_T("MOVE")); m_ccbVerbs.AddString(_T("SPELLEFFECT")); m_ccbVerbs.AddString(_T("EDIT")); m_ccbVerbs.AddString(_T("NUDGEUP")); m_ccbVerbs.AddString(_T("NUDGEDOWN")); // CItem stuff m_ccbVerbs.AddString(_T("DUPE")); m_ccbVerbs.AddString(_T("BOUNCE")); // CChar stuff m_ccbVerbs.AddString(_T("DAMAGE")); m_ccbVerbs.AddString(_T("POLY")); m_ccbVerbs.AddString(_T("RESURRECT")); m_ccbVerbs.AddString(_T("GO")); m_ccbVerbs.AddString(_T("GOUID")); m_ccbVerbs.AddString(_T("GOCHAR")); m_ccbVerbs.AddString(_T("GOSOCK")); m_ccbVerbs.AddString(_T("GOCLI")); m_ccbVerbs.AddString(_T("JAIL")); m_ccbVerbs.AddString(_T("KICK")); m_ccbVerbs.AddString(_T("KILL")); m_ccbVerbs.AddString(_T("GHOST")); m_ccbVerbs.AddString(_T("NEWITEM")); m_ccbVerbs.AddString(_T("COUNT")); m_ccbVerbs.AddString(_T("CONSUME")); m_ccbVerbs.AddString(_T("SUMMONCAGE")); m_ccbVerbs.AddString(_T("ANIM")); m_ccbVerbs.AddString(_T("SLEEP")); m_ccbVerbs.AddString(_T("FACE")); m_ccbVerbs.AddString(_T("DISCONNECT")); m_ccbVerbs.AddString(_T("ALLSKILLS")); m_ccbVerbs.AddString(_T("BANK")); m_ccbVerbs.AddString(_T("SELL")); m_ccbVerbs.AddString(_T("BUY")); m_ccbVerbs.AddString(_T("BYE")); m_ccbVerbs.AddString(_T("BOW")); m_ccbVerbs.AddString(_T("SALUTE")); m_ccbVerbs.AddString(_T("ATTACK")); m_ccbVerbs.AddString(_T("DRAWMAP")); m_ccbVerbs.AddString(_T("EMOTE")); m_ccbVerbs.AddString(_T("SKILL")); m_ccbVerbs.AddString(_T("INVUL")); m_ccbVerbs.AddString(_T("INVIS")); m_ccbVerbs.AddString(_T("SHRINK")); m_ccbVerbs.AddString(_T("FORGIVE")); m_ccbVerbs.AddString(_T("UNDERWEAR")); m_ccbVerbs.AddString(_T("PETSTABLE")); m_ccbVerbs.AddString(_T("PETRETRIEVE")); m_ccbVerbs.AddString(_T("SUMMONTO")); m_ccbVerbs.AddString(_T("HUNGRY")); m_ccbVerbs.AddString(_T("WHERE")); m_ccbVerbs.AddString(_T("SUICIDE")); // CClient stuff m_ccbVerbs.AddString(_T("SET")); m_ccbVerbs.AddString(_T("GMMENU")); m_ccbVerbs.AddString(_T("ITEMMENU")); m_ccbVerbs.AddString(_T("WEBLINK")); m_ccbVerbs.AddString(_T("SYSMESSAGE")); m_ccbVerbs.AddString(_T("GMPAGE")); m_ccbVerbs.AddString(_T("VERSION")); m_ccbVerbs.AddString(_T("INFORMATION")); m_ccbVerbs.AddString(_T("ADDITEM")); m_ccbVerbs.AddString(_T("ADDNPC")); m_ccbVerbs.AddString(_T("SUMMON")); m_ccbVerbs.AddString(_T("REPAIR")); m_ccbVerbs.AddString(_T("PRIVSHOW")); m_ccbVerbs.AddString(_T("GOTARG")); m_ccbVerbs.AddString(_T("ALLMOVE")); m_ccbVerbs.AddString(_T("DEBUG")); m_ccbVerbs.AddString(_T("LISTEN")); m_ccbVerbs.AddString(_T("HEARALL")); m_ccbVerbs.AddString(_T("GM")); m_ccbVerbs.AddString(_T("DETAIL")); m_ccbVerbs.AddString(_T("BANKSELF")); m_ccbVerbs.AddString(_T("RESEND")); m_ccbVerbs.AddString(_T("CAST")); m_ccbVerbs.AddString(_T("TELE")); m_ccbVerbs.AddString(_T("STATIC")); m_ccbVerbs.AddString(_T("RETURN 0")); m_ccbVerbs.AddString(_T("RETURN 1")); } void CTriggerEditDlg::FillEvaluators() { m_ccbEvaluators.AddString(_T("==")); m_ccbEvaluators.AddString(_T("&&")); m_ccbEvaluators.AddString(_T("||")); m_ccbEvaluators.AddString(_T("!=")); m_ccbEvaluators.AddString(_T(">")); m_ccbEvaluators.AddString(_T("<")); m_ccbEvaluators.AddString(_T(">=")); m_ccbEvaluators.AddString(_T("<=")); } void CTriggerEditDlg::FillReferences() { m_ccbReferences.AddString(_T("LINK.")); m_ccbReferences.AddString(_T("REGION.")); m_ccbReferences.AddString(_T("ACT.")); m_ccbReferences.AddString(_T("TARG.")); m_ccbReferences.AddString(_T("SRC.")); } void CTriggerEditDlg::FillConditions() { m_ccbConditions.AddString(_T("IF")); m_ccbConditions.AddString(_T("ELSEIF")); m_ccbConditions.AddString(_T("ELSE")); m_ccbConditions.AddString(_T("ENDIF")); m_ccbConditions.AddString(_T("DORAND")); m_ccbConditions.AddString(_T("ENDDO")); } void CTriggerEditDlg::OnInsrtattr() { CString csAttr; this->m_ccbAttributes.GetWindowText(csAttr); this->m_ceQuickClip.SetWindowText(csAttr); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); } void CTriggerEditDlg::OnInsrtcond() { SaveClipboard(); CString csCond; this->m_ccbConditions.GetWindowText(csCond); this->m_ceQuickClip.SetWindowText(csCond); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::OnInsrteval() { SaveClipboard(); CString csEval; this->m_ccbEvaluators.GetWindowText(csEval); this->m_ceQuickClip.SetWindowText(csEval); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::OnInsrtevnt() { SaveClipboard(); CString csEvnt, csText; this->m_ccbEvent.GetWindowText(csEvnt); csText.Format(_T("ONTRIGGER=%s"), csEvnt); this->m_ceQuickClip.SetWindowText(csText); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::OnInsrtref() { SaveClipboard(); CString csRef; this->m_ccbReferences.GetWindowText(csRef); this->m_ceQuickClip.SetWindowText(csRef); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::OnInsrtverb() { SaveClipboard(); CString csVerb; this->m_ccbVerbs.GetWindowText(csVerb); this->m_ceQuickClip.SetWindowText(csVerb); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::OnInsrtop() { SaveClipboard(); CString csOp; this->m_ccbOperators.GetWindowText(csOp); this->m_ceQuickClip.SetWindowText(csOp); this->m_ceQuickClip.SetSel(0, -1); this->m_ceQuickClip.Copy(); this->m_ceTrigEdit.Paste(); RestoreClipboard(); } void CTriggerEditDlg::FillOperators() { m_ccbOperators.AddString(_T("=")); m_ccbOperators.AddString(_T("+")); m_ccbOperators.AddString(_T("+-")); m_ccbOperators.AddString(_T("*")); m_ccbOperators.AddString(_T("/")); m_ccbOperators.AddString(_T("|")); m_ccbOperators.AddString(_T("^")); m_ccbOperators.AddString(_T("&")); m_ccbOperators.AddString(_T("!")); } void CTriggerEditDlg::SaveClipboard() { this->m_ceOldClip.Clear(); this->m_ceOldClip.Paste(); } void CTriggerEditDlg::RestoreClipboard() { this->m_ceOldClip.SetSel(0, -1); this->m_ceOldClip.Copy(); } void CTriggerEditDlg::OnSelchangeTrigId() { if ( m_iSel >= 0 ) { CTrigger * pOldTrigger = (CTrigger *) this->m_ccbTriggerID.GetItemDataPtr( m_iSel ); if ( pOldTrigger ) { CStringArray csaNewEvents; for (int i = 0; i < this->m_ceTrigEdit.GetLineCount(); i++ ) { TCHAR szLine[512]; memset(&szLine[0], 0x00, sizeof(szLine)); this->m_ceTrigEdit.GetLine( i, szLine, sizeof(szLine) ); csaNewEvents.Add(szLine); } pOldTrigger->m_csaEvents.RemoveAll(); pOldTrigger->m_csaEvents.Copy( csaNewEvents ); } } m_iSel = this->m_ccbTriggerID.GetCurSel(); this->m_ceTrigEdit.SetWindowText(_T("")); CTrigger * pNewTrigger = (CTrigger *) this->m_ccbTriggerID.GetItemDataPtr( m_iSel ); if ( pNewTrigger ) { CString csTrigger; for ( int i = 0; i <= pNewTrigger->m_csaEvents.GetUpperBound(); i++ ) { CString csTemp = csTrigger; if ( csTrigger != _T("") ) csTemp.Format(_T("%s%c%c%s"), csTrigger, 0x0d, 0x0a, pNewTrigger->m_csaEvents.GetAt(i)); else csTemp.Format(_T("%s"), pNewTrigger->m_csaEvents.GetAt(i)); csTrigger = csTemp; } this->m_ceTrigEdit.SetWindowText(csTrigger); } else { CTrigger * pNewTrigger = new (CTrigger); this->m_ccbTriggerID.SetItemDataPtr( m_iSel, (void *) pNewTrigger ); } this->m_pCurrentTrigger = pNewTrigger; } void CTriggerEditDlg::OnChangeTriggereditbox() { if ( this->m_pCurrentTrigger ) this->m_pCurrentTrigger->m_bIsCustom = true; } void CTriggerEditDlg::ReadFile(CStdioFile *pFile, bool bIsCustom) { BOOL bStatus = TRUE; CTrigger * pTrigger = NULL; while ( bStatus ) { CString csLine; bStatus = pFile->ReadString( csLine ); if ( bStatus ) { if ( csLine.Find(_T("[")) == 0 ) { // got a new trigger entry if ( pTrigger ) { // Anything to do to finish this guy up? } CString csTemp = csLine.Mid(1); csTemp = csTemp.SpanExcluding(_T("]")); csTemp.MakeUpper(); if ( csTemp.Find(_T("REGION")) != -1 ) { CString csID = csTemp.Mid(csTemp.Find(_T("REGION")) + 6); DWORD dwID = _tstoi(csID); if ( dwID >= m_dwNextRegion ) m_dwNextRegion = dwID + 1; } if ( csTemp.Find(_T("TRIG")) != -1 ) { CString csID = csTemp.Mid(csTemp.Find(_T("TRIG")) + 4); DWORD dwID = _tstoi(csID); if ( dwID >= m_dwNextTrig ) m_dwNextTrig = dwID + 1; } // does this one already exist? int iIndex = this->m_ccbTriggerID.FindString( -1, csTemp ); if ( iIndex != -1 ) { pTrigger = (CTrigger *) this->m_ccbTriggerID.GetItemDataPtr( iIndex ); pTrigger->m_csaEvents.RemoveAll(); } else { pTrigger = new (CTrigger); iIndex = this->m_ccbTriggerID.AddString(csTemp); this->m_ccbTriggerID.SetItemDataPtr( iIndex, (void *) pTrigger ); } pTrigger->m_csID = csTemp; pTrigger->m_bIsCustom = bIsCustom; } else { // either we are before the triggers, or we are inside one if ( pTrigger ) pTrigger->m_csaEvents.Add( csLine ); } } } } CTriggerEditDlg::~CTriggerEditDlg() { } BOOL CTriggerEditDlg::DestroyWindow() { for ( int i = 0; i < this->m_ccbTriggerID.GetCount(); i++ ) { CTrigger * pTrigger = (CTrigger *) this->m_ccbTriggerID.GetItemDataPtr( i ); if ( pTrigger ) { pTrigger->m_csaEvents.RemoveAll(); delete pTrigger; } } return CDialog::DestroyWindow(); } void CTriggerEditDlg::OnNewregiontrig() { CString csID; csID.Format(_T("REGION %ld"), m_dwNextRegion); CTrigger * pNewTrigger = new (CTrigger); pNewTrigger->m_csID = csID; pNewTrigger->m_bIsCustom = true; m_dwNextRegion++; int iIndex = this->m_ccbTriggerID.AddString( csID ); this->m_ccbTriggerID.SetItemDataPtr( iIndex, (void *) pNewTrigger ); this->m_ccbTriggerID.SelectString( -1, csID ); } void CTriggerEditDlg::Localize(void) { locale->LocalizeWindow(IDD, 0, NULL, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_NEWREGIONTRIG, (CWnd*)&m_cbNewRegionTrig, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_NEWTRIGGER, (CWnd*)&m_cbNewTrigger, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_OLDCLIP, (CWnd*)&m_ceOldClip, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_QUICKCLIP, (CWnd*)&m_ceQuickClip, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TOPERATORS, (CWnd*)&m_ccbOperators, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGGEREDITBOX, (CWnd*)&m_ceTrigEdit, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TVERBS, (CWnd*)&m_ccbVerbs, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TEVALUATORS, (CWnd*)&m_ccbEvaluators, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TREFERENCES, (CWnd*)&m_ccbReferences, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TCONDITIONS, (CWnd*)&m_ccbConditions, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TATTRIBUTES, (CWnd*)&m_ccbAttributes, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGGER_EVENT, (CWnd*)&m_ccbEvent, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIG_ID, (CWnd*)&m_ccbTriggerID, (CWnd*)this); locale->LocalizeWindow(IDD, IDOK, (CWnd*)&m_bOK, (CWnd*)this); locale->LocalizeWindow(IDD, IDCANCEL, (CWnd*)&m_bCancel, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTEVNT, (CWnd*)&m_bInsertEvent, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTCOND, (CWnd*)&m_bInsertCondition, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTATTR, (CWnd*)&m_bInsertAttr, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTREF, (CWnd*)&m_bInsertRef, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTVERB, (CWnd*)&m_bInsertVerb, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTEVAL, (CWnd*)&m_bInsertEval, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_INSRTOP, (CWnd*)&m_bInsertOperator, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC1, (CWnd*)&m_sStatic1, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC2, (CWnd*)&m_sStatic2, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC3, (CWnd*)&m_sStatic3, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC4, (CWnd*)&m_sStatic4, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC5, (CWnd*)&m_sStatic5, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC6, (CWnd*)&m_sStatic6, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC7, (CWnd*)&m_sStatic7, (CWnd*)this); locale->LocalizeWindow(IDD, IDC_TRIGEDIT_STATIC8, (CWnd*)&m_sStatic8, (CWnd*)this); } --- NEW FILE: TriggerEditDlg.h --- /* $Id: TriggerEditDlg.h,v 1.1 2003/07/09 19:57:25 pesterle Exp $ ********************************************************************** * Copyright (C) Philip A. Esterle 1998-2003 * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * ********************************************************************** */ #if !defined(AFX_TRIGGEREDITDLG_H__94091823_C539_11D3_A386_00805FD91B8C__INCLUDED_) #define AFX_TRIGGEREDITDLG_H__94091823_C539_11D3_A386_00805FD91B8C__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // TriggerEditDlg.h : header file // #include "Trigger.h" ///////////////////////////////////////////////////////////////////////////// // CTriggerEditDlg dialog class CTriggerEditDlg : public CDialog { // Construction public: virtual ~CTriggerEditDlg(); CTrigger * m_pCurrentTrigger; int m_iSel; bool m_bSingleMode; bool m_bInAssignment; int m_iConditions; bool m_bInCondition; int m_iBlockCount; bool m_bOpenBrace; bool m_bNewLine; CString m_csLine; CTriggerEditDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CTriggerEditDlg) enum { IDD = IDD_TRIGGEREDITDLG }; CButton m_cbNewRegionTrig; CButton m_cbNewTrigger; CEdit m_ceOldClip; CEdit m_ceQuickClip; CComboBox m_ccbOperators; CEdit m_ceTrigEdit; CComboBox m_ccbVerbs; CComboBox m_ccbEvaluators; CComboBox m_ccbReferences; CComboBox m_ccbConditions; CComboBox m_ccbAttributes; CComboBox m_ccbEvent; CComboBox m_ccbTriggerID; CButton m_bOK; CButton m_bCancel; CButton m_bInsertEvent; CButton m_bInsertCondition; CButton m_bInsertAttr; CButton m_bInsertRef; CButton m_bInsertVerb; CButton m_bInsertEval; CButton m_bInsertOperator; CButton m_sStatic1; CButton m_sStatic2; CButton m_sStatic3; CButton m_sStatic4; CButton m_sStatic5; CButton m_sStatic6; CButton m_sStatic7; CButton m_sStatic8; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CTriggerEditDlg) public: virtual BOOL DestroyWindow(); protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: DWORD m_dwNextRegion; DWORD m_dwNextTrig; void ReadFile(CStdioFile * pFile, bool bIsCustom); void RestoreClipboard(); void SaveClipboard(); void FillOperators(); void FillConditions(); void FillReferences(); void FillEvaluators(); void FillVerbs(); void FillAttributes(); void FillEvents(); // Generated message map functions //{{AFX_MSG(CTriggerEditDlg) afx_msg void OnNewtrigger(); afx_msg void OnOk(); virtual BOOL OnInitDialog(); afx_msg void OnInsrtattr(); afx_msg void OnInsrtcond(); afx_msg void OnInsrteval(); afx_msg void OnInsrtevnt(); afx_msg void OnInsrtref(); afx_msg void OnInsrtval(); afx_msg void OnInsrtverb(); afx_msg void OnInsrtop(); afx_msg void OnSelchangeTrigId(); afx_msg void OnChangeTriggereditbox(); afx_msg void OnNewregiontrig(); //}}AFX_MSG DECLARE_MESSAGE_MAP() public: void Localize(void); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_TRIGGEREDITDLG_H__94091823_C539_11D3_A386_00805FD91B8C__INCLUDED_) Index: AccountDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/AccountDlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** AccountDlg.cpp 3 Jul 2003 18:09:29 -0000 1.1 --- AccountDlg.cpp 9 Jul 2003 19:57:25 -0000 1.2 *************** *** 29,32 **** --- 29,33 ---- #include "AccountDlg.h" #include "AddValueDialog.h" + #include "Account.h" #ifdef _DEBUG *************** *** 36,39 **** --- 37,66 ---- #endif + const TCHAR * knownAcctTags [] = + { + _T("ACCOUNT"), + _T("BLOCK"), + _T("CHATNAME"), + _T("COMMENT"), + _T("EMAIL"), + _T("EMAILFAIL"), + _T("EMAILMSG"), + _T("FIRSTCONNECTDATE"), + _T("FIRSTIP"), + _T("GUEST"), + _T("JAIL"), + _T("LANG"), + _T("LASTCHARUID"), + _T("LASTCONNECTDATE"), + _T("LASTCONNECTTIME"), + _T("LASTIP"), + _T("LEVEL"), + _T("PASSWORD"), + _T("PLEVEL"), + _T("PRIV"), + _T("T2A"), + _T("TOTALCONNECTTIME"), + }; + ///////////////////////////////////////////////////////////////////////////// // CAccountDlg dialog *************** *** 293,297 **** if ( iSel != -1 ) { ! AxisMessageBox(locale->String(IDS_ACCTEDIT_ACCOUNTEXISTS), MB_OK | MB_ICONEXCLAMATION); delete pAcct; return; --- 320,324 ---- if ( iSel != -1 ) { ! AfxMessageBox(locale->String(IDS_ACCTEDIT_ACCOUNTEXISTS), MB_OK | MB_ICONEXCLAMATION); delete pAcct; return; *************** *** 316,334 **** CString csMsg; csMsg.Format(locale->String(IDS_ACCTEDIT_DELETEACCT), pAcct->m_csName); ! if ( AxisMessageBox( csMsg, MB_OKCANCEL | MB_ICONQUESTION) == IDCANCEL ) return; ! if ( AxisMessageBox( locale->String(IDS_ACCTEDIT_DELETEWARN), MB_OKCANCEL | MB_ICONEXCLAMATION) == IDCANCEL ) return; // Two warnings is enough ! if ( Main->m_pScriptsOld->m_bNewFormat ) ! { ! if ( Main->m_dwCommandVersion ) ! csMsg.Format(_T(".serv.accountmgr %s delete"), pAcct->m_csName); ! else ! csMsg.Format(_T(".serv.account %s delete"), pAcct->m_csName); ! } ! else ! csMsg.Format(_T(".account %s delete"), pAcct->m_csName); ! SendToUORaw(csMsg); this->m_clbAcctList.DeleteString( iSel ); delete pAcct; --- 343,353 ---- CString csMsg; csMsg.Format(locale->String(IDS_ACCTEDIT_DELETEACCT), pAcct->m_csName); ! if ( AfxMessageBox( csMsg, MB_OKCANCEL | MB_ICONQUESTION) == IDCANCEL ) return; ! if ( AfxMessageBox( locale->String(IDS_ACCTEDIT_DELETEWARN), MB_OKCANCEL | MB_ICONEXCLAMATION) == IDCANCEL ) return; // Two warnings is enough ! csMsg.Format(_T(".account %s delete"), pAcct->m_csName); ! Main->m_pAxis->SendText(csMsg); this->m_clbAcctList.DeleteString( iSel ); delete pAcct; *************** *** 364,368 **** if ( csPath == _T("") ) { ! AxisMessageBox(locale->String(IDS_ACCTEDIT_CANTFINDFILE), MB_OK | MB_ICONEXCLAMATION); return; } --- 383,387 ---- if ( csPath == _T("") ) { ! AfxMessageBox(locale->String(IDS_ACCTEDIT_CANTFINDFILE), MB_OK | MB_ICONEXCLAMATION); return; } *************** *** 414,421 **** if ( Main->GetProfileType() == PROFILE_REMOTE ) { ! CRemoteConnection remote; ! if ( ! remote.SendCustomFile(_T("grayacct"), csFile ) ) { ! if ( AxisMessageBox(locale->String(IDS_ACCTEDIT_CANTUPLOAD), MB_YESNO | MB_ICONQUESTION ) == IDNO ) return; else --- 433,439 ---- if ( Main->GetProfileType() == PROFILE_REMOTE ) { ! if ( ! Main->m_pAxis->SendLocalFile(_T("sphereaccu.scp"), csFile ) ) { ! if ( AfxMessageBox(locale->String(IDS_ACCTEDIT_CANTUPLOAD), MB_YESNO | MB_ICONQUESTION ) == IDNO ) return; else *************** *** 428,432 **** } if ( this->m_clbUpdates.GetCount() > 0 ) ! AxisMessageBox(locale->String(IDS_ACCTEDIT_CHANGESQUEUED), MB_OK | MB_ICONINFORMATION); } --- 446,450 ---- } if ( this->m_clbUpdates.GetCount() > 0 ) ! AfxMessageBox(locale->String(IDS_ACCTEDIT_CHANGESQUEUED), MB_OK | MB_ICONINFORMATION); } *************** *** 439,443 **** if ( this->m_clbUpdates.GetCount() != 0 ) { ! if ( AxisMessageBox(locale->String(IDS_ACCTEDIT_CLOSEWARN), MB_OKCANCEL | MB_ICONEXCLAMATION ) == IDCANCEL ) return; } --- 457,461 ---- if ( this->m_clbUpdates.GetCount() != 0 ) { ! if ( AfxMessageBox(locale->String(IDS_ACCTEDIT_CLOSEWARN), MB_OKCANCEL | MB_ICONEXCLAMATION ) == IDCANCEL ) return; } *************** *** 596,602 **** if ( Main->GetProfileType() == PROFILE_REMOTE ) { - CRemoteConnection remote; csFile.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_ACCU_FILE); ! remote.GetCustomFile(_T("grayacct"), csFile); } else --- 614,619 ---- if ( Main->GetProfileType() == PROFILE_REMOTE ) { csFile.Format(_T("%s\\%s"), Main->GetProfileString(), RMT_ACCU_FILE); ! Main->m_pAxis->GetRemoteFile(_T("sphereaccu.scp"), csFile); } else *************** *** 621,625 **** if ( csPath == _T("") ) { ! AxisMessageBox(locale->String(IDS_ACCTEDIT_CANTOPEN), MB_OK | MB_ICONEXCLAMATION); return; } --- 638,642 ---- if ( csPath == _T("") ) { ! AfxMessageBox(locale->String(IDS_ACCTEDIT_CANTOPEN), MB_OK | MB_ICONEXCLAMATION); return; } *************** *** 720,724 **** else { ! AxisMessageBox(_T("Unable to open the account file."), MB_OK | MB_ICONEXCLAMATION); return; } --- 737,741 ---- else { ! AfxMessageBox(_T("Unable to open the account file."), MB_OK | MB_ICONEXCLAMATION); return; } Index: DefEditDlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/DefEditDlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** DefEditDlg.cpp 3 Jul 2003 18:09:29 -0000 1.1 --- DefEditDlg.cpp 9 Jul 2003 19:57:25 -0000 1.2 *************** *** 28,32 **** #include "Scripts.h" #include "DefEditDlg.h" - #include "RemoteConsole.h" #ifdef _DEBUG --- 28,31 ---- *************** *** 120,129 **** if ( csName == _T("") ) { ! AxisMessageBox(locale->String(IDS_DEFEDIT_BLANK), MB_OK | MB_ICONEXCLAMATION); return; } if ( csName.SpanExcluding( _T(" =+)(*&^%$#@!~`';:[]}{<>.,/?\\|\"") ) != csName ) { ! AxisMessageBox(locale->String(IDS_DEFEDIT_INVALID), MB_OK | MB_ICONEXCLAMATION ); return; } --- 119,128 ---- if ( csName == _T("") ) { ! AfxMessageBox(locale->String(IDS_DEFEDIT_BLANK), MB_OK | MB_ICONEXCLAMATION); return; } if ( csName.SpanExcluding( _T(" =+)(*&^%$#@!~`';:[]}{<>.,/?\\|\"") ) != csName ) { ! AfxMessageBox(locale->String(IDS_DEFEDIT_INVALID), MB_OK | MB_ICONEXCLAMATION ); return; } *************** *** 133,137 **** if ( csGroup == _T("") ) { ! AxisMessageBox(locale->String(IDS_DEFEDIT_GROUP), MB_OK | MB_ICONEXCLAMATION ); return; } --- 132,136 ---- if ( csGroup == _T("") ) { ! AfxMessageBox(locale->String(IDS_DEFEDIT_GROUP), MB_OK | MB_ICONEXCLAMATION ); return; } *************** *** 139,143 **** CStdioFile csfTmp; CStdioFile csfOld; ! CString csScpPath = GetScriptPath(); CString csFile; if ( !csfTmp.Open( TMP_DEFS_FILE, CFile::modeWrite | CFile::shareDenyWrite | CFile::modeCreate ) ) --- 138,142 ---- CStdioFile csfTmp; CStdioFile csfOld; ! CString csScpPath = Main->m_pScripts->GetScriptPath(); CString csFile; if ( !csfTmp.Open( TMP_DEFS_FILE, CFile::modeWrite | CFile::shareDenyWrite | CFile::modeCreate ) ) *************** *** 146,150 **** s.Format(locale->String(IDS_SCRIPTS_TDEFS)); csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPENTEMP), TMP_DEFS_FILE, s ); ! AxisMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); return; } --- 145,149 ---- s.Format(locale->String(IDS_SCRIPTS_TDEFS)); csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPENTEMP), TMP_DEFS_FILE, s ); ! AfxMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); return; } *************** *** 157,161 **** CString csMessage; csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AxisMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); csfOld.Open( csFile, CFile::modeCreate | CFile::shareDenyNone ); csfOld.Close(); --- 156,160 ---- CString csMessage; csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AfxMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); csfOld.Open( csFile, CFile::modeCreate | CFile::shareDenyNone ); csfOld.Close(); *************** *** 216,220 **** } // Update the file ! UpdateFiles( TMP_DEFS_FILE, USER_DEFS_FILE, RMT_DEFS_FILE, _T("graydefs") ); CDialog::OnOK(); } --- 215,219 ---- } // Update the file ! // UpdateFiles( TMP_DEFS_FILE, USER_DEFS_FILE, RMT_DEFS_FILE, _T("graydefs") ); CDialog::OnOK(); } *************** *** 229,240 **** this->m_cbType.SetCheck(1); - // Make sure we have the tusdefs.scp file - if ( Main->GetProfileType() == PROFILE_REMOTE ) - { - CRemoteConnection remote; - remote.GetCustomFile(_T("graydefs") ); - } CStdioFile csfDefsFile; ! CString csScpPath = GetScriptPath(); CString csFile; if ( csScpPath == _T("") ) --- 228,233 ---- this->m_cbType.SetCheck(1); CStdioFile csfDefsFile; ! CString csScpPath = Main->m_pScripts->GetScriptPath(); CString csFile; if ( csScpPath == _T("") ) *************** *** 246,250 **** CString csMessage; csMessage.Format(locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AxisMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); this->m_cbSave.EnableWindow( FALSE ); } --- 239,243 ---- CString csMessage; csMessage.Format(locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AfxMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); this->m_cbSave.EnableWindow( FALSE ); } *************** *** 286,290 **** CString csMessage; csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AxisMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); } else --- 279,283 ---- CString csMessage; csMessage.Format( locale->String(IDS_SCRIPTS_CANTOPEN), csFile ); ! AfxMessageBox( csMessage, MB_OK | MB_ICONEXCLAMATION ); } else Index: itemeditdlg.cpp =================================================================== RCS file: /cvsroot/sphere-axis/Axis/S_Sphere52/itemeditdlg.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** itemeditdlg.cpp 3 Jul 2003 18:09:29 -0000 1.1 --- itemeditdlg.cpp 9 Jul 2003 19:57:25 -0000 1.2 *************** *** 30,34 **** #include "AddValueDialog.h" #include "TriggerEditDlg.h" ! #include "ColorSelectionDlg.h" #ifdef _DEBUG --- 30,35 ---- #include "AddValueDialog.h" #include "TriggerEditDlg.h" ! #include "TSpellDef.h" ! #include "types.h" #ifdef _DEBUG *************** *** 81,85 **** DDX_Control(pDX, IDC_WEIGHT, m_ceWeight); DDX_Control(pDX, IDC_SUBSECTION, m_ccbSubsection); - DDX_Control(pDX, IDC_STATIC_ID, m_csBase); DDX_Control(pDX, IDC_SPELLID, m_ccbSpell); DDX_Control(pDX, IDC_SKILL, m_ccbSkill); --- 82,85 ---- *************** *** 166,172 **** Localize(); ! Main->m_pScriptsOld->LoadItems(); ! Main->m_pScriptsOld->LoadTemplates(); ! Main->m_pScriptsOld->CategorizeItems(); // Populate those darn combo boxes --- 166,172 ---- Localize(); ! Main->m_pScripts->LoadItems(); ! Main->m_pScripts->LoadTemplates(); ! CategorizeItems(); // Populate those darn combo boxes *************** *** 175,181 **** FillDupeItems(); ! for ( int i = 0; i < Main->m_pScriptsOld->m_aItems.GetSize(); i++ ) { ! CCategorizedScriptBase * pItem = (CCategorizedScriptBase *) Main->m_pScriptsOld->m_aItems.GetAt(i); if ( !pItem ) continue; --- 175,181 ---- FillDupeItems(); ! for ( int i = 0; i < (int) Main->m_pScripts->m_aItems.GetSize(); i++ ) { ! CCategorizedScriptBase * pItem = (CCategorizedScriptBase *) Main->m_pScripts->m_aItems.GetAt(i); if ( !pItem ) continue; *************** *** 184,196 **** CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScriptsOld->m_aItems.Find(csDupe); if ( iIndex == -1 ) { csDupe.Format(_T("%04x"), ahextoi(pItem->m_csDupeItem)); ! iIndex = Main->m_pScriptsOld->m_aItems.Find(csDupe); } if ( iIndex != -1 ) { ! CCategorizedScriptBase * pDupe = (CCategorizedScriptBase *) Main->m_pScriptsOld->m_aItems.GetAt(iIndex); if ( pItem->m_csCategory == _T("<none>") ) pItem->m_csCategory = pDupe->m_csCategory; --- 184,196 ---- CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScripts->m_aItems.Find(csDupe); if ( iIndex == -1 ) { csDupe.Format(_T("%04x"), ahextoi(pItem->m_csDupeItem)); ! iIndex = Main->m_pScripts->m_aItems.Find(csDupe); } if ( iIndex != -1 ) { ! CCategorizedScriptBase * pDupe = (CCategorizedScriptBase *) Main->m_pScripts->m_aItems.GetAt(iIndex); if ( pItem->m_csCategory == _T("<none>") ) pItem->m_csCategory = pDupe->m_csCategory; *************** *** 206,210 **** csString.Format(_T("%s [%s]"), pItem->m_csDescription, pItem->m_csValue); int index = this->m_ccbEntry.AddString(csString); ! this->m_ccbEntry.SetItemData(index, (DWORD) pItem); } --- 206,210 ---- csString.Format(_T("%s [%s]"), pItem->m_csDescription, pItem->m_csValue); int index = this->m_ccbEntry.AddString(csString); ! this->m_ccbEntry.SetItemData(index, (DWORD_PTR) pItem); } *************** *** 219,234 **** // Fill in the category box ! if (!Main->m_pScriptsOld->m_olItems.IsEmpty()) ! { ! POSITION pos = Main->m_pScriptsOld->m_olItems.GetHeadPosition(); ! while (pos != NULL) ! { ! CCategory * pCategory = (CCategory *) Main->m_pScriptsOld->m_olItems.GetNext(pos); ! int iIndex = m_ccbCategory.AddString(pCategory->m_csName); ! m_ccbCategory.SetItemData(iIndex, (DWORD) pCategory); ! } ! } ! m_hPaletteIcon = Main->LoadIcon(IDI_PALETTE); this->m_cbPalette.SetIcon(m_hPaletteIcon); if ( m_pItem != NULL ) --- 219,225 ---- // Fill in the category box ! FillCategoryTree(); ! m_hPaletteIcon = AfxGetApp()->LoadIcon(IDI_PALETTE); this->m_cbPalette.SetIcon(m_hPaletteIcon); if ( m_pItem != NULL ) *************** *** 273,277 **** CSubsection * pSubsection = (CSubsection *) pCategory->m_SubsectionList.GetNext(pos); int iIndex = m_ccbSubsection.AddString(pSubsection->m_csName); ! m_ccbSubsection.SetItemData(iIndex, (DWORD) pSubsection); } } --- 264,268 ---- CSubsection * pSubsection = (CSubsection *) pCategory->m_SubsectionList.GetNext(pos); int iIndex = m_ccbSubsection.AddString(pSubsection->m_csName); ! m_ccbSubsection.SetItemData(iIndex, (DWORD_PTR) pSubsection); } } *************** *** 338,342 **** // TODO: Add your control notification handler code here int iSel = m_ccbItemType.GetCurSel(); ! int iType = m_ccbItemType.GetItemData(iSel); bool bWeapon = false; bool bArmour = false; --- 329,333 ---- // TODO: Add your control notification handler code here int iSel = m_ccbItemType.GetCurSel(); ! int iType = (int) m_ccbItemType.GetItemData(iSel); bool bWeapon = false; bool bArmour = false; *************** *** 394,401 **** CString csValue; csValue.Format(_T("%s"), m_csDispID); ! int iIndex = Main->m_pScriptsOld->m_aItems.Find(csValue); if ( iIndex != -1 ) { ! CItem * pBase = (CItem *) Main->m_pScriptsOld->m_aItems.GetAt(iIndex); if ( pBase ) { --- 385,392 ---- CString csValue; csValue.Format(_T("%s"), m_csDispID); ! int iIndex = Main->m_pScripts->m_aItems.Find(csValue); if ( iIndex != -1 ) { ! CItem * pBase = (CItem *) Main->m_pScripts->m_aItems.GetAt(iIndex); if ( pBase ) { *************** *** 411,418 **** CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScriptsOld->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CItem * pDupe = (CItem *) Main->m_pScriptsOld->m_aItems.GetAt(iIndex); if ( pItem->m_csCategory == _T("<none>") ) pItem->m_csCategory = pDupe->m_csCategory; --- 402,409 ---- CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScripts->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CItem * pDupe = (CItem *) Main->m_pScripts->m_aItems.GetAt(iIndex); if ( pItem->m_csCategory == _T("<none>") ) pItem->m_csCategory = pDupe->m_csCategory; *************** *** 529,544 **** if (pItem->m_bySpell != 0) { ! CString csSpell = SpellNames[pItem->m_bySpell]; m_ccbSpell.SetCurSel(m_ccbSpell.FindStringExact(-1, csSpell)); } if (pItem->m_csDupeItem != _T("")) { - CDrewskyApp * pApp = (CDrewskyApp *) AfxGetApp(); CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = pApp->m_pScriptsOld->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CCategorizedScriptBase * pDupe = (CCategorizedScriptBase *) pApp->m_pScriptsOld->m_aItems.GetAt(iIndex); int iCurIndex = this->m_ccbDupeitem.GetCurSel(); if (iCurIndex == -1) --- 520,534 ---- if (pItem->m_bySpell != 0) { ! CString csSpell = Main->m_pScripts->SpellName(pItem->m_bySpell); m_ccbSpell.SetCurSel(m_ccbSpell.FindStringExact(-1, csSpell)); } if (pItem->m_csDupeItem != _T("")) { CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScripts->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CCategorizedScriptBase * pDupe = (CCategorizedScriptBase *) Main->m_pScripts->m_aItems.GetAt(iIndex); int iCurIndex = this->m_ccbDupeitem.GetCurSel(); if (iCurIndex == -1) *************** *** 597,612 **** { CItem * pDupe = NULL; - CDrewskyApp * pApp = (CDrewskyApp*) AfxGetApp(); if (pItem->m_csDupeItem != _T("")) { CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = pApp->m_pScriptsOld->m_aItems.Find(csDupe); if ( iIndex != -1 ) ! pDupe = (CItem *) pApp->m_pScriptsOld->m_aItems.GetAt(iIndex); } if (pDupe == NULL) { ! AxisMessageBox(locale->String(IDS_ITEMEDIT_CATSLOST), MB_OK | MB_ICONEXCLAMATION); m_ccbCategory.SetCurSel(0); m_ccbSubsection.SetCurSel(0); --- 587,601 ---- { CItem * pDupe = NULL; if (pItem->m_csDupeItem != _T("")) { CString csDupe; csDupe.Format(_T("%s"), pItem->m_csDupeItem); ! int iIndex = Main->m_pScripts->m_aItems.Find(csDupe); if ( iIndex != -1 ) ! pDupe = (CItem *) Main->m_pScripts->m_aItems.GetAt(iIndex); } if (pDupe == NULL) { ! AfxMessageBox(locale->String(IDS_ITEMEDIT_CATSLOST), MB_OK | MB_ICONEXCLAMATION); m_ccbCategory.SetCurSel(0); m_ccbSubsection.SetCurSel(0); *************** *** 671,681 **** this->m_ccbDupeitem.GetLBText(iIndex, csDupeItem); this->m_pItem->m_csDupeItem = csDupeItem; - CDrewskyApp * pApp = (CDrewskyApp *) AfxGetApp(); CString csDupe; csDupe.Format(_T("%s"), csDupeItem); ! int iIndex = pApp->m_pScriptsOld->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CItem * pDupe = (CItem *) pApp->m_pScriptsOld->m_aItems.GetAt(iIndex); if (pDupe != NULL) this->m_pItem->Dupe(pDupe); --- 660,669 ---- this->m_ccbDupeitem.GetLBText(iIndex, csDupeItem); this->m_pItem->m_csDupeItem = csDupeItem; CString csDupe; csDupe.Format(_T("%s"), csDupeItem); ! int iIndex = Main->m_pScripts->m_aItems.Find(csDupe); if ( iIndex != -1 ) { ! CItem * pDupe = (CItem *) Main->m_pScripts->m_aItems.GetAt(iIndex); if (pDupe != NULL) this->m_pItem->Dupe(pDupe); *************** *** 689,693 **** { CWaitCursor hourglass; ! if ( !m_iEdits || Main->m_pScriptsOld->SaveItems() ) CDialog::OnOK(); } --- 677,681 ---- { CWaitCursor hourglass; ! if ( !m_iEdits || Main->m_pScripts->SaveItems() ) CDialog::OnOK(); } *************** *** 696,711 **** { CAddValueDialog dlg; ! CCategory * pCategory; if (dlg.DoModal() == IDOK) { if (m_ccbCategory.FindStringExact(0, dlg.m_csValue) != CB_ERR) { ! AxisMessageBox(locale->String(IDS_CATEXISTS), MB_OK | MB_ICONEXCLAMATION); return; } else ! pCategory = FindCategory(&Main->m_pScriptsOld->m_olNPCs, dlg.m_csValue); int iIndex = m_ccbCategory.AddString(dlg.m_csValue); ! m_ccbCategory.SetItemData(iIndex, (DWORD) pCategory); m_ccbCategory.SetCurSel(iIndex); this->OnSelchangeCategory(); --- 684,699 ---- { CAddValueDialog dlg; ! CCategoryTree * pCategory; if (dlg.DoModal() == IDOK) { if (... [truncated message content] |