1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 // ---------------------------------------------------------------------------
18 // MainFrm.h : interface of the CMainFrame class
19 // ---------------------------------------------------------------------------
21 #if !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)
22 #define AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_
26 #endif // _MSC_VER > 1000
28 // ---------------------------------------------------------------------------
30 #include "nel/misc/stream.h"
31 #include "nel/misc/file.h"
32 #include "MasterTree.h"
35 #include "../export/export.h"
37 #include "../../3d/ligo/worldeditor/worldeditor_interface.h" // MasterCB
41 // ---------------------------------------------------------------------------
42 // Interface to the tools
43 // ---------------------------------------------------------------------------
50 // ---------------------------------------------------------------------------
52 // Do not parse following directories
54 extern char *gSysDir
[MAX_SYS_DIR
];
55 // Do not display files with those extensions
56 #define MAX_INVALID_EXT 1
57 extern char *gInvalidExt
[MAX_INVALID_EXT
];
59 // ---------------------------------------------------------------------------
61 struct SEnvironnement
: public IEasyCFG
64 sint32 MasterX
, MasterY
;
65 sint32 MasterTreeX
, MasterTreeY
;
66 sint32 MasterTreeCX
, MasterTreeCY
;
67 bool MasterTreeLocked
;
68 std::string ContinentsDir
;
69 std::string DefaultDFNDir
;
70 std::string DefaultGameElemDir
;
74 sint32 WorldEdX
, WorldEdY
, WorldEdCX
, WorldEdCY
;
78 sint32 GeorgesX
, GeorgesY
, GeorgesCX
, GeorgesCY
;
81 bool LogicEditorOpened
;
82 sint32 LogicEditorX
, LogicEditorY
, LogicEditorCX
, LogicEditorCY
;
85 SExportOptions ExportOptions
;
89 bool load (const std::string
&filename
);
90 bool save (const std::string
&filename
);
94 // ---------------------------------------------------------------------------
96 class CMasterCB
: public IMasterCB
98 CMainFrame
*_MainFrame
;
99 std::vector
<std::string
> _PrimZoneList
;
101 std::vector
<std::string
> _GroupPrimList
;
106 void setMainFrame (CMainFrame
*pMF
); // Link to master
109 std::vector
<std::string
> &getAllPrimZoneNames ();
112 // setAllPrimZoneNames : called when the list of patatoid changes
113 virtual void setAllPrimZoneNames (std::vector
<std::string
> &primZoneList
);
114 // transfert : called when WE want to transfert text to georges
115 virtual void multiTransfert (const std::vector
<std::string
> &vText
, bool append
);
116 virtual void transfert (const std::string
&sText
);
117 // Selection line up and down
118 virtual void lineUp ();
119 virtual void lineDown ();
122 // ---------------------------------------------------------------------------
124 class CMainFrame
: public CFrameWnd
126 SEnvironnement _Environnement
;
128 IWorldEditor
*_WorldEditor
;
129 HMODULE _WorldEditorModule
;
132 HMODULE _GeorgesModule
;
134 ILogicEditor
*_LogicEditor
;
135 HMODULE _LogicEditorModule
;
137 CMasterTreeDlg
*_Tree
;
139 std::string _ActivePath
;
142 std::string _MasterExeDir
;
145 CExportCBDlg
*_ExportCBDlg
;
150 virtual ~CMainFrame ();
152 void getAllInterfaces (); // Load all dlls and get tools interfaces
153 void releaseAllInterfaces ();
155 void openFile (const std::string
&fname
);
156 void openDir (const std::string
&fname
);
157 void openDirParse (const std::string
&sBaseName
, const std::string
&sRelativeName
);
159 void openContinentCfgFile (const std::string
&filename
);
165 void openWorldEditor ();
166 void openWorldEditorFile (const std::string
&fileName
);
167 void closeWorldEditor ();
174 void openGeorgesFile (const std::string
&fileName
);
175 void closeGeorges ();
177 void georgesSetPathesFromActive (); // Set Path from _ActiveContinent/_ActiveWorld/etc...
178 void georgesPutGroupText (const std::vector
<std::string
> &vText
, bool append
);
179 void georgesPutText (const std::string
&sText
);
180 void georgesLineUp ();
181 void georgesLineDown ();
182 void georgesCreatePlantName ();
188 void openLogicEditor ();
189 void openLogicEditorFile (const std::string
&fileName
);
190 void closeLogicEditor ();
196 // Tree and directories manipulation
198 bool createDirIfNotExist (const std::string
& dirName
, const std::string
& errorMsg
);
199 void deltree (const std::string
&dirName
);
200 void copytree (const std::string
&srcDir
, const std::string
&dstDir
);
201 void displayLastErrorDialog ();
207 void continentNew ();
209 void continentOpen (const std::string
&contName
);
210 void continentProperties (const std::string
&contName
);
211 void continentNewRegion (const std::string
&contName
);
212 void continentDelete (const std::string
&contName
);
215 void setActivePath (const std::string
&contName
);
216 std::string
getActivePath () { return _ActivePath
; }
221 void regionOpen (const std::string
&path
);
222 void regionRename (const std::string
&path
);
223 void regionNewPrim (const std::string
&path
);
224 void regionNewGeorges (const std::string
&path
);
225 void regionNewSubRegion (const std::string
&path
);
226 void regionDelete (const std::string
&path
);
231 void fileOpen (const std::string
&sFileFullName
);
232 void fileRename (const std::string
&sFileFullName
);
233 void fileDelete (const std::string
&sFileFullName
);
235 void copy (const std::string
&sPathSrc
, const std::string
&sPathDst
);
238 virtual void AssertValid () const;
239 virtual void Dump (CDumpContext
& dc
) const;
242 virtual BOOL
PreCreateWindow (CREATESTRUCT
& cs
);
243 virtual BOOL
PreTranslateMessage (MSG
*pMsg
);
247 afx_msg
void OnSize (UINT nType
, int cx
, int cy
);
248 afx_msg
void OnMove (int x
, int y
);
249 afx_msg
int OnCreate (LPCREATESTRUCT lpCreateStruct
);
250 afx_msg BOOL
OnEraseBkgnd (CDC
* pDC
);
256 afx_msg
void onContinentSave ();
257 afx_msg
void onContinentExport ();
259 afx_msg
void OnContinentDelete ();
261 afx_msg
void onOptionsTreeLock ();
262 afx_msg
void onOptionsSetContinentsDir ();
263 afx_msg
void onOptionsSetDefaultDFNDir ();
264 afx_msg
void onOptionsSetDefaultGameElemDir ();
267 afx_msg
void onWindowsWorldEditor ();
268 afx_msg
void onWindowsGeorges ();
269 afx_msg
void onWindowsLogicEditor ();
270 afx_msg
void onWindowsReset ();
272 afx_msg
void OnClose ();
273 // NOTE - the ClassWizard will add and remove member functions here.
274 // DO NOT EDIT what you see in these blocks of generated code!
276 DECLARE_MESSAGE_MAP()
281 /////////////////////////////////////////////////////////////////////////////
283 //{{AFX_INSERT_LOCATION}}
284 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
286 #endif // !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)