275 lines
8.5 KiB
C++
275 lines
8.5 KiB
C++
#pragma once
|
|
|
|
//#include "SUIWnd.h"
|
|
#include "XMiniMap.h"
|
|
#include "KSmartPtr.h"
|
|
|
|
#include "SNPCResourceDB.h"
|
|
//#include "Util.h" /// 2011.06.02 - prodongi
|
|
|
|
typedef SNpcResourceDB::NPCRenderInfo NPC_INFO;
|
|
|
|
/// 2010.11.16 - prodongi
|
|
class SUIWorldAllMapWnd;
|
|
class SUIWorldDetailMapWnd;
|
|
|
|
#define WORLDMAP_TILEWIDTH 16128
|
|
#define WORLDMAP_TILEHEIGHT 16128
|
|
#define WORLDMAP_REALWIDTH (WORLDMAP_TILEWIDTH*14) //가로 14칸 : 던전 추가로 2증가
|
|
#define WORLDMAP_REALWIDTH_WITHOUT_DUNGEON (WORLDMAP_TILEWIDTH*12) //가로 12칸 : 던전 제외
|
|
#define WORLDMAP_REALHEIGHT (WORLDMAP_TILEWIDTH*10) //위에 6칸은 아직 존재 하지 않음
|
|
//만들어 지지 않은 맵 공간
|
|
#define WORLDMAP_EMPTYWIDTH (WORLDMAP_TILEWIDTH*5)
|
|
#define WORLDMAP_EMPTYHEIGHT (WORLDMAP_TILEWIDTH*2)
|
|
|
|
class SUIDisplayInfo;
|
|
struct sMonsterRegionInfo; /// 2011.08.30 - prodongi
|
|
|
|
/// 2010.11.25 - prodongi
|
|
/*
|
|
/// 지역 정보 표시
|
|
class SUILocalSignWnd : public SUIWnd
|
|
{
|
|
public:
|
|
SUILocalSignWnd( SGameManager* pGameManager )
|
|
: SUIWnd( pGameManager )
|
|
{
|
|
m_dwTime = 0;
|
|
m_dwStartTime = 0;
|
|
}
|
|
|
|
void SetLocalTitle( const char * pString, DWORD dwTime );
|
|
|
|
virtual bool InitControls( KPoint kPos );
|
|
virtual bool InitData( bool bReload = false );
|
|
virtual void Process(DWORD dwTime);
|
|
#ifdef _KUI_INVALIDATION
|
|
// { [sonador]
|
|
virtual void Render( KViewportObject* pViewport, bool isFront );
|
|
// }
|
|
#endif
|
|
|
|
private:
|
|
DWORD m_dwTime;
|
|
DWORD m_dwStartTime;
|
|
};
|
|
*/
|
|
|
|
DECL_SPTR(K3DTexture)
|
|
|
|
#define WORLDSIGNTIME 300
|
|
/// 월드 맵
|
|
class SUIWorldMapWnd : public SUIWnd
|
|
{
|
|
public:
|
|
SUIWorldMapWnd( SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo );
|
|
virtual ~SUIWorldMapWnd();
|
|
|
|
static void SetRenderDevice( class K3DRenderDeviceDX * pDevice );
|
|
|
|
virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam );
|
|
virtual void ProcMsgAtStatic( SGameMessage* pMsg );
|
|
virtual bool InitControls( KPoint kPos );
|
|
virtual bool InitData( bool bReload = false );
|
|
virtual void OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd = true );
|
|
virtual void Process(DWORD dwTime);
|
|
virtual SUIWnd* CreateWnd( const char* szNUIFileName, KUIWndManager* pWndManager, KPoint kPos, int nWindowID = -1 );
|
|
|
|
void readyOpenDetailMap(int type, int index, bool aniAlpha = true, KRect const& worldRect = KRect());
|
|
void readyCloseDetailMap();
|
|
bool checkVisibleIsInRegionPlayer(KRect const& rect) const; /// 2011.03.17 플레이어가 panel_player_area에 있는지 검사 - prodongi
|
|
//void refreshNpcPos(KRect const& offset); /// 2011.03.15 test 코드, 혹시 몰르니 남겨둔다 - prodongi
|
|
void readyOpenTownDetailMap(int index) { m_readyOpenTownDetailMap = index; }
|
|
void readyOpenFieldDetailMap(int index) { m_readyOpenFieldDetailMap = index; } /// 2011.06.02 - prodongi
|
|
void readyOpenVillageDetailMap(int index) { m_readyOpenVillageDetailMap = index; }
|
|
bool isDetailMapShow() const { return m_detailMapWnd != NULL; }
|
|
|
|
static void convertUiToWorldPos(KPoint const& uiPos, KPoint& worldPos, KRect const& uiRect, KPoint const& worldSize, int emptyWidth = WORLDMAP_EMPTYWIDTH, int emptyHeight = WORLDMAP_EMPTYHEIGHT);
|
|
static void convertWorldToUiPos(KPoint const& worldPos, KPoint& uiPos, KRect const& uiRect, KPoint const& worldSize, int emptyWidth = WORLDMAP_EMPTYWIDTH, int emptyHeight = WORLDMAP_EMPTYHEIGHT);
|
|
|
|
virtual void OnDeviceLost();
|
|
void addRemoveWndList(KUIWnd* wnd);
|
|
|
|
/// 2011.08.30 - prodongi
|
|
void convertWorldToUiPos(KPoint const& worldPos, KPoint& uiPos);
|
|
KUIWnd* createMonsterRegionControl(KRect const& r, float theta);
|
|
/// 2011.09.20 npc의 ui 좌표를 구해온다
|
|
bool getQuestMarkNpcUIRect(int npcId, KRect& r);
|
|
KUIWnd* createQuestMarkNpcControl(char const* id);
|
|
/// 2011.10.28 디테일 맵의 npc 아이콘은 완료 아이콘으로 바꾼다. - prodongi
|
|
void changeNpcIconToFinish(std::vector<int> const& npcList);
|
|
/// 2011.10.28 디테일 맵의 npc 아이콘은 원래의 아이콘으로 복구한다. - prodongi
|
|
void restoreNpcIconToOriginal(std::vector<int> const& npcList);
|
|
bool convertInvalidMonsterRegion(KRect const& r, KRect& convertR);
|
|
|
|
private:
|
|
void createSubWnd(KUIWndManager* pWndManager);
|
|
void closeDetailMap(bool refreshMonsterRegion = true);
|
|
void procRemoveWndList();
|
|
void openDetailMap();
|
|
|
|
SUIDisplayInfo* m_pDisplayInfo;
|
|
|
|
std::string GetWorldMapName( int nX, int nY );
|
|
K3DTexture * GetWorldMapTexture( const char * pTexName );
|
|
|
|
void LoadNPCInfoFile();
|
|
|
|
void ConvertWorldY( const int nY, int & nOutY );
|
|
|
|
bool TranslatePosition( int * nPosX, int * nPosY );
|
|
|
|
bool GetZoomTypePos( int nX, int nY, int& nOutX, int& nOutY );
|
|
|
|
void MovePlayer( int nX, int nY );
|
|
void ResizeControls();
|
|
|
|
void RefreshNPC();
|
|
void RefreshPlayerPos();
|
|
|
|
void HidePartyIcon();
|
|
void RefreshPartyPlayerPos();
|
|
|
|
void RefreshZoomWorldMap();
|
|
|
|
void zoomin();
|
|
void zoomout();
|
|
|
|
bool IsRenderNPC( ENC_INT id );
|
|
// 2010.09.28 - prodongi
|
|
void showAreaText(bool show);
|
|
/// 2011.06.02 - prodongi
|
|
void setShowCategory(bool show, bool directHide = false);
|
|
void updateShowCategory(DWORD elapsedtime);
|
|
|
|
void loadDungeonGateInfo(); /// 2011.07.21 pqf파일에서 던전 입구 프랍 정보를 얻어 온다- prodongi
|
|
bool getSeamlessWorldInfo(int& segmentCountPerMap, int& tileCountPerSegment, float& tileLength);
|
|
void getQuestPropDBId(int x, int y, int segmentCountPerMap, int tileCountPerSegment, float tileLength);
|
|
void addDungeonGateInfo(int propDBId, float x, float y);
|
|
template <typename T> void readQuestPropList(KStream* stream, int propCount, K3DPoint const& segmentOrigin)
|
|
{
|
|
T* prop = new T[propCount];
|
|
stream->Read(prop, sizeof (T) * propCount);
|
|
for (int i = 0; i < propCount; ++i)
|
|
{
|
|
float x = segmentOrigin.x + prop[i].x;
|
|
float y = segmentOrigin.y + prop[i].y;
|
|
|
|
addDungeonGateInfo(prop[i].nQuestDBID, x, y);
|
|
}
|
|
SAFE_DELETE_ARRAY(prop);
|
|
}
|
|
|
|
void procMonsterRegion(DWORD dwTime); /// 2011.10.28 - prodongi
|
|
void setQuestCode(int questCode);
|
|
|
|
// 젠위드 리사이즈 관련 =============================
|
|
KRect m_rtMaxWnd;
|
|
KRect m_rtMinWnd;
|
|
|
|
KRect m_rtWorld;
|
|
|
|
bool m_bMaxSize;
|
|
bool m_bZoomIn;
|
|
|
|
// 캐릭의 실제 좌표 ==================================
|
|
int m_nPlayerRealPosX;
|
|
int m_nPlayerRealPosY;
|
|
|
|
// 캐릭이 위치하는 맵 위치(0,0)/(2,2).....
|
|
int m_nMapPosX;
|
|
int m_nMapPosY;
|
|
|
|
std::vector<NPC_INFO> m_vecNPCInfoList;
|
|
|
|
float m_fMapLen; ///< 맵 한면의 길이
|
|
|
|
float m_fZoomType;
|
|
|
|
static K3DRenderDeviceDX* s_pDevice;
|
|
K3DTextureSPtr m_spMiniMapTexture;
|
|
std::vector< K3DTextureSPtr> m_vtLoadedMapTexture;
|
|
XSmoothMiniMap m_MiniMap;
|
|
|
|
bool m_bMapChange;
|
|
float m_fRatioX;
|
|
float m_fRatioY;
|
|
|
|
int m_zoom_map_type;
|
|
int m_display_positoin_x;
|
|
int m_display_positoin_y;
|
|
int m_zoom_x;
|
|
int m_offset_x;
|
|
int m_offset_y;
|
|
int m_size_x;
|
|
int m_size_y;
|
|
std::string m_strBlank_resource;
|
|
int m_blank_a;
|
|
int m_blank_r;
|
|
int m_blank_g;
|
|
int m_blank_b;
|
|
|
|
SUIWorldAllMapWnd* m_allMapWnd;
|
|
SUIWorldDetailMapWnd* m_detailMapWnd;
|
|
KUIWnd* m_playerAreaWnd;
|
|
SUIWnd* m_categoryWnd; /// 2011.03.02 - prodongi
|
|
bool m_readyCloseDetailMap;
|
|
int m_readyOpenTownDetailMap;
|
|
std::vector<NPC_INFO> m_npcList;
|
|
DWORD m_lastTime;
|
|
std::vector<KUIWnd*> m_removeWndList; /// 2011.03.03 - prodongi
|
|
int m_readyOpenFieldDetailMap;
|
|
int m_readyOpenVillageDetailMap;
|
|
sUpdateTime<float> m_updateCategoryShow; /// 2011.06.02 - prodongi
|
|
bool m_isAlphaHideCategory; /// 2011.06.07 사라질 때는 fadeout으로 사라지게 설정 - prodongi
|
|
|
|
bool m_bPointSign;
|
|
DWORD m_dwPlayerPointTime;
|
|
|
|
/// 2011.03.03 - prodongi
|
|
struct sOpenDetailMapInfo
|
|
{
|
|
sOpenDetailMapInfo() : m_is(false) {}
|
|
bool m_is;
|
|
int m_type;
|
|
int m_index;
|
|
bool m_aniAlpha;
|
|
KRect m_worldRect;
|
|
};
|
|
sOpenDetailMapInfo m_openDetailMapInfo;
|
|
sMonsterRegionInfo* m_monsterRegionInfo; /// 2011.08.30 - prodongi
|
|
|
|
public:
|
|
/// 2011.07.21 - prodongi
|
|
struct sDungeonGateInfo
|
|
{
|
|
sDungeonGateInfo() : m_id(0), m_x(0), m_y(0) {}
|
|
sDungeonGateInfo(int id, float x, float y) : m_id(id), m_x(x), m_y(y) {}
|
|
|
|
int m_id;
|
|
int m_x;
|
|
int m_y;
|
|
};
|
|
std::vector<sDungeonGateInfo> m_dungeonGateInfoList;
|
|
|
|
/// 2011.09.30 퀘스트 목표가 전체 몬스터일 경우에 출력 - prodongi
|
|
struct sNoTargetTitle
|
|
{
|
|
enum STATE { SHOW, FADE_IN, END };
|
|
void init(SUIWnd* parent);
|
|
void update(DWORD elapsedtime);
|
|
void check(int questCode);
|
|
void setState(int state);
|
|
void setTop(SUIWnd* parent);
|
|
|
|
KUIWnd* m_wnd;
|
|
float m_updateTime;
|
|
float m_totalTime;
|
|
float m_alpha;
|
|
int m_state;
|
|
};
|
|
sNoTargetTitle m_noTargetTitle;
|
|
bool m_needApplyMonterRegionInfo;
|
|
bool m_needRefreshMonterRegionInfo;
|
|
};
|