128 lines
4.0 KiB
C++
128 lines
4.0 KiB
C++
|
|
/// 2010.11.17 - prodongi
|
|
|
|
#ifndef _SUIWorldAllMapWnd_h_
|
|
#define _SUIWorldAllMapWnd_h_
|
|
|
|
//#include "SUIWnd.h"
|
|
#include "SNPCResourceDB.h"
|
|
|
|
#define WORLDMAP_FIELD_NUM 16
|
|
#define WORLDMAP_VILLAGE_NUM 5 /// 작은 마을(현재는 론도 제외한 마을)
|
|
#define WORLDMAP_TOWN_NUM 1 /// 큰 마을(현재는 론도)
|
|
#define WORLDMAP_TOWN_DETAIL_NUM 4 /// 큰 마을 세부 맵(현재는 론도 세부 맵)
|
|
|
|
typedef std::vector<SNpcResourceDB::NPCRenderInfo> vecNpcInfo;
|
|
|
|
class SUIWorldAllMapWnd : public SUIWnd
|
|
{
|
|
public:
|
|
SUIWorldAllMapWnd( SGameManager* pGameManager );
|
|
virtual ~SUIWorldAllMapWnd();
|
|
|
|
virtual SUIWnd* CreateWnd( const char* szNUIFileName, KUIWndManager* pWndManager, KPoint kPos, int nWindowID = -1 );
|
|
virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam );
|
|
virtual bool InitControls( KPoint kPos );
|
|
virtual bool InitData( bool bReload = false );
|
|
virtual void OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd = true );
|
|
virtual void ProcMsgAtStatic( SGameMessage* pMsg );
|
|
|
|
void Process(DWORD dwTime, DWORD elapsedtime);
|
|
void setMousePos(int x, int y);
|
|
void getVillageWndWorldRect(int type, int index, KRect& worldRect);
|
|
void getFieldWndWorldRect(int index, KRect& worldRect); /// @brief 필드의 월드 좌표를 구한다
|
|
float getPlayerRadian() const { return m_playerRadian; } /// 2011.03.14 - prodongi
|
|
void convertWorldToUiPos(KPoint const& worldPos, KPoint& uiPos);
|
|
/// 2012.03.15 - prodongi
|
|
void createNpc(vecNpcInfo const& npcList);
|
|
|
|
protected:
|
|
void procPicking();
|
|
bool procPickingTownDetail();
|
|
bool procPickingTown();
|
|
bool procPickingVillage();
|
|
bool procPickingField();
|
|
void procFadeInOutField(DWORD elapsedtime);
|
|
void setFadeOutField(int field);
|
|
void delFadeOutField();
|
|
bool addFadeInField(int field);
|
|
bool delFadeInField(int field);
|
|
int colorToField(int color);
|
|
void resetFadeInOutField();
|
|
void showTownDetail(bool show);
|
|
void openFieldDetailMap();
|
|
void openVillageDetailMap(int type, int index);
|
|
void buttonClick(LPCSTR lpszControlID, DWORD lparam, DWORD wparam);
|
|
void setPlayerRealPos(int realX, int realY);
|
|
void refreshPlayerPos();
|
|
void convertUiToWorldRect(KRect& uiRect, KRect& worldRect); /// 2011.03.02 - prodongi
|
|
void setPlayerRotation(float radian); /// 2011.03.14 - prodongi
|
|
//void testKeyInput(WPARAM wParam); /// 2011.03.15 test 코드, 혹시 몰르니 남겨둔다 - prodongi
|
|
void MoveWorld(KPoint uiPos);
|
|
|
|
protected:
|
|
struct sFieldMaskInfo
|
|
{
|
|
sFieldMaskInfo() : m_data(NULL) {}
|
|
~sFieldMaskInfo() { SAFE_DELETE_ARRAY(m_data); }
|
|
void load();
|
|
int picking(int mouseX, int mouseY, KUIWnd const* basisWnd);
|
|
byte* m_data;
|
|
int m_pitch;
|
|
int m_width;
|
|
int m_height;
|
|
int m_dataSize;
|
|
};
|
|
struct sFadeInOutField
|
|
{
|
|
sFadeInOutField() : m_wnd(NULL), m_field(-1) {}
|
|
float calcS(DWORD elapsedtime);
|
|
virtual bool update(DWORD elapsedtime) = 0;
|
|
virtual float getAlphaV() const = 0;
|
|
bool operator == (int field) { return m_field == field; }
|
|
|
|
int m_field;
|
|
KUIWnd* m_wnd;
|
|
};
|
|
struct sFadeOutField : public sFadeInOutField
|
|
{
|
|
virtual float getAlphaV() const { return 10.0f; }
|
|
virtual bool update(DWORD elapsedtime);
|
|
};
|
|
struct sFadeInField : public sFadeInOutField
|
|
{
|
|
virtual float getAlphaV() const { return 3.0f; }
|
|
virtual bool update(DWORD elapsedtime);
|
|
};
|
|
struct sPickInfo
|
|
{
|
|
enum { VILLAGE, TOWN, TOWN_DETAIL, FIELD };
|
|
void clear() { m_index = -1; }
|
|
void set(int type, int index) { m_type = type; m_index = index; }
|
|
int m_type;
|
|
int m_index;
|
|
};
|
|
|
|
protected:
|
|
int m_mouseX;
|
|
int m_mouseY;
|
|
sFieldMaskInfo m_fieldMaskInfo;
|
|
int m_lastOverColor;
|
|
sPickInfo m_pickInfo;
|
|
sFadeOutField m_fadeOutField;
|
|
std::vector<sFadeInField> m_fadeInFieldList;
|
|
KUIWnd* m_fieldWnd[WORLDMAP_FIELD_NUM];
|
|
KUIWnd* m_villageWnd[WORLDMAP_VILLAGE_NUM];
|
|
KUIWnd* m_townWnd[WORLDMAP_TOWN_NUM];
|
|
KUIWnd* m_townDetailWnd[WORLDMAP_TOWN_DETAIL_NUM];
|
|
KUIWnd* m_playerWnd;
|
|
KUIWnd* m_rtWorldWnd;
|
|
KPoint m_playerRealPos;
|
|
float m_playerRadian; /// 플레이어가 이동 했을 때 저장된 각도이다(네이밍이 헷깔림,,)
|
|
bool m_bPointSign;
|
|
DWORD m_dwPlayerPointTime;
|
|
};
|
|
|
|
|
|
|
|
#endif |