00001 #ifndef _SCREEN_MAP_EDITOR
00002 #define _SCREEN_MAP_EDITOR
00003
00004 #include "MercuryScreen.h"
00005 #include "MercuryText.h"
00006 #include "MercuryShapes.h"
00007 #include "MercuryLight.h"
00008 #include "MercuryCamera.h"
00009
00010 class TextList : public MercuryObject
00011 {
00012 public:
00013 ~TextList();
00014 virtual void Init();
00015 void SetupList( MVector< MString > & vsList );
00016 void UnsetupList();
00017 void Show();
00018 void Hide();
00019 CLASS_RTTI( TextList, MercuryObject );
00020 private:
00021 MercurySprite m_sBG;
00022 vector< MercuryText * > m_vTexts;
00023 };
00024
00026 class ObjectControlPane : public MercuryObject
00027 {
00028 public:
00029 void Init();
00030 void Update( const float dTime );
00031 void SetObject( MercuryObject * obj, int LX, int LY );
00032 void SetAttributes( const MString & sAttributes );
00033
00034 MercuryText m_tName;
00035 MercuryText m_tPosition;
00036 MercuryText m_tScale;
00037 MercuryText m_tRotation;
00038 MercuryText m_tAttributes;
00039
00040 MercuryShape m_sBackground;
00041 MercuryObject * m_objWatch;
00042 MercuryObject m_objMimic;
00043 CLASS_RTTI( ObjectControlPane, MercuryObject );
00044 };
00045
00047 class MercuryTextPrompt : public MercuryObject
00048 {
00049 public:
00050 virtual void Init();
00051 virtual void Update( const float dTime );
00052 virtual void Message( int Message, PStack & data, const MString & name );
00053 void PromptForText( int iMessageWhenDone, MercuryScreen * Notifier, const MString &sPrompt,
00054 const MString &sDefaultText, bool bAllowCancel = false, bool bSingleChar = false );
00055
00056
00057 MercurySprite m_sTextInOverlay;
00058 MercuryText m_tTextInOverlayPrompt;
00059 MercuryText m_tTextInOverlayText;
00060 bool m_bPromptingForText;
00061 bool m_bSingleChar;
00062 bool m_bAllowCancel;
00063 int m_iMessageWhenDone;
00064 MString m_sPromptedText;
00065 MercuryScreen * m_objNotify;
00066 CLASS_RTTI( MercuryTextPrompt, MercuryObject );
00067 };
00068
00070 class ScreenMapEditor : public MercuryScreen
00071 {
00072 public:
00073 ScreenMapEditor():MercuryScreen() { }
00074 ScreenMapEditor( const MString & name ):MercuryScreen( name ) { m_name = name; }
00075
00076 virtual ~ScreenMapEditor();
00077 virtual void Init();
00078 virtual void Update( const float dTime );
00079 virtual void Render();
00080 virtual void Message( int Message, PStack & data, const MString & name );
00081
00082 void LoadFile( const MString & sFilename );
00083 void LoadWorld( const MString & sFilename );
00084 void LoadObject( const MString & sFilename );
00085 void NotifyMessage( const MString & sMessage );
00086
00087 int GenerateObject( MString sObjectIn, int iPieceToReplace = -1 );
00088
00089 void ClearOutArea();
00090
00091 int SelectObject( int ObjectNumber = -1 );
00092 int GetNumObjects();
00093 int SelectedObject() { return m_iSelectedPart; }
00094 MercuryObject * GetSelectedHandleODE();
00095 MercuryObject * GetSelectedHandleVis();
00096 CLASS_RTTI( ScreenMapEditor, MercuryScreen );
00097 private:
00098 void SetIni( const MString & key, const MString & value, const MString & data );
00099 void RewriteCurrent();
00100 void MakeWorldPiece( int i, const MString & sWorldname, int iReplace = -1 );
00101 float CameraDistance();
00102
00103 MercuryLight m_light;
00104 MercuryObject m_fVisibles;
00105 MercuryObject m_fODEables;
00106 vector< MercuryObject * > m_vODEObjs;
00107 vector< MercuryObject * > m_vVisObjs;
00108
00109
00110
00111 vector< MercuryObject * > m_vLastODE;
00112 vector< MercuryObject * > m_vLastVis;
00113
00114 MercuryPoint m_pCameraPos;
00115 MercuryPoint m_pCameraRot;
00116 MQuaternion m_qCamera;
00117 MercuryCamera m_fCamera;
00118
00119 MercuryObject m_fOverlays;
00120
00121 MercuryText m_tMessage;
00122
00123 TextList m_tElems;
00124 bool m_bShowingElems;
00125
00126 ObjectControlPane m_pOverlay;
00127 MercuryTextPrompt m_pPrompt;
00128
00129 MString m_sFilename;
00130 MString m_sEditingName;
00131
00132 MercuryINI m_iWorldFile;
00133 MercuryINI m_iTightFile;
00134
00135 bool m_bFileLoaded;
00136 bool m_bWorldLoaded;
00137 bool m_bObjectLoaded;
00138
00139 MercuryObject * m_oSelectedPart;
00140
00141 int m_iSelectedPart;
00142 int m_iOldMouseX;
00143 int m_iOldMouseY;
00144 };
00145
00146 #endif
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174