/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.12.02 * ³» ¿ë : ¸®Á¨Åø ºä * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Npc.h" #include "Monster.h" #include "Portal.h" #include "Gathering.h" #include "Pattern.h" #include "Door.h" class cMapDialog; class cNpcDialog; class cMonsterDialog; class cPortalDialog; class cGatheringDialog; class cPatternDialog; class cDoorDialog; class cCircleLines; class cApplication; class cCamera; class cFreeCamera; class cNaviMesh; class cNaviField; class cSceneNode; class cNpcSceneNode; class cMonsterSceneNode; class cMonsterGroup; class cPortalSceneNode; class cGatheringSceneNode; class cPathFinder; struct sMapInfo { unsigned int mapIdx; unsigned int mapfolerIdx; tList degreeInfo; sMapInfo() { mapIdx = 0; mapfolerIdx = 0; degreeInfo.Clear(); } ~sMapInfo() { degreeInfo.Clear(); } }; /// ÆíÁý ¸ðµå //enum eEditMode //{ // eEDIT_NULL = -1, // eEDIT_NPC = 0, // eEDIT_PORTAL, // eEDIT_MONSTER, // eEDIT_MAX_MODES //}; /// ¸®Á¨Åø ºä class cRegenToolView : public CView { static cRegenToolView* mSingleton; DECLARE_DYNCREATE( cRegenToolView ) public: cRegenToolView(); virtual ~cRegenToolView(); /// Áö¿ò void Clear(); /// ÃʱâÈ­ void Init(); /// °»½Å void Update(); /// È­¸é Å©±â void Resize( unsigned int width, unsigned int height ); /// ·»´õ¸µ void RenderLines(); /// ·Îµù bool LoadMapInfo(); bool LoadMapNameList(); bool LoadModelFileList(); bool LoadNpcNameList(); bool LoadNpcList(); bool LoadMonsterNameList(); bool LoadMonsterList(); bool LoadMap( unsigned int mapIndex, unsigned int mapfolderIdx, unsigned int mapDegree ); bool LoadNpcRegen( unsigned int mapIndex, unsigned int mapDegree ); bool LoadMonsterRegen( unsigned int mapIndex, unsigned int mapDegree ); bool LoadPortalRegen(); bool LoadGatheringNameList(); bool LoadGatheringList(); bool LoadGatheringRegen( unsigned int mapIndex, unsigned int mapDegree ); bool LoadPattern( unsigned int mapIndex, unsigned int mapDegree ); bool LoadDoorRegen(); /// ´ÙÀ̾ó·Î±× void SetMapDialog( cMapDialog* dlg ); void SetNpcDialog( cNpcDialog* dlg ); void SetMonsterDialog( cMonsterDialog* dlg ); void SetPortalDialog( cPortalDialog* dlg ); void SetGatheringDialog( cGatheringDialog* dlg ); void SetPatternDialog( cPatternDialog* dlg ); void SetDoorDialog( cDoorDialog* dlg ); /// ÆíÁý ¸ðµå //void SetEditMode( eEditMode mode ); //eEditMode GetEditMode() const; /// Ä«¸Þ¶ó void SetCamFarDistance( float farDist ); float GetCamFarDistance() const; void ZoomPersp(); void ZoomOrtho(); /// ¼±Åà ³ëµå void SelectNode( cSceneNode* node, bool updateView = true ); void DeleteSel(); void SetSelTranslate( NiPoint3 trans, bool updateDialog = false ); void SetSelRotate( float zangle, bool updateDialog = false ); void SetSelAppendZ( float appendZ, bool updateDialog = false ); void SetSelDoorInfo( float Twidth, float Bwidth, float LHeight, float RHeight ); void SetSelDoorAppendY( float appendY ); void SetSelPotalNameHeight( float nameHeight ); cSceneNode* GetSelNode() const; NiPoint3 GetSelTranslate() const; float GetSelRotate() const; float GetSelAppendZ() const; /// ¸Ê unsigned long GetCurrentMapIndex() { return mMapIndex; } const cString& GetMapName( unsigned int mapIdx ); /// ¸ðµ¨ ÆÄÀÏ const cString& GetModelFile( unsigned int modelIndex ) const; /// Npc bool SaveNpcRegen(); int CreateNpc( unsigned int index, float x, float y, float zdegree, bool updateDialog, bool updateView ); int ChangeNpc( unsigned int index ); int DeleteNpc( cNpcSceneNode* node ); void SelectNpc( cNpcSceneNode* node ); const cNpcInfo* GetNpcInfo( unsigned int index ) const; const cString& GetNpcNameByNameIndex( unsigned int nameIndex ) const; const cString& GetNpcNameByNpcIndex( unsigned int npcIndex ) const; /// ¸ó½ºÅÍ bool SaveMonsterRegen(); int CreateMonsterGroup( unsigned int index ); int DeleteMonsterGroup( unsigned int index ); void SelectMonsterGroup( cMonsterGroup* group ); int CreateMonster( unsigned int index, unsigned int x, unsigned int y, int zdegree, unsigned int regenWaitTime, unsigned int regenLifeTime, bool updateDialog, bool updateView, unsigned long regenFamilyNum, unsigned long patternIdx ); int ChangeMonster( unsigned int index ); int DeleteMonster( cMonsterSceneNode* node ); void SelectMonster( cMonsterSceneNode* node ); const cMonsterInfo* GetMonsterInfo( unsigned int index ) const; const cString& GetMonsterNameByNameIndex( unsigned int nameIndex ) const; const cString& GetMonsterNameByMonIndex( unsigned int monIndex ) const; void AddFamilyGroup( unsigned long familyIdx, tHashSet* pSet ) { mMonsterFamilyMap.Insert( familyIdx, pSet ); } /// Æ÷Å» bool SavePortalRegen(); int CreatePortal( unsigned int index, const char* potalName, float x, float y, unsigned int range, unsigned int targetIndex, int zdegree, float nameHeight, bool isCreated, bool updateDialog, bool updateView ); int DeletePortal( cPortalSceneNode* node ); void SelectPortal( cPortalSceneNode* node ); cPortalInfo* GetPortalInfo( unsigned int index ) const; /// äÁý bool SaveGatheringRegen(); int CreateGatheringGroup( unsigned int index ); int DeleteGatheringGroup( unsigned int index ); void SelectGatheringGroup( cGatheringGroup* group ); int CreateGathering( unsigned int index, unsigned int x, unsigned int y, int zdegree, float appandZ, bool updateDialog, bool updateView ); int ChangeGathering( unsigned int index ); int DeleteGathering( cGatheringSceneNode* node ); void SelectGathering( cGatheringSceneNode* node ); const cGatheringInfo* GetGatheringInfo( unsigned int index ) const; const cString& GetGatheringNameByNameIndex( unsigned int nameIndex ) const; const cString& GetGatheringNameByGatherIndex( unsigned int gatherIndex ) const; /// ÆÐÅÏ int CreatePattern( unsigned long patternIdx ); int DeletePattern( unsigned long patternIdx ); void SelectPattern( unsigned int patternIdx ); /// ÇöÀç ¼±ÅÃµÈ ÆÐÅϱ׷쿡 ÆÐÅÏ »ðÀÔ cPatternSceneNode* AddPatternPos( unsigned long patternIdx, NiPoint3 pos, unsigned long range = 0, bool relaxPoint = 0, unsigned long waitTime = 0 ); // void AddPatternPosByLoad( unsigned long patternIdx, NiPoint3 pos, unsigned long range = 0, bool relaxPoint = 0, unsigned long waitTime = 0 ); void LoadPatternPos(); int DeletePatternPos( cPatternSceneNode* node ); void SelectPatternPos( cPatternSceneNode* node ); void ModifyPatternPos( NiPoint3 pos ); void UpdatePatternCombo(); bool SavePattern(); /// int CreateDoor( unsigned int index, const char* fileName, NiPoint2 pos, float appendZ, int zdegree, float* rectWidth, float* rectHeight, float rectAppendY, bool updateDialog, bool updateView ); int DeleteDoor( cDoorSceneNode* node ); void SelectDoor( cDoorSceneNode* node ); cDoorInfo* GetDoorInfo( unsigned int index ) const; bool SaveDoorRegen(); cPathFinder* GetPathFinder() { return mPathFinder; } protected: BOOL PreCreateWindow( CREATESTRUCT& cs ); void OnDraw( CDC* dc ); public: #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump( CDumpContext& dc ) const; #endif protected: afx_msg int OnCreate( LPCREATESTRUCT cs ); afx_msg void OnDestroy(); afx_msg BOOL OnEraseBkgnd(CDC* dc); afx_msg void OnSize( UINT type, int cx, int cy ); afx_msg void OnTimer( UINT_PTR nIDEvent ); afx_msg void OnMouseMove( UINT flags, CPoint point ); afx_msg BOOL OnMouseWheel( UINT flags, short zdelta, CPoint point ); afx_msg void OnLButtonDown( UINT flags, CPoint point ); afx_msg void OnLButtonUp( UINT flags, CPoint point ); afx_msg void OnRButtonDown( UINT flags, CPoint point ); afx_msg void OnRButtonUp( UINT flags, CPoint point ); afx_msg void OnMButtonDown( UINT flags, CPoint point ); afx_msg void OnMButtonUp( UINT flags, CPoint point ); afx_msg void OnKeyDown(UINT c, UINT repeats, UINT flags); afx_msg void OnKeyUp(UINT c, UINT repeats, UINT flags); DECLARE_MESSAGE_MAP() public: /// ´ÜÀÏü¸¦ ¸®ÅÏ static cRegenToolView* GetSingleton(); private: /// ¾îÇø®ÄÉÀÌ¼Ç cApplication* mApplication; /// ³×ºñ¸Þ½Ã cNaviMesh* mNaviMesh; /// ³×ºñÇʵå cNaviField* mNaviField; /// ´ÙÀ̾ó·Î±× cMapDialog* mMapDialog; cNpcDialog* mNpcDialog; cMonsterDialog* mMonsterDialog; cPortalDialog* mPortalDialog; cGatheringDialog* mGatheringDialog; cPatternDialog* mPatternDialog; cDoorDialog* mDoorDialog; /// ÆíÁý ¸ðµå //eEditMode mEditMode; /// Ä«¸Þ¶ó cFreeCamera* mCamera; /// ¸ðµ¨ cString mErrorModelFile; typedef tMap cModelFileMap; cModelFileMap mModelFileMap; /// ¸Ê unsigned int mMapIndex; unsigned int mMapDegree; typedef tMap cMapNameMap; cMapNameMap mMapNameMap; typedef tMap cMapInfoMap; cMapInfoMap mMapInfoMap; /// Npc cString mErrorNpcName; typedef tMap cNpcNameMap; cNpcNameMap mNpcNameMap; typedef tMap cNpcInfoMap; cNpcInfoMap mNpcInfoMap; typedef tMap cNpcNodeMap; cNpcNodeMap mNpcNodeMap; unsigned long mNpcListIdx; /// ¸ó½ºÅÍ cMonsterGroup* mSelMonsterGroup; cString mErrorMonsterName; typedef tMap cMonsterNameMap; cMonsterNameMap mMonsterNameMap; typedef tMap cMonsterInfoMap; cMonsterInfoMap mMonsterInfoMap; typedef tMap cMonsterGroupMap; cMonsterGroupMap mMonsterGroupMap; typedef tHashSet cHashSet; typedef tMap cMonsterFamilyMap; cMonsterFamilyMap mMonsterFamilyMap; typedef tList cMonsterList; /// äÁý °´Ã¼ cGatheringGroup* mSelGatheringGroup; cString mErrorGatheringName; typedef tMap cGatheringNameMap; cGatheringNameMap mGatheringNameMap; typedef tMap cGatheringInfoMap; cGatheringInfoMap mGatheringInfoMap; typedef tMap cGatheringGroupMap; cGatheringGroupMap mGatheringGroupMap; typedef tList cGatheringList; /// Æ÷Å» typedef tMap cPortalInfoMap; cPortalInfoMap mPortalInfoMap; /// ÆÐÅÏ typedef tPointerHashMap cPatternMap; cPatternMap mPatternMap; cPattern* mSelPattern; /// °ÔÀÌÆ® typedef tMap cDoorInfoMap; cDoorInfoMap mDoorInfoMap; cMonsterSceneNode* mDummyNode; /// ¸¶¿ì½º ÁÂÇ¥ CPoint mMousePos; /// ÇÈÅ·µÈ Àå¸é ³ëµå ¹è¿­ typedef tArray cPickedArray; cPickedArray mPickedArray; /// ¼±ÅÃµÈ ³ëµå cSceneNode* mSelNode; cCircleLines* mSelLines; cCircleLines* mGroupLines; /// ±æÃ£±â cPathFinder* mPathFinder; }; inline void cRegenToolView::SetMapDialog( cMapDialog* dlg ) { assert( dlg ); mMapDialog = dlg; } inline void cRegenToolView::SetNpcDialog( cNpcDialog* dlg ) { assert( dlg ); mNpcDialog = dlg; } inline void cRegenToolView::SetMonsterDialog( cMonsterDialog* dlg ) { assert( dlg ); mMonsterDialog = dlg; } inline void cRegenToolView::SetPortalDialog( cPortalDialog* dlg ) { assert( dlg ); mPortalDialog = dlg; } inline void cRegenToolView::SetGatheringDialog( cGatheringDialog* dlg ) { assert( dlg ); mGatheringDialog = dlg; } inline void cRegenToolView::SetPatternDialog( cPatternDialog* dlg ) { assert( dlg ); mPatternDialog = dlg; } inline void cRegenToolView::SetDoorDialog( cDoorDialog* dlg ) { assert( dlg ); mDoorDialog = dlg; } inline cSceneNode* cRegenToolView::GetSelNode() const { return mSelNode; } //inline //eEditMode cRegenToolView::GetEditMode() const //{ // return mEditMode; //} // //inline //cFreeCamera* cRegenToolView::GetDefaultCamera() const //{ // return mCamera; //} inline cRegenToolView* cRegenToolView::GetSingleton() { return mSingleton; } #define VIEW cRegenToolView::GetSingleton()