Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
875
GameTools/NeoRylClient/AkhanChrCreate.cpp
Normal file
875
GameTools/NeoRylClient/AkhanChrCreate.cpp
Normal file
@@ -0,0 +1,875 @@
|
||||
// AkhanChrCreate.cpp: implementation of the CAkhanChrCreate class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "FrameTimer.h"
|
||||
#include "AkhanChrCreate.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "AkhanGUI.h"
|
||||
#include "Item\ItemMgr.h"
|
||||
#include "GUIMessageBoxManager.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanChrCreate::CAkhanChrCreate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAkhanChrCreate::~CAkhanChrCreate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CAkhanChrCreate::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22, 37, 0, 0, 226, 256, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22, 293, 0, 0, 226, 249, g_ClientMain.m_lpInterface->m_lstTexture[4]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(549, 37, 0, 0, 227, 256, g_ClientMain.m_lpInterface->m_lstTexture[6]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(549, 293, 0, 0, 227, 249, g_ClientMain.m_lpInterface->m_lstTexture[7]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// +1 / Lv UP
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22 + 186, 37 + 297, 155, 212, 185, 241, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22 + 186, 37 + 332, 155, 212, 185, 241, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22 + 186, 37 + 367, 155, 212, 185, 241, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22 + 186, 37 + 402, 155, 212, 185, 241, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(22 + 186, 37 + 436, 155, 212, 185, 241, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
// 머리스타일
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(123, 134, 0, 32, 32, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(123, 134, 32, 32, 64, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(123, 134, 64, 32, 96, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(168, 134, 96, 32, 128, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(168, 134, 128, 32, 160, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(168, 134, 160, 32, 192, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 얼굴타입
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(123, 191, 0, 32, 32, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(123, 191, 32, 32, 64, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(123, 191, 64, 32, 96, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(168, 191, 96, 32, 128, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(168, 191, 128, 32, 160, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(168, 191, 160, 32, 192, 64, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// STR
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(129, 298, 192, 0, 216, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(129, 298, 192, 24, 216, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(129, 298, 192, 48, 216, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(158, 298, 216, 0, 240, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(158, 298, 216, 24, 240, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(158, 298, 216, 48, 240, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// DEX
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(129, 333, 192, 0, 216, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(129, 333, 192, 24, 216, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(129, 333, 192, 48, 216, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(158, 333, 216, 0, 240, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(158, 333, 216, 24, 240, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(158, 333, 216, 48, 240, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// CON
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(129, 368, 192, 0, 216, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(129, 368, 192, 24, 216, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(129, 368, 192, 48, 216, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(158, 368, 216, 0, 240, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(158, 368, 216, 24, 240, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(158, 368, 216, 48, 240, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// INT
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(129, 403, 192, 0, 216, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(129, 403, 192, 24, 216, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(129, 403, 192, 48, 216, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(158, 403, 216, 0, 240, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(158, 403, 216, 24, 240, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(158, 403, 216, 48, 240, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// WIS
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(129, 437, 192, 0, 216, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(129, 437, 192, 24, 216, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(129, 437, 192, 48, 216, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(158, 437, 216, 0, 240, 24, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(158, 437, 216, 24, 240, 48, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(158, 437, 216, 48, 240, 72, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(22, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 클래스
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_CHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(18, 133, 0, 0, 192, 33, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(18, 133, 0, 132, 192, 165, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(18, 133, 0, 33, 192, 66, g_ClientMain.m_lpInterface->m_lstTexture[9]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[541]);
|
||||
lpButton->m_lpTooltip->SetAlign(DT_LEFT);
|
||||
lpButton->SetMove(549, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_CHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(18, 168, 0, 33, 192, 66, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(18, 168, 0, 165, 192, 198, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(18, 168, 0, 66, 192, 99, g_ClientMain.m_lpInterface->m_lstTexture[9]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[542]);
|
||||
lpButton->m_lpTooltip->SetAlign(DT_LEFT);
|
||||
lpButton->SetMove(549, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 만들기 / 취소
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(26, 428, 0, 64, 86, 101, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(26, 428, 0, 101, 86, 138, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(26, 428, 0, 138, 86, 175, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(549, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(122, 428, 86, 64, 172, 101, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(122, 428, 86, 101, 172, 138, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(122, 428, 86, 138, 172, 175, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(549, 37);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 카메라 돌기
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(294, 502, 0, 213, 51, 256, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(294, 502, 51, 213, 102, 256, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(294, 502, 102, 213, 153, 256, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(0, 0);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(454, 502, 172, 72, 223, 115, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(454, 502, 172, 115, 223, 158, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(454, 502, 172, 158, 223, 201, g_ClientMain.m_lpInterface->m_lstTexture[5]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(0, 0);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x; m_rcWindowSize.bottom = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x; m_rcMoveEdge.bottom = y;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanChrCreate::InitValue(void)
|
||||
{
|
||||
m_dwStr = 20;
|
||||
m_dwDex = 20;
|
||||
m_dwCon = 20;
|
||||
m_dwInt = 20;
|
||||
m_dwWis = 20;
|
||||
m_dwIP = 5;
|
||||
m_wClass = 17;
|
||||
m_dwSex = 1;
|
||||
m_dwFace = 1;
|
||||
m_dwHair = 1;
|
||||
g_TextEdit.SetFocus();
|
||||
g_TextEdit.SetEditLength(15);
|
||||
m_dwEndTimer = 0xFFFFFFFF;
|
||||
g_ClientMain.m_bCreateChar = FALSE;
|
||||
|
||||
m_ButtonManager.m_lstButton[14]->m_nState = BUTTON_HOLD;
|
||||
m_ButtonManager.m_lstButton[15]->m_nState = BUTTON_NONE;
|
||||
|
||||
/* g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr].m_lpChrModel->BeginOutfitSetting();
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr].m_lpChrModel->SetOutfitSlot("BODY", g_ItemMgr.GetEquipName(m_dwShirt + 201));
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr].m_lpChrModel->EndOutfitSetting();*/
|
||||
}
|
||||
|
||||
BOOL CAkhanChrCreate::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF)
|
||||
{
|
||||
if(CFrameTimer::GetUpdateTimer(m_dwEndTimer) >= 1.0f)
|
||||
{
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITSELECT;
|
||||
g_ClientMain.m_bCreateChar = FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_bCreateChar)
|
||||
{
|
||||
if(g_ClientMain.m_Network.GetState() == NS_NOWAITING)
|
||||
{
|
||||
if(!g_ClientMain.m_Network.GetError())
|
||||
{
|
||||
CreateCancel();
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_bCreateChar = FALSE;
|
||||
g_TextEdit.InitMessage();
|
||||
g_TextEdit.SetFocus();
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
g_MessageBoxManager.Update();
|
||||
|
||||
if(m_ButtonManager.m_lstButton[14]->m_nState == BUTTON_OFF)
|
||||
m_ButtonManager.m_lstButton[14]->m_nState = BUTTON_CLICK;
|
||||
if(m_ButtonManager.m_lstButton[15]->m_nState == BUTTON_OFF)
|
||||
m_ButtonManager.m_lstButton[15]->m_nState = BUTTON_CLICK;
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwHair++;
|
||||
if(m_dwHair > 7) m_dwHair = 1;
|
||||
char Temp[10];
|
||||
sprintf(Temp, "HAIR%02d", m_dwHair);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetStaticSlot("HAIR", Temp);
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwHair--;
|
||||
if(m_dwHair < 1) m_dwHair = 7;
|
||||
char Temp[10];
|
||||
sprintf(Temp, "HAIR%02d", m_dwHair);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetStaticSlot("HAIR", Temp);
|
||||
} else if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwFace++;
|
||||
if(m_dwFace > 7) m_dwFace = 1;
|
||||
char Temp[10];
|
||||
sprintf(Temp, "FACE%02d", m_dwFace);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetStaticSlot("FACE", Temp);
|
||||
} else if(m_ButtonManager.m_lstButton[3]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwFace--;
|
||||
if(m_dwFace < 1) m_dwFace = 7;
|
||||
char Temp[10];
|
||||
sprintf(Temp, "FACE%02d", m_dwFace);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetStaticSlot("FACE", Temp);
|
||||
} else if(m_ButtonManager.m_lstButton[4]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwIP)
|
||||
{
|
||||
m_dwStr++;
|
||||
m_dwIP--;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwStr > 20)
|
||||
{
|
||||
m_dwStr--;
|
||||
m_dwIP++;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwIP)
|
||||
{
|
||||
m_dwDex++;
|
||||
m_dwIP--;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[7]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwDex > 20)
|
||||
{
|
||||
m_dwDex--;
|
||||
m_dwIP++;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[8]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwIP)
|
||||
{
|
||||
m_dwCon++;
|
||||
m_dwIP--;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[9]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwCon > 20)
|
||||
{
|
||||
m_dwCon--;
|
||||
m_dwIP++;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[10]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwIP)
|
||||
{
|
||||
m_dwInt++;
|
||||
m_dwIP--;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[11]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwInt > 20)
|
||||
{
|
||||
m_dwInt--;
|
||||
m_dwIP++;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[12]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwIP)
|
||||
{
|
||||
m_dwWis++;
|
||||
m_dwIP--;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[13]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_dwWis > 20)
|
||||
{
|
||||
m_dwWis--;
|
||||
m_dwIP++;
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[14]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_wClass != 17)
|
||||
{
|
||||
m_dwSex = 1;
|
||||
m_wClass = 17;
|
||||
|
||||
float fDir = g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->GetDirection();
|
||||
char Temp[10], Temp1[10];
|
||||
sprintf(Temp, "HAIR%02d", m_dwHair);
|
||||
sprintf(Temp1, "FACE%02d", m_dwFace);
|
||||
|
||||
for(int cCash=0;cCash<g_CharacterData.m_ChrCashList.num;cCash++)
|
||||
{
|
||||
if(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel==g_CharacterData.m_ChrCashList[cCash].m_lpChrModel)
|
||||
{
|
||||
g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
g_CharacterData.m_ChrCashList[cCash].m_lpChrModel=g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel=g_ClientMain.m_lpSceneManager->AddCharacter("PC_Akhan_A.GCMDS", Temp1, Temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
//g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_MAN.GCMDS", Temp1, Temp);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetPosition(g_ClientMain.m_vecCharSelectPos[g_ClientMain.m_dwSelectChr]);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(fDir);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->InitWeapon(0);
|
||||
}
|
||||
|
||||
m_ButtonManager.m_lstButton[15]->m_nState = BUTTON_NONE;
|
||||
} else if(m_ButtonManager.m_lstButton[15]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_wClass != 18)
|
||||
{
|
||||
m_dwSex = 2;
|
||||
m_wClass = 18;
|
||||
|
||||
float fDir = g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->GetDirection();
|
||||
char Temp[10], Temp1[10];
|
||||
sprintf(Temp, "HAIR%02d", m_dwHair);
|
||||
sprintf(Temp1, "FACE%02d", m_dwFace);
|
||||
//g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
for(int cCash=0;cCash<g_CharacterData.m_ChrCashList.num;cCash++)
|
||||
{
|
||||
if(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel==g_CharacterData.m_ChrCashList[cCash].m_lpChrModel)
|
||||
{
|
||||
g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
g_CharacterData.m_ChrCashList[cCash].m_lpChrModel=g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_Akhan_B.GCMDS", Temp1, Temp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_WOMAN.GCMDS", Temp1, Temp);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetPosition(g_ClientMain.m_vecCharSelectPos[g_ClientMain.m_dwSelectChr]);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(fDir);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->InitWeapon(0);
|
||||
}
|
||||
|
||||
m_ButtonManager.m_lstButton[14]->m_nState = BUTTON_NONE;
|
||||
} else if(m_ButtonManager.m_lstButton[16]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
/* if(m_wClass != 17) // 오피 막는 코드
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[540]);
|
||||
lpMessage->SetTimer(1000);
|
||||
return TRUE;
|
||||
}*/
|
||||
|
||||
int len = strlen(m_strName), i;
|
||||
|
||||
if(len == 0)
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[110]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 캐릭터 이름이 없습니다.
|
||||
return TRUE;
|
||||
} else if(len < 4)
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[111]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 캐릭터 이름이 짧습니다.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwIP)
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[112]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 포인트가 남았다.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(m_strName[i] == ' ')
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[113]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 빈칸이 있습니다.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_strName[i] == 34 || m_strName[i] == 39)
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[114]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 이름이 따옴표가 있습니다.
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(!g_ClientMain.m_bAdminMode)
|
||||
{
|
||||
if(!strcmp(m_strName, "Belldandy") ||
|
||||
!strcmp(m_strName, "Skuld") ||
|
||||
!strcmp(m_strName, "Uld") ||
|
||||
!strcmp(m_strName, "베르단디") ||
|
||||
!strcmp(m_strName, "스쿨드") ||
|
||||
!strcmp(m_strName, "울드") ||
|
||||
!strcmp(m_strName, "구우사마") ||
|
||||
!strcmp(m_strName, "구우짱") ||
|
||||
!strcmp(m_strName, "구우") ||
|
||||
!strcmp(m_strName, "힘찬군") ||
|
||||
!strcmp(m_strName, "direwolf") ||
|
||||
!strcmp(m_strName, "daishi") ||
|
||||
!strcmp(m_strName, "이터군") ||
|
||||
!strcmp(m_strName, "아싸양") ||
|
||||
!strcmp(m_strName, "쩜백") ||
|
||||
!strcmp(m_strName, "쩜100") ||
|
||||
!strcmp(m_strName, "DOT100") ||
|
||||
!strcmp(m_strName, "jjum100") ||
|
||||
!strcmp(m_strName, "ifnotall") ||
|
||||
!strcmp(m_strName, "중년의로망") ||
|
||||
!strcmp(m_strName, "혼군") ||
|
||||
!strcmp(m_strName, "릴장군") ||
|
||||
!strcmp(m_strName, "은빈나라") ||
|
||||
!strcmp(m_strName, "은빈장군") ||
|
||||
!strcmp(m_strName, "스컬리") ||
|
||||
!strcmp(m_strName, "멀더") ||
|
||||
!strcmp(m_strName, "부국장") ||
|
||||
!strcmp(m_strName, "wizardbug") ||
|
||||
!strcmp(m_strName, "릴넘버1") ||
|
||||
!strcmp(m_strName, "윤미동기스") ||
|
||||
!strcmp(m_strName, "song") ||
|
||||
!strcmp(m_strName, "파우더") ||
|
||||
!strcmp(m_strName, "팅커벨") ||
|
||||
!strcmp(m_strName, "아프로디테") ||
|
||||
!strcmp(m_strName, "칠선녀") ||
|
||||
!strcmp(m_strName, "춘향이") ||
|
||||
!strcmp(m_strName, "구리포에버") ||
|
||||
!strcmp(m_strName, "로딘") ||
|
||||
!strcmp(m_strName, "myrodin") ||
|
||||
!strcmp(m_strName, "rodin") ||
|
||||
!strcmp(m_strName, "네코네코") ||
|
||||
!strcmp(m_strName, "루나윈드") ||
|
||||
!strcmp(m_strName, "실버차임") ||
|
||||
!strcmp(m_strName, "Lunarwind") ||
|
||||
!strcmp(m_strName, "윤디") ||
|
||||
!strcmp(m_strName, "yundi") ||
|
||||
!strcmp(m_strName, "ppuchuu") ||
|
||||
!strcmp(m_strName, "뿌쮸") ||
|
||||
!strcmp(m_strName, "레니아") ||
|
||||
!strcmp(m_strName, "라벨루") ||
|
||||
!strcmp(m_strName, "라느") ||
|
||||
!strcmp(m_strName, "차선미") ||
|
||||
!strcmp(m_strName, "rainbow") ||
|
||||
!strcmp(m_strName, "Rainbow") ||
|
||||
!strcmp(m_strName, "stargazer") ||
|
||||
!strcmp(m_strName, "potatoo") ||
|
||||
!strcmp(m_strName, "Potatoo"))
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[115]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 포인트가 남았다.
|
||||
return TRUE;
|
||||
}/**/
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_dwInternationalCode == 0)
|
||||
{
|
||||
if(!CheckCharCreateName(m_strName))
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[116]);
|
||||
lpMessage->SetTimer(1000);
|
||||
// 포인트가 남았다.
|
||||
return TRUE;
|
||||
}// 대만용이면 이걸 막는다.
|
||||
}
|
||||
|
||||
|
||||
CHAR_CREATE CreateChrInfo;
|
||||
ZeroMemory(&CreateChrInfo, sizeof(CHAR_CREATE));
|
||||
memcpy(CreateChrInfo.Name, m_strName, 0x10);
|
||||
g_TextEdit.InitMessage();
|
||||
|
||||
CreateChrInfo.Sex = m_dwSex;
|
||||
CreateChrInfo.Face = m_dwFace;
|
||||
CreateChrInfo.Hair = m_dwHair;
|
||||
CreateChrInfo.Class = m_wClass;
|
||||
CreateChrInfo.Nationality = g_ClientMain.m_dwClientNation;
|
||||
|
||||
CreateChrInfo.STR = m_dwStr;
|
||||
CreateChrInfo.DEX = m_dwDex;
|
||||
CreateChrInfo.CON = m_dwCon;
|
||||
CreateChrInfo.INT = m_dwInt;
|
||||
CreateChrInfo.WIS = m_dwWis;
|
||||
|
||||
CreateChrInfo.Equip[0] = 0;
|
||||
CreateChrInfo.Equip[1] = 0;
|
||||
CreateChrInfo.Equip[2] = 0;
|
||||
CreateChrInfo.Equip[3] = 0;
|
||||
CreateChrInfo.Equip[4] = 0;
|
||||
CreateChrInfo.Equip[5] = 0;
|
||||
CreateChrInfo.Equip[6] = 0;
|
||||
CreateChrInfo.Equip[7] = 0;
|
||||
CreateChrInfo.Equip[8] = 0;
|
||||
CreateChrInfo.Equip[9] = 0;
|
||||
CreateChrInfo.Equip[10] = 0;
|
||||
switch(m_wClass)
|
||||
{
|
||||
case 17:
|
||||
CreateChrInfo.Equip[11] = 5401;
|
||||
break;
|
||||
|
||||
case 18:
|
||||
CreateChrInfo.Equip[11] = 5801;
|
||||
break;
|
||||
}
|
||||
CreateChrInfo.Equip[12] = 0;
|
||||
CreateChrInfo.Equip[13] = 0;
|
||||
CreateChrInfo.Equip[14] = 0;
|
||||
|
||||
g_ClientMain.m_Network.SendCreateChar(g_ClientMain.m_dwSelectChr, CreateChrInfo);
|
||||
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[117]);
|
||||
lpMessage->SetTimer(100000);
|
||||
|
||||
g_ClientMain.m_bCreateChar = TRUE;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[17]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
for(int cCash=0;cCash<g_CharacterData.m_ChrCashList.num;cCash++)
|
||||
{
|
||||
if(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel==g_CharacterData.m_ChrCashList[cCash].m_lpChrModel)
|
||||
{
|
||||
g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
g_CharacterData.m_ChrCashList[cCash].m_lpChrModel=g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_Akhan_A.GCMDS", "FACE01", "HAIR01");
|
||||
break;
|
||||
}
|
||||
}
|
||||
//g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
//g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_MAN.GCMDS", "FACE01", "HAIR01");
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetPosition(g_ClientMain.m_vecCharSelectPos[g_ClientMain.m_dwSelectChr]);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(0.0f);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->InitWeapon(0);
|
||||
|
||||
CreateCancel();
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[18]->m_nState == BUTTON_PRESS)
|
||||
{
|
||||
float fDir = g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->GetDirection();
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(fDir + 0.05f);
|
||||
} else if(m_ButtonManager.m_lstButton[19]->m_nState == BUTTON_PRESS)
|
||||
{
|
||||
float fDir = g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->GetDirection();
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(fDir - 0.05f);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanChrCreate::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF) return;
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
m_lstSprite[2]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[3]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
switch(m_wClass)
|
||||
{
|
||||
case 17:
|
||||
m_lstSprite[6]->Render(lpD3DDevice, m_cAlpha);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
m_lstSprite[5]->Render(lpD3DDevice, m_cAlpha);
|
||||
break;
|
||||
}
|
||||
|
||||
RECT rcRect;
|
||||
if(g_TextEdit.IsFocus())
|
||||
{
|
||||
SetRect(&rcRect, 22 + 95, 37 + 79, 22 + 192, 37 + 92);
|
||||
strcpy(m_strName, g_TextEdit.GetMessage());
|
||||
if(g_ClientMain.m_bCursorToggle)
|
||||
{
|
||||
char strChat[MAX_PATH];
|
||||
sprintf(strChat, "%s_", g_TextEdit.GetMessage());
|
||||
g_TextEdit.DrawText(strChat, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(m_strName, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
|
||||
SetRect(&rcRect, 22 + 153, 37 + 265, 22 + 174, 37 + 279);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwIP, &rcRect);
|
||||
SetRect(&rcRect, 22 + 93, 37 + 303, 22 + 114, 37 + 317);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwStr, &rcRect);
|
||||
SetRect(&rcRect, 22 + 93, 37 + 338, 22 + 114, 37 + 352);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwDex, &rcRect);
|
||||
SetRect(&rcRect, 22 + 93, 37 + 373, 22 + 114, 37 + 387);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwCon, &rcRect);
|
||||
SetRect(&rcRect, 22 + 93, 37 + 408, 22 + 114, 37 + 422);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwInt, &rcRect);
|
||||
SetRect(&rcRect, 22 + 93, 37 + 442, 22 + 114, 37 + 456);
|
||||
g_ClientMain.m_lpCommonInterface->RenderNum(lpD3DDevice, m_dwWis, &rcRect);
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
g_MessageBoxManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CAkhanChrCreate::CreateCancel()
|
||||
{
|
||||
char strCameraPath[MAX_PATH];
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
switch(g_ClientMain.m_dwSelectChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
|
||||
}
|
||||
130
GameTools/NeoRylClient/AkhanChrCreate.h
Normal file
130
GameTools/NeoRylClient/AkhanChrCreate.h
Normal file
@@ -0,0 +1,130 @@
|
||||
// AkhanChrCreate.h: interface for the CAkhanChrCreate class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_)
|
||||
#define AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
static const unsigned short ALLOW_HAN_NUM = 39;
|
||||
static unsigned short AllowHans[ALLOW_HAN_NUM] =
|
||||
{
|
||||
'갉', '갊', '걺', '괆', '녠',
|
||||
'닒', '롼', '뢸', '룀', '룁',
|
||||
'룅', '뤠', '륄', '륌', '륏',
|
||||
'륑', '륩', '륫', '릊', '릍',
|
||||
'멂', '몲', '뭬', '뮴', '밗',
|
||||
'뱝', '뾔', '쓿', '줴', '쥣',
|
||||
'짢', '췽', '퀭', '푤', '푭',
|
||||
'풩', '핥', '홅', '흖'
|
||||
};
|
||||
|
||||
static const unsigned short ALLOW_LETTER_NUM = 2;
|
||||
static char AllowLetters[ALLOW_LETTER_NUM] =
|
||||
{
|
||||
'-', '_'
|
||||
};
|
||||
|
||||
class CAkhanChrCreate : public CGUIWindow
|
||||
{
|
||||
unsigned short m_wClass;
|
||||
unsigned long m_dwStr;
|
||||
unsigned long m_dwDex;
|
||||
unsigned long m_dwCon;
|
||||
unsigned long m_dwInt;
|
||||
unsigned long m_dwWis;
|
||||
unsigned long m_dwIP;
|
||||
char m_strName[16];
|
||||
unsigned long m_dwEndTimer;
|
||||
unsigned long m_dwSex;
|
||||
unsigned long m_dwHair;
|
||||
unsigned long m_dwFace;
|
||||
|
||||
inline bool CheckCharCreateName(char *Name_In)
|
||||
{
|
||||
const unsigned short MIN_CHAR_NAME = 4;
|
||||
const unsigned short MAX_CHAR_NAME = 15;
|
||||
|
||||
if(Name_In == NULL)
|
||||
return false;
|
||||
|
||||
// 길이 제한
|
||||
size_t Len = strlen(Name_In);
|
||||
if(Len < MIN_CHAR_NAME || Len > MAX_CHAR_NAME)
|
||||
return false;
|
||||
|
||||
LPBYTE CheckName = (LPBYTE)Name_In;
|
||||
|
||||
// 제한 문자 검사
|
||||
int ACount = 0;
|
||||
for(unsigned short LCount = 0; LCount < Len; LCount++)
|
||||
{
|
||||
if((CheckName[LCount] & 0x80) == 0x80)
|
||||
{
|
||||
// 2Byte 문자 체크
|
||||
if(CheckName[LCount + 1] == NULL)
|
||||
return false;
|
||||
|
||||
// 허용 범위 체크 (한글)
|
||||
if(CheckName[LCount] < 0xB0 || CheckName[LCount] > 0xC9)
|
||||
return false;
|
||||
|
||||
if(CheckName[LCount + 1] < 0xA1 || CheckName[LCount + 1] > 0xFE)
|
||||
return false;
|
||||
|
||||
// 한글 부분 불 허용
|
||||
for(ACount = 0; ACount < ALLOW_HAN_NUM; ACount++)
|
||||
{
|
||||
if(MAKEWORD(CheckName[LCount + 1], CheckName[LCount]) == AllowHans[ACount])
|
||||
break;
|
||||
}
|
||||
|
||||
if(ACount != ALLOW_HAN_NUM)
|
||||
return false;
|
||||
|
||||
LCount += 1;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 영문자 허용
|
||||
if((CheckName[LCount] >= 'A' && CheckName[LCount] <= 'Z') || (CheckName[LCount] >= 'a' && CheckName[LCount] <= 'z'))
|
||||
continue;
|
||||
|
||||
// 숫자 허용
|
||||
if(CheckName[LCount] >= '0' && CheckName[LCount] <= '9')
|
||||
continue;
|
||||
|
||||
// 특수 기호 부분 허용
|
||||
for(ACount = 0; ACount < ALLOW_LETTER_NUM; ACount++)
|
||||
{
|
||||
if(CheckName[LCount] == AllowLetters[ACount])
|
||||
break;
|
||||
}
|
||||
|
||||
if(ACount == ALLOW_LETTER_NUM)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
void CreateCancel(void);
|
||||
CAkhanChrCreate();
|
||||
~CAkhanChrCreate();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANCHRCREATE_H__8BA5391E_7C4E_4470_B081_868014DD3261__INCLUDED_)
|
||||
220
GameTools/NeoRylClient/AkhanChrSelect1.cpp
Normal file
220
GameTools/NeoRylClient/AkhanChrSelect1.cpp
Normal file
@@ -0,0 +1,220 @@
|
||||
// AkhanChrSelect1.cpp: implementation of the CAkhanChrSelect1 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "FrameTimer.h"
|
||||
#include "AkhanChrSelect1.h"
|
||||
#include "WinInput.h"
|
||||
#include "AkhanGUI.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanChrSelect1::CAkhanChrSelect1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAkhanChrSelect1::~CAkhanChrSelect1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CAkhanChrSelect1::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 499, 0, 0, 128, 101, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(128, 521, 206, 102, 233, 146, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(14, 14, 0, 102, 206, 182, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(94, 158, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(432, 334, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(533, 67, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(33, 526, 144, 0, 256, 34, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(33, 526, 144, 34, 256, 68, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(33, 526, 144, 68, 256, 102, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x; m_rcWindowSize.bottom = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x; m_rcMoveEdge.bottom = y;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanChrSelect1::InitValue(void)
|
||||
{
|
||||
m_dwOverChrID = 0xFFFFFFFF;
|
||||
m_dwEndTimer = 0xFFFFFFFF;
|
||||
g_ClientMain.m_bSelectChar = FALSE;
|
||||
}
|
||||
|
||||
BOOL CAkhanChrSelect1::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
m_dwOverChrID = g_ClientMain.GetScreenPosChr(*ptMousePos, 10000, 0); // TARGET_SELECTCHAR = 10000
|
||||
|
||||
BOOL bIsExist = FALSE;
|
||||
m_dwOverChr = 0xFFFFFFFF;
|
||||
if(m_dwOverChrID != 0xFFFFFFFF)
|
||||
{
|
||||
for(long i = 0; i < 3; i++)
|
||||
{
|
||||
if(m_dwOverChrID == g_CharacterData.m_lstCharData[i]->m_dwChrID)
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[i].UID) bIsExist = TRUE;
|
||||
m_dwOverChr = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!bIsExist) m_dwOverChrID = 0xFFFFFFFF;
|
||||
|
||||
if(m_dwEndTimer != 0xFFFFFFFF)
|
||||
{
|
||||
if(g_ClientMain.m_bSelectChar) return TRUE;
|
||||
|
||||
if(CFrameTimer::GetUpdateTimer(m_dwEndTimer) >= 1.0f)
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID)
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITSTART;
|
||||
else
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITCREATE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDBClick())
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID)
|
||||
{
|
||||
g_ClientMain.m_Network.CharSelect(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwOverChr != 0xFFFFFFFF && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
char strCameraPath[MAX_PATH];
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
g_ClientMain.m_dwSelectChr = m_dwOverChr;
|
||||
|
||||
switch(m_dwOverChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzi_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzi_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzi_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
SendMessage(g_ClientMain.m_hWnd, WM_DESTROY, 0, 0);
|
||||
g_ClientMain.m_dwClientMode = CLIENT_END;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanChrSelect1::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF) return;
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
for(long i = 0; i < 3; i++)
|
||||
{
|
||||
if(!g_ClientMain.m_scLoginChar[i].UID)
|
||||
{
|
||||
m_lstSprite[3 + i]->Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_dwOverChrID != 0xFFFFFFFF)
|
||||
{
|
||||
m_lstSprite[2]->Render(lpD3DDevice, m_cAlpha);
|
||||
RECT rcRect;
|
||||
char Temp[MAX_PATH];
|
||||
SetRect(&rcRect, 105, 23, 206, 36);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_scLoginChar[m_dwOverChr].Name, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
sprintf(Temp, "%d", g_ClientMain.m_scLoginChar[m_dwOverChr].Level);
|
||||
SetRect(&rcRect, 105, 39, 206, 52);
|
||||
g_TextEdit.DrawText(Temp, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
sprintf(Temp, "%d", g_ClientMain.m_scLoginChar[m_dwOverChr].Merits);
|
||||
SetRect(&rcRect, 105, 55, 206, 68);
|
||||
g_TextEdit.DrawText(Temp, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
SetRect(&rcRect, 105, 71, 206, 84);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_lpCommonInterface->GetClassName(g_ClientMain.m_scLoginChar[m_dwOverChr].Class),
|
||||
&rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
32
GameTools/NeoRylClient/AkhanChrSelect1.h
Normal file
32
GameTools/NeoRylClient/AkhanChrSelect1.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// AkhanChrSelect1.h: interface for the CAkhanChrSelect1 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANCHRSELECT1_H__8C327986_AE9A_4E48_831A_453EEE0C29D7__INCLUDED_)
|
||||
#define AFX_AKHANCHRSELECT1_H__8C327986_AE9A_4E48_831A_453EEE0C29D7__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CAkhanChrSelect1 : public CGUIWindow
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwOverChrID;
|
||||
unsigned long m_dwOverChr;
|
||||
unsigned long m_dwEndTimer;
|
||||
|
||||
public:
|
||||
CAkhanChrSelect1();
|
||||
~CAkhanChrSelect1();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANCHRSELECT1_H__8C327986_AE9A_4E48_831A_453EEE0C29D7__INCLUDED_)
|
||||
269
GameTools/NeoRylClient/AkhanChrSelect2.cpp
Normal file
269
GameTools/NeoRylClient/AkhanChrSelect2.cpp
Normal file
@@ -0,0 +1,269 @@
|
||||
// AkhanChrSelect2.cpp: implementation of the CAkhanChrSelect2 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "AkhanGUI.h"
|
||||
#include "AkhanChrSelect2.h"
|
||||
#include "FrameTimer.h"
|
||||
#include "GUIMessageBoxManager.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanChrSelect2::CAkhanChrSelect2()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAkhanChrSelect2::~CAkhanChrSelect2()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CAkhanChrSelect2::InitValue(void)
|
||||
{
|
||||
m_dwChrDeleteResult = 0;
|
||||
m_dwEndTimer = 0xFFFFFFFF;
|
||||
g_ClientMain.m_bDeleteChar = FALSE;
|
||||
}
|
||||
|
||||
BOOL CAkhanChrSelect2::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 457, 0, 0, 234, 143, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(617, 462, 73, 0, 256, 143, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(61, 479, 0, 143, 163, 177, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(61, 479, 0, 177, 163, 211, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(61, 479, 0, 211, 163, 245, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(31, 527, 144, 154, 256, 188, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(31, 527, 144, 188, 256, 222, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(31, 527, 144, 222, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(624, 526, 0, 154, 144, 188, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(624, 526, 0, 188, 144, 222, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(624, 526, 0, 222, 144, 256, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x; m_rcWindowSize.bottom = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x; m_rcMoveEdge.bottom = y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CAkhanChrSelect2::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
g_MessageBoxManager.Update();
|
||||
|
||||
if(g_ClientMain.m_bSelectChar) return TRUE;
|
||||
|
||||
if(m_dwEndTimer != 0xFFFFFFFF)
|
||||
{
|
||||
if(CFrameTimer::GetUpdateTimer(m_dwEndTimer) >= 1.0f)
|
||||
{
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITSELECT;
|
||||
g_MessageBoxManager.DestroyList();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwChrDeleteResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_bDeleteChar = TRUE;
|
||||
g_ClientMain.m_Network.SendDeleteChar(g_ClientMain.m_dwSelectChr, g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[120]);
|
||||
lpMessage->SetTimer(100000);
|
||||
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_dwChrDeleteResult & MB_NO || m_dwChrDeleteResult & MB_EXIT)
|
||||
{
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_Network.GetState() != NS_NOWAITING)
|
||||
return TRUE;
|
||||
|
||||
if(g_ClientMain.m_bDeleteChar)
|
||||
{
|
||||
if(g_ClientMain.m_Network.GetState() == NS_NOWAITING)
|
||||
{
|
||||
if(!g_ClientMain.m_Network.GetError())
|
||||
{
|
||||
for(int cCash=0;cCash<g_CharacterData.m_ChrCashList.num;cCash++)
|
||||
{
|
||||
if(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel==g_CharacterData.m_ChrCashList[cCash].m_lpChrModel)
|
||||
{
|
||||
g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
g_CharacterData.m_ChrCashList[cCash].m_lpChrModel=g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_Akhan_A.GCMDS", "FACE01", "HAIR01");
|
||||
|
||||
for(int j = 0; j < 15; j++)
|
||||
{
|
||||
strcpy(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_strShape[j], "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetPosition(g_ClientMain.m_vecCharSelectPos[g_ClientMain.m_dwSelectChr]);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(0.0f);
|
||||
// g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetMotion("WAIT");
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->InitWeapon(0);
|
||||
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
char strCameraPath[MAX_PATH];
|
||||
switch(g_ClientMain.m_dwSelectChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_bDeleteChar = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK) // Áö¿ì±â
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[121], MB_EXIT | MB_YES | MB_NO);
|
||||
lpMessage->SetResult(&m_dwChrDeleteResult);
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK) // Ãë¼Ò
|
||||
{
|
||||
char strCameraPath[MAX_PATH];
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
switch(g_ClientMain.m_dwSelectChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzo_a.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_CLICK) // µé¾î°¡±â
|
||||
{
|
||||
g_ClientMain.m_Network.CharSelect(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanChrSelect2::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF) return;
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
g_MessageBoxManager.Render(lpD3DDevice);
|
||||
}
|
||||
31
GameTools/NeoRylClient/AkhanChrSelect2.h
Normal file
31
GameTools/NeoRylClient/AkhanChrSelect2.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// AkhanChrSelect2.h: interface for the CAkhanChrSelect2 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANCHRSELECT2_H__3D6EFDAB_672B_4AB1_8340_9305B96BBD03__INCLUDED_)
|
||||
#define AFX_AKHANCHRSELECT2_H__3D6EFDAB_672B_4AB1_8340_9305B96BBD03__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CAkhanChrSelect2 : public CGUIWindow
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwEndTimer;
|
||||
unsigned long m_dwChrDeleteResult;
|
||||
|
||||
public:
|
||||
CAkhanChrSelect2();
|
||||
~CAkhanChrSelect2();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANCHRSELECT2_H__3D6EFDAB_672B_4AB1_8340_9305B96BBD03__INCLUDED_)
|
||||
3561
GameTools/NeoRylClient/AkhanGUI.cpp
Normal file
3561
GameTools/NeoRylClient/AkhanGUI.cpp
Normal file
File diff suppressed because it is too large
Load Diff
52
GameTools/NeoRylClient/AkhanGUI.h
Normal file
52
GameTools/NeoRylClient/AkhanGUI.h
Normal file
@@ -0,0 +1,52 @@
|
||||
// AkhanGUI.h: interface for the CAkhanGUI class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANGUI_H__4D483892_75CD_4D53_97E3_3006F1F066CA__INCLUDED_)
|
||||
#define AFX_AKHANGUI_H__4D483892_75CD_4D53_97E3_3006F1F066CA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "BaseGUI.h"
|
||||
|
||||
class CAkhanGUI : public CBaseGUI
|
||||
{
|
||||
public:
|
||||
// unsigned long m_dwEnterGameStep;
|
||||
|
||||
unsigned long m_nPreSelectItem;
|
||||
CEffScript *m_pCastingEffect;
|
||||
CAkhanGUI();
|
||||
virtual ~CAkhanGUI();
|
||||
|
||||
BOOL InitChrSelect(void);
|
||||
void UpdateChrSelect(void);
|
||||
void RenderChrSelect(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
BOOL InitGame(void);
|
||||
void UpdateGame(void);
|
||||
void RenderGame(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void InitTrade(unsigned long dwKindMarket, unsigned long dwNPCID);
|
||||
BOOL GetIsTrade(void);
|
||||
void InitClassChange(unsigned long dwNPCID);
|
||||
void ProcessExchangeCmd(unsigned long dwSenderID, unsigned short wCmd);
|
||||
void InitPos(CItemInstance *lpItem);
|
||||
BOOL GetIsExchange(void);
|
||||
// BOOL StartSkill(void);
|
||||
BOOL InitPopup(unsigned long dwKindPopup, unsigned long dwUID, unsigned long dwKindPos);
|
||||
void InitSkillUnLock(unsigned long dwNPCID);
|
||||
void InitChannel(unsigned char cChannelNum, unsigned short *lpChannel);
|
||||
void InitRespawn(unsigned char cZoneNum);
|
||||
BOOL GetIsRespawn(void);
|
||||
void DestroyRespawn(void);
|
||||
BOOL GetEnableChat(void);
|
||||
void InitDeposit(void);
|
||||
void ShowWindow(unsigned long dwWindowNum);
|
||||
BOOL GetBusy(void);
|
||||
BOOL GetIsBlackMarket(void);
|
||||
void InitStreetStall(unsigned long dwChrID, char *lpstrStreetName);
|
||||
void InitQuest(unsigned long dwChrID, unsigned long dwQuestID);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANGUI_H__4D483892_75CD_4D53_97E3_3006F1F066CA__INCLUDED_)
|
||||
1365
GameTools/NeoRylClient/AkhanInven.cpp
Normal file
1365
GameTools/NeoRylClient/AkhanInven.cpp
Normal file
File diff suppressed because it is too large
Load Diff
38
GameTools/NeoRylClient/AkhanInven.h
Normal file
38
GameTools/NeoRylClient/AkhanInven.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// AkhanInven.h: interface for the CAkhanInven class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANINVEN_H__E6178CA3_D20D_4F47_BF14_BAE61F3FEA86__INCLUDED_)
|
||||
#define AFX_AKHANINVEN_H__E6178CA3_D20D_4F47_BF14_BAE61F3FEA86__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
#include "ItemInstance.h" // Added by ClassView
|
||||
|
||||
class CAkhanInven : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
BOOL UsePotion(CItemInstance *lpItem);
|
||||
BOOL SelectItem();
|
||||
BOOL UseSkillBook(CItemInstance *lpItem);
|
||||
CItemInstance *m_lpRepairItem;
|
||||
CItemInstance *m_lpSplitItem;
|
||||
unsigned long m_dwRepairResult;
|
||||
unsigned long m_dwSplitResult;
|
||||
unsigned long m_dwSplitValue;
|
||||
unsigned long m_dwBackInven;
|
||||
|
||||
CAkhanInven();
|
||||
~CAkhanInven();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANINVEN_H__E6178CA3_D20D_4F47_BF14_BAE61F3FEA86__INCLUDED_)
|
||||
298
GameTools/NeoRylClient/AkhanJobChange.cpp
Normal file
298
GameTools/NeoRylClient/AkhanJobChange.cpp
Normal file
@@ -0,0 +1,298 @@
|
||||
// AkhanJobChange.cpp: implementation of the CAkhanJobChange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "AkhanJobChange.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUIMessageBox.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanJobChange::CAkhanJobChange()
|
||||
{
|
||||
}
|
||||
|
||||
CAkhanJobChange::~CAkhanJobChange()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CAkhanJobChange::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[35]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y, 0, 0, 78, 256, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 256, 194, g_ClientMain.m_lpInterface->m_lstTexture[37]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y + 256, 0, 0, 78, 194, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[520]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[521]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 412, 82, 52, 201, 72, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 412, 82, 52, 201, 72, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[522]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 78, 201, 98, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 78, 201, 98, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[523]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 104, 201, 124, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 104, 201, 124, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[524]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 412, 82, 130, 201, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 412, 82, 130, 201, 150, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[525]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(281, 355, 221, 126, 234, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(281, 355, 234, 126, 247, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[183]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(299, 355, 221, 138, 234, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(299, 355, 234, 138, 247, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[184]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 334; m_rcWindowSize.bottom = y + 450;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 334; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanJobChange::InitValue(void)
|
||||
{
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[i]->ShowButton(FALSE);
|
||||
}
|
||||
|
||||
switch(g_ClientMain.m_csStatus.m_Info.Class)
|
||||
{
|
||||
case 17:
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case 18:
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[4]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
}
|
||||
|
||||
BOOL CAkhanJobChange::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
unsigned long dwMousePosX = ptMousePos->x - (m_rcWindowSize.left + 18);
|
||||
unsigned long dwMousePosY = ptMousePos->y - (m_rcWindowSize.top + 286);
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_dwChangeResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_UPGRADECLASS;
|
||||
g_ClientMain.m_Network.m_pSocket->CharClassUpgrade(g_ClientMain.m_dwMyChrID, m_wClassChange);
|
||||
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
ShowWindow(FALSE);
|
||||
return TRUE;
|
||||
} else if(m_dwChangeResult & MB_NO || m_dwChangeResult & MB_EXIT)
|
||||
{
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
char strText[MAX_PATH];
|
||||
CGUIMessageBox *lpMessageBox = new CGUIMessageBox;
|
||||
sprintf(strText, g_StringTable.m_strString[185], g_ClientMain.m_lpCommonInterface->GetClassName(19 + i));
|
||||
lpMessageBox->Create(strText, MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwChangeResult);
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 19 + i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanJobChange::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[i]->ShowButton(bShow);
|
||||
}
|
||||
|
||||
if(bShow == FALSE)
|
||||
{
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void CAkhanJobChange::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
|
||||
RECT rect;
|
||||
for(int i = 0; i < m_lstMessage.size(); i++)
|
||||
{
|
||||
rect.left = m_rcWindowSize.left + 14;
|
||||
rect.top = m_rcWindowSize.top + 20 + i * 16;
|
||||
rect.right = rect.left + 304;
|
||||
rect.bottom = rect.top + 16;
|
||||
|
||||
g_TextEdit.DrawText(m_lstMessage[i]->strMessage, &rect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CAkhanJobChange::SetText(const char *strMessage)
|
||||
{
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
|
||||
char *strMessageTemp, *token, seps[] = "\\n";
|
||||
strMessageTemp = new char[strlen(strMessage) + 100];
|
||||
strcpy(strMessageTemp, strMessage);
|
||||
token = strtok(strMessageTemp, seps);
|
||||
|
||||
while(token != NULL)
|
||||
{
|
||||
lpMessage = new Message;
|
||||
strcpy(lpMessage->strMessage, token);
|
||||
m_lstMessage.push_back(lpMessage);
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
}
|
||||
|
||||
delete[] strMessageTemp;
|
||||
}
|
||||
41
GameTools/NeoRylClient/AkhanJobChange.h
Normal file
41
GameTools/NeoRylClient/AkhanJobChange.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// AkhanJobChange.h: interface for the CAkhanJobChange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANJOBCHANGE_H__05947322_F14B_4C24_9A79_687BD1168E46__INCLUDED_)
|
||||
#define AFX_AKHANJOBCHANGE_H__05947322_F14B_4C24_9A79_687BD1168E46__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CAkhanJobChange : public CGUIWindow
|
||||
{
|
||||
typedef struct Message
|
||||
{
|
||||
char strMessage[MAX_PATH];
|
||||
} Message, *LPMessage;
|
||||
|
||||
public:
|
||||
void SetText(const char *strMessage);
|
||||
vector<LPMessage> m_lstMessage;
|
||||
|
||||
unsigned long m_dwChangeResult;
|
||||
unsigned short m_wClassChange;
|
||||
|
||||
CAkhanJobChange();
|
||||
~CAkhanJobChange();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANJOBCHANGE_H__05947322_F14B_4C24_9A79_687BD1168E46__INCLUDED_)
|
||||
180
GameTools/NeoRylClient/AkhanRespawn.cpp
Normal file
180
GameTools/NeoRylClient/AkhanRespawn.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
// AkhanRespawn.cpp: implementation of the CAkhanRespawn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "AkhanRespawn.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanRespawn::CAkhanRespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CAkhanRespawn::~CAkhanRespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CAkhanRespawn::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanRespawn::InitValue(void)
|
||||
{
|
||||
m_cSelectZone = 0;
|
||||
|
||||
ZeroMemory(&m_aryRespawn, sizeof(RespawnPoint) * 30);
|
||||
|
||||
m_aryRespawn[3].m_dwSpawnNumber = 3;
|
||||
m_aryRespawn[3].m_wPutX[0] = 100; m_aryRespawn[3].m_wPutY[0] = 172;
|
||||
m_aryRespawn[3].m_psPoint[0].fPointX = 1310.52f;
|
||||
m_aryRespawn[3].m_psPoint[0].fPointY = 28.53f;
|
||||
m_aryRespawn[3].m_psPoint[0].fPointZ = 1168.81f;
|
||||
|
||||
m_aryRespawn[3].m_wPutX[1] = 163; m_aryRespawn[3].m_wPutY[1] = 209;
|
||||
m_aryRespawn[3].m_psPoint[1].fPointX = 1619.65f;
|
||||
m_aryRespawn[3].m_psPoint[1].fPointY = 49.31f;
|
||||
m_aryRespawn[3].m_psPoint[1].fPointZ = 998.32f;
|
||||
|
||||
m_aryRespawn[3].m_wPutX[2] = 229; m_aryRespawn[3].m_wPutY[2] = 113;
|
||||
m_aryRespawn[3].m_psPoint[2].fPointX = 1976.27f;
|
||||
m_aryRespawn[3].m_psPoint[2].fPointY = 53.56f;
|
||||
m_aryRespawn[3].m_psPoint[2].fPointZ = 1464.75f;
|
||||
|
||||
m_aryRespawn[6].m_dwSpawnNumber = 3;
|
||||
m_aryRespawn[6].m_wPutX[0] = 100; m_aryRespawn[6].m_wPutY[0] = 172;
|
||||
m_aryRespawn[6].m_psPoint[0].fPointX = 1310.52f;
|
||||
m_aryRespawn[6].m_psPoint[0].fPointY = 28.53f;
|
||||
m_aryRespawn[6].m_psPoint[0].fPointZ = 1168.81f;
|
||||
|
||||
m_aryRespawn[6].m_wPutX[1] = 163; m_aryRespawn[6].m_wPutY[1] = 209;
|
||||
m_aryRespawn[6].m_psPoint[1].fPointX = 1619.65f;
|
||||
m_aryRespawn[6].m_psPoint[1].fPointY = 49.31f;
|
||||
m_aryRespawn[6].m_psPoint[1].fPointZ = 998.32f;
|
||||
|
||||
m_aryRespawn[6].m_wPutX[2] = 229; m_aryRespawn[6].m_wPutY[2] = 113;
|
||||
m_aryRespawn[6].m_psPoint[2].fPointX = 1976.27f;
|
||||
m_aryRespawn[6].m_psPoint[2].fPointY = 53.56f;
|
||||
m_aryRespawn[6].m_psPoint[2].fPointZ = 1464.75f;
|
||||
}
|
||||
|
||||
BOOL CAkhanRespawn::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
for(unsigned long i = 0; i < m_aryRespawn[m_cSelectZone].m_dwSpawnNumber; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_RESPAWN;
|
||||
g_ClientMain.m_lpInterface->DestroyRespawn();
|
||||
g_ClientMain.m_Network.m_pSocket->CharRespawn(g_ClientMain.m_dwMyChrID, 1, m_aryRespawn[m_cSelectZone].m_psPoint[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanRespawn::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
|
||||
if(!bShow)
|
||||
{
|
||||
m_TooltipManager.DestroyAllTooltip();
|
||||
m_ButtonManager.DestroyAllButton();
|
||||
|
||||
{
|
||||
vector<CSprite *>::iterator it;
|
||||
for(it = m_lstSprite.begin(); it != m_lstSprite.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstSprite.clear();
|
||||
}
|
||||
|
||||
{
|
||||
vector<CTexture *>::iterator it;
|
||||
for(it = m_lstTexture.begin(); it != m_lstTexture.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstTexture.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CAkhanRespawn::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_lstSprite[0])
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CAkhanRespawn::SetRespawn(unsigned char cZoneNum)
|
||||
{
|
||||
m_cSelectZone = cZoneNum;
|
||||
|
||||
CGUIButton *lpButton;
|
||||
for(unsigned long i = 0; i < m_aryRespawn[cZoneNum].m_dwSpawnNumber; i++)
|
||||
{
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(m_aryRespawn[cZoneNum].m_wPutX[i], m_aryRespawn[cZoneNum].m_wPutY[i], 183, 153, 196, 166, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(m_aryRespawn[cZoneNum].m_wPutX[i], m_aryRespawn[cZoneNum].m_wPutY[i], 183, 169, 196, 182, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetMove(m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
}
|
||||
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
CTexture *lpTexture;
|
||||
lpTexture = new CTexture;
|
||||
lpTexture->Load("Spon_BG.dds");
|
||||
m_lstTexture.push_back(lpTexture);
|
||||
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(m_rcWindowSize.left, m_rcWindowSize.top, 0, 0, 256, 256, m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
m_rcWindowSize.right = m_rcWindowSize.left + 256;
|
||||
m_rcWindowSize.bottom = m_rcWindowSize.top + 256;
|
||||
|
||||
m_rcMoveEdge.right = m_rcWindowSize.left + 256;
|
||||
m_rcMoveEdge.bottom = m_rcWindowSize.top + 20;
|
||||
}
|
||||
40
GameTools/NeoRylClient/AkhanRespawn.h
Normal file
40
GameTools/NeoRylClient/AkhanRespawn.h
Normal file
@@ -0,0 +1,40 @@
|
||||
// AkhanRespawn.h: interface for the CAkhanRespawn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANRESPAWN_H__4C890A35_6E5E_4860_9845_0FE2D7B7F886__INCLUDED_)
|
||||
#define AFX_AKHANRESPAWN_H__4C890A35_6E5E_4860_9845_0FE2D7B7F886__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CAkhanRespawn : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
typedef struct RespawnPoint
|
||||
{
|
||||
unsigned long m_dwSpawnNumber;
|
||||
unsigned short m_wPutX[10];
|
||||
unsigned short m_wPutY[10];
|
||||
POS m_psPoint[10];
|
||||
} RespawnPoint;
|
||||
|
||||
unsigned char m_cSelectZone;
|
||||
vector<CTexture *> m_lstTexture;
|
||||
RespawnPoint m_aryRespawn[30];
|
||||
|
||||
void SetRespawn(unsigned char cZoneNum);
|
||||
CAkhanRespawn();
|
||||
virtual ~CAkhanRespawn();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANRESPAWN_H__4C890A35_6E5E_4860_9845_0FE2D7B7F886__INCLUDED_)
|
||||
832
GameTools/NeoRylClient/AkhanTrade.cpp
Normal file
832
GameTools/NeoRylClient/AkhanTrade.cpp
Normal file
@@ -0,0 +1,832 @@
|
||||
// AkhanTrade.cpp: implementation of the CAkhanTrade class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "AkhanTrade.h"
|
||||
#include "Creature\NPC\NPCList.h"
|
||||
#include "Item\ItemMgr.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITooltipItem.h"
|
||||
#include "GUIMessageBox.h"
|
||||
#include "GUITextEdit.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CAkhanTrade::CAkhanTrade()
|
||||
{
|
||||
m_dwBuyResult = 0;
|
||||
m_dwSellResult = 0;
|
||||
m_dwKindTitle = 0;
|
||||
m_dwTradeTab = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
m_dwItemNumber = 0;
|
||||
m_bBalckMarket = FALSE;
|
||||
}
|
||||
|
||||
CAkhanTrade::~CAkhanTrade()
|
||||
{
|
||||
vector<CItemInstance *>::iterator it;
|
||||
CItemInstance *lpDelete;
|
||||
for(it = m_lstTradeItem.begin(); it != m_lstTradeItem.end();)
|
||||
{
|
||||
lpDelete = (*it);
|
||||
it = m_lstTradeItem.erase(it);
|
||||
delete lpDelete;
|
||||
}
|
||||
m_lstTradeItem.clear();
|
||||
}
|
||||
|
||||
BOOL CAkhanTrade::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[23]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 222, 224, g_ClientMain.m_lpInterface->m_lstTexture[24]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기상점
|
||||
lpSprite->Create(x, y + 7, 0, 7, 222, 38, g_ClientMain.m_lpInterface->m_lstTexture[23]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어구상점
|
||||
lpSprite->Create(x, y + 7, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 잡화 상점
|
||||
lpSprite->Create(x, y + 7, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 모험가 트레이너
|
||||
lpSprite->Create(x, y + 7, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 전사 트레이너
|
||||
lpSprite->Create(x, y + 7, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 도적 트레이너
|
||||
lpSprite->Create(x, y + 7, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 마법사 트레이너
|
||||
lpSprite->Create(x, y + 7, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 성직자 트레이너
|
||||
lpSprite->Create(x, y + 7, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 10
|
||||
lpSprite = new CSprite; // 무기 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 62, 222, 93, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[31]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 18
|
||||
lpSprite = new CSprite; // Etc 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // Etc 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // Etc 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // Etc 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 모험가 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 모험가 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 모험가 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 62, 222, 93, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 모험가 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[34]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 26
|
||||
lpSprite = new CSprite; // 전사 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 전사 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 전사 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 62, 222, 93, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 전사 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 도적 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 도적 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 도적 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 도적 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[33]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 34
|
||||
lpSprite = new CSprite; // 마법사 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 마법사 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 마법사 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 62, 222, 93, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 마법사 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 성직자 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 성직자 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 성직자 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 성직자 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[32]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 42
|
||||
lpSprite = new CSprite; // 암시장
|
||||
lpSprite->Create(x, y + 7, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[44]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 보관소 탭 #1
|
||||
lpSprite->Create(x, y + 51, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[45]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 보관소 탭 #2
|
||||
lpSprite->Create(x, y + 51, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[45]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 보관소 탭 #3
|
||||
lpSprite->Create(x, y + 51, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[45]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 보관소 탭 #4
|
||||
lpSprite->Create(x, y + 51, 0, 217, 222, 248, g_ClientMain.m_lpInterface->m_lstTexture[45]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 0, 182, 26, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 0, 250, 26, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[242]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(121, 420, 114, 26, 182, 52, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(121, 420, 182, 26, 250, 52, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[243]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 52, 182, 78, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 52, 250, 78, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[244]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 78, 182, 104, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 78, 250, 104, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[245]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 104, 182, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 104, 250, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[246]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 130, 182, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 130, 250, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[247]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 156, 182, 182, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 156, 250, 182, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[248]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 182, 182, 208, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 182, 250, 208, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[249]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(29, 420, 114, 208, 182, 234, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(29, 420, 182, 208, 250, 234, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[250]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(190, 1, 0, 0, 28, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(190, 1, 28, 0, 56, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[251]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
InitValue();
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 222; m_rcWindowSize.bottom = y + 480;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 222; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanTrade::InitValue(void)
|
||||
{
|
||||
m_dwBuyResult = 0;
|
||||
m_dwSellResult = 0;
|
||||
m_dwTradeTab = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
m_dwItemNumber = 0;
|
||||
}
|
||||
|
||||
BOOL CAkhanTrade::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_dwSellResult & MB_YES)
|
||||
{
|
||||
// 판다. 패킷 전송
|
||||
unsigned long dwNum;
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack())
|
||||
dwNum = g_ClientMain.m_lpPickItem->GetNowDurability();
|
||||
else
|
||||
dwNum = 1;
|
||||
|
||||
Item::ItemPos pPos;
|
||||
g_ClientMain.m_Network.SendTradeItem(g_ClientMain.m_dwTradingNpcID, 0, dwNum, g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos(), pPos);
|
||||
|
||||
m_dwSellResult = 0;
|
||||
return TRUE;
|
||||
} else if(m_dwSellResult & MB_NO || m_dwSellResult & MB_EXIT)
|
||||
{
|
||||
m_dwSellResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwBuyResult & MB_YES)
|
||||
{
|
||||
// 산다. 패킷 전송
|
||||
Item::ItemPos pItemIndex;
|
||||
FieldInstance pTradeItem;
|
||||
pTradeItem.m_dwInstanceID = 0;
|
||||
pTradeItem.m_dwOID = 0;
|
||||
pTradeItem.m_dwTypeID = m_lpBuyItem->GetProtoTypeID();
|
||||
if(m_lpBuyItem->GetIsEnableStack())
|
||||
{
|
||||
if(m_dwItemNumber > m_lpBuyItem->GetMaxDurability())
|
||||
m_dwItemNumber = m_lpBuyItem->GetMaxDurability();
|
||||
pTradeItem.m_cNum = m_dwItemNumber;
|
||||
}
|
||||
else
|
||||
pTradeItem.m_cNum = 1;
|
||||
|
||||
if(pTradeItem.m_cNum)
|
||||
{
|
||||
BOOL bPass = FALSE;
|
||||
if(m_bBalckMarket)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Info.Gold < (pTradeItem.m_cNum * m_lpBuyItem->m_lpItemBase->GetBuyBlackPrice())) bPass = TRUE;
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Info.Gold < (pTradeItem.m_cNum * m_lpBuyItem->m_lpItemBase->GetBuyPrice())) bPass = TRUE;
|
||||
}
|
||||
|
||||
if(bPass)
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[252]);
|
||||
|
||||
m_dwBuyResult = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
unsigned long dwNum = g_ClientMain.m_csStatus.GetAbleInven(&pTradeItem, pItemIndex, FALSE);
|
||||
if(dwNum)
|
||||
{
|
||||
Item::ItemPos pPos;
|
||||
g_ClientMain.m_Network.SendTradeItem(g_ClientMain.m_dwTradingNpcID, m_lpBuyItem->GetProtoTypeID(),
|
||||
dwNum, pPos, pItemIndex);
|
||||
}
|
||||
}
|
||||
|
||||
m_dwItemNumber = 0;
|
||||
m_dwBuyResult = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
return TRUE;
|
||||
} else if(m_dwBuyResult & MB_NO || m_dwBuyResult & MB_EXIT)
|
||||
{
|
||||
m_dwItemNumber = 0;
|
||||
m_dwBuyResult = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 9, m_rcWindowSize.top + 85, m_rcWindowSize.left + 216, m_rcWindowSize.top + 395) && g_DeviceInput.GetIsLeftMouseDown() && g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_QSlot)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[257], g_ClientMain.m_dwMyChrID, 129);
|
||||
} else
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
char strMessage[MAX_PATH];
|
||||
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack())
|
||||
{
|
||||
sprintf(strMessage, g_StringTable.m_strString[253], g_ClientMain.m_lpPickItem->m_lpItemBase->GetSellPrice() * g_ClientMain.m_lpPickItem->GetNowDurability());
|
||||
} else
|
||||
{
|
||||
sprintf(strMessage, g_StringTable.m_strString[253], g_ClientMain.m_lpPickItem->m_lpItemBase->GetSellPrice());
|
||||
}
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(strMessage, MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwSellResult);
|
||||
|
||||
m_dwSellResult = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
vector<CItemInstance *>::iterator it;
|
||||
// const Item::ItemInfo *lpItemInfo;
|
||||
for(it = m_lstTradeItem.begin(); it != m_lstTradeItem.end(); it++)
|
||||
{
|
||||
// lpItemInfo = &(*it)->GetItemInfo();
|
||||
|
||||
if((*it)->m_lpItemBase->GetPos().GetZIndex() != m_dwTradeTab)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// (*it)->m_wPutX = m_rcWindowSize.left + 9 + 26 * lpItemInfo->m_nItemIndex.EvenPos.m_PosX + (((lpItemInfo->m_nItemSizeX * 26 - 1) - (*it)->m_lpSprite->GetSizeX()) / 2);
|
||||
// (*it)->m_wPutY = m_rcWindowSize.top + 85 + 26 * lpItemInfo->m_nItemIndex.EvenPos.m_PosY + (((lpItemInfo->m_nItemSizeY * 26 - 1) - (*it)->m_lpSprite->GetSizeY()) / 2);
|
||||
if(!g_ClientMain.m_lpPickItem && (g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsRightMouseDown()) && (*it)->IsOverMouse())
|
||||
{
|
||||
BOOL bPass = FALSE;
|
||||
if(m_bBalckMarket)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Info.Gold >= (*it)->m_lpItemBase->GetBuyBlackPrice()) bPass = TRUE;
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Info.Gold >= (*it)->m_lpItemBase->GetBuyPrice()) bPass = TRUE;
|
||||
}
|
||||
|
||||
if(bPass)
|
||||
{
|
||||
unsigned long dwNum;
|
||||
Item::ItemPos pItemIndex;
|
||||
FieldInstance pTradeItem;
|
||||
pTradeItem.m_dwInstanceID = 0;
|
||||
pTradeItem.m_dwOID = 0;
|
||||
pTradeItem.m_dwTypeID = (*it)->GetProtoTypeID();
|
||||
pTradeItem.m_cNum = 1;
|
||||
dwNum = g_ClientMain.m_csStatus.GetAbleInven(&pTradeItem, pItemIndex, FALSE);
|
||||
if(dwNum)
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
char strMessage[MAX_PATH];
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
m_dwBuyResult = 0;
|
||||
m_lpBuyItem = (*it);
|
||||
m_dwItemNumber = 0;
|
||||
|
||||
if(m_lpBuyItem->GetIsEnableStack())
|
||||
{
|
||||
strcpy(strMessage, g_StringTable.m_strString[254]);
|
||||
lpMessageBox->Create(strMessage, MB_NUMBER | MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetValue(&m_dwItemNumber);
|
||||
} else
|
||||
{
|
||||
if(m_bBalckMarket)
|
||||
{
|
||||
sprintf(strMessage, g_StringTable.m_strString[255], (*it)->m_lpItemBase->GetBuyBlackPrice());
|
||||
} else
|
||||
{
|
||||
sprintf(strMessage, g_StringTable.m_strString[255], (*it)->m_lpItemBase->GetBuyPrice());
|
||||
}
|
||||
lpMessageBox->Create(strMessage, MB_YES | MB_NO | MB_EXIT);
|
||||
}
|
||||
lpMessageBox->SetResult(&m_dwBuyResult);
|
||||
} else if(g_DeviceInput.GetIsRightMouseDown())
|
||||
{
|
||||
m_dwBuyResult = MB_YES;
|
||||
m_lpBuyItem = (*it);
|
||||
if(m_lpBuyItem->GetIsEnableStack())
|
||||
{
|
||||
m_dwItemNumber = m_lpBuyItem->GetMaxDurability();
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[256]);
|
||||
}
|
||||
} else
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[252]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 4, m_rcWindowSize.top + 51, m_rcWindowSize.left + 59, m_rcWindowSize.top + 82))
|
||||
{
|
||||
m_dwTradeTab = 0;
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 59, m_rcWindowSize.top + 51, m_rcWindowSize.left + 111, m_rcWindowSize.top + 82))
|
||||
{
|
||||
m_dwTradeTab = 1;
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 111, m_rcWindowSize.top + 51, m_rcWindowSize.left + 164, m_rcWindowSize.top + 82))
|
||||
{
|
||||
m_dwTradeTab = 2;
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 164, m_rcWindowSize.top + 51, m_rcWindowSize.left + 217, m_rcWindowSize.top + 82))
|
||||
{
|
||||
m_dwTradeTab = 3;
|
||||
}
|
||||
} else if(g_DeviceInput.GetIsRightMouseDown() && g_ClientMain.m_dwKindCursor != CURSOR_NORMAL)
|
||||
{
|
||||
g_ClientMain.m_dwKindCursor = CURSOR_NORMAL;
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_ON || m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_OFF)
|
||||
{
|
||||
if(g_ClientMain.m_dwKindCursor != CURSOR_REPAIR)
|
||||
g_ClientMain.m_dwKindCursor = CURSOR_REPAIR;
|
||||
else
|
||||
g_ClientMain.m_dwKindCursor = CURSOR_NORMAL;
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[9]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[9]->m_nState = BUTTON_NONE;
|
||||
ShowWindow(FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CAkhanTrade::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
if(m_bBalckMarket)
|
||||
{
|
||||
m_lstSprite[42]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[43 + m_dwTradeTab]->Render(lpD3DDevice, m_cAlpha);
|
||||
} else
|
||||
{
|
||||
m_lstSprite[m_dwKindTitle + 2]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[10 + m_dwKindTitle * 4 + m_dwTradeTab]->Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
|
||||
vector<CItemInstance *>::iterator it;
|
||||
for(it = m_lstTradeItem.begin(); it != m_lstTradeItem.end(); it++)
|
||||
{
|
||||
if((*it)->m_lpItemBase->GetPos().GetZIndex() != m_dwTradeTab)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
(*it)->Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_dwKindCursor == CURSOR_REPAIR)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_ON;
|
||||
} else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_OFF;
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CAkhanTrade::InitTrade(unsigned long dwNPCID)
|
||||
{
|
||||
InitValue();
|
||||
|
||||
g_ClientMain.m_dwTradingNpcID = dwNPCID;
|
||||
|
||||
LPNPCNode lpNpcNode = g_NPCList.GetNPCNode(dwNPCID);
|
||||
m_dwTradeTab = 0;
|
||||
m_lpBuyItem = NULL;
|
||||
m_bBalckMarket = FALSE;
|
||||
InitTradeWindow(lpNpcNode);
|
||||
|
||||
switch(lpNpcNode->m_dwJob)
|
||||
{
|
||||
case POPUP_A_WEAPONMERCHANT:
|
||||
m_dwKindTitle = 0;
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case POPUP_A_ARMOURMERCHANT:
|
||||
m_dwKindTitle = 1;
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case POPUP_A_ETCMERCHANT:
|
||||
m_dwKindTitle = 2;
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case POPUP_A_BEGINNERTRAINER:
|
||||
m_dwKindTitle = 3;
|
||||
break;
|
||||
|
||||
case POPUP_A_COMBATANTTRAINER:
|
||||
m_dwKindTitle = 4;
|
||||
break;
|
||||
|
||||
case POPUP_A_OPPICATERTRAINER:
|
||||
m_dwKindTitle = 5;
|
||||
break;
|
||||
|
||||
case POPUP_A_DARKWEAPONMERCHANT:
|
||||
case POPUP_A_DARKARMOURMERCHANT:
|
||||
case POPUP_A_DARKETCMERCHANT:
|
||||
m_dwKindTitle = 6;
|
||||
m_bBalckMarket = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CAkhanTrade::DeleteTradeItem()
|
||||
{
|
||||
vector<CItemInstance *>::iterator it;
|
||||
CItemInstance *lpDelete;
|
||||
for(it = m_lstTradeItem.begin(); it != m_lstTradeItem.end();)
|
||||
{
|
||||
lpDelete = (*it);
|
||||
it = m_lstTradeItem.erase(it);
|
||||
delete lpDelete;
|
||||
}
|
||||
m_lstTradeItem.clear();
|
||||
}
|
||||
|
||||
void CAkhanTrade::ShowWindow(BOOL bShow)
|
||||
{
|
||||
switch(bShow)
|
||||
{
|
||||
case TRUE:
|
||||
m_bShow = TRUE;
|
||||
m_ButtonManager.m_lstButton[0]->m_bShow = FALSE;
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[1]->m_bShow = FALSE;
|
||||
m_ButtonManager.m_lstButton[1]->m_nState = BUTTON_NONE;
|
||||
g_ClientMain.m_dwKindCursor = CURSOR_NORMAL;
|
||||
break;
|
||||
|
||||
case FALSE:
|
||||
m_bShow = FALSE;
|
||||
m_bBalckMarket = FALSE;
|
||||
m_ButtonManager.m_lstButton[0]->m_bShow = FALSE;
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[1]->m_bShow = FALSE;
|
||||
m_ButtonManager.m_lstButton[1]->m_nState = BUTTON_NONE;
|
||||
g_ClientMain.m_dwKindCursor = CURSOR_NORMAL;
|
||||
|
||||
{
|
||||
vector<CItemInstance *>::iterator it;
|
||||
CItemInstance *lpDelete;
|
||||
for(it = m_lstTradeItem.begin(); it != m_lstTradeItem.end();)
|
||||
{
|
||||
lpDelete = (*it);
|
||||
it = m_lstTradeItem.erase(it);
|
||||
delete lpDelete;
|
||||
}
|
||||
m_lstTradeItem.clear();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CAkhanTrade::InitTradeWindow(LPNPCNode lpNpcNode)
|
||||
{
|
||||
vector<LPITEMNode>::iterator it;
|
||||
const Item::ItemInfo *lpProtoType;
|
||||
unsigned long dwSizeX, dwSizeY;
|
||||
int i, j, cx, cy;
|
||||
char arySpace[12][8];
|
||||
unsigned short wOldTab = 0xFFFF;
|
||||
BOOL bAble;
|
||||
|
||||
for(it = lpNpcNode->m_lstItem.begin(); it != lpNpcNode->m_lstItem.end(); it++)
|
||||
{
|
||||
lpProtoType = g_ItemMgr.GetItemInfo((*it)->m_wKindItem);
|
||||
dwSizeX = lpProtoType->m_DetailData.m_cXSize;
|
||||
dwSizeY = lpProtoType->m_DetailData.m_cYSize;
|
||||
|
||||
if(wOldTab != (*it)->m_wTabPage)
|
||||
{
|
||||
for(j = 0; j <= 12; j++)
|
||||
{
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
arySpace[j][i] = 0;
|
||||
}
|
||||
}
|
||||
wOldTab = (*it)->m_wTabPage;
|
||||
}
|
||||
|
||||
for(j = 0; j <= 12 - dwSizeY; j++)
|
||||
{
|
||||
for(i = 0; i <= 8 - dwSizeX; i++)
|
||||
{
|
||||
bAble = TRUE;
|
||||
for(cy = j; cy < j + dwSizeY; cy++)
|
||||
{
|
||||
for(cx = i; cx < i + dwSizeX; cx++)
|
||||
{
|
||||
if(arySpace[cy][cx])
|
||||
{
|
||||
bAble = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(bAble)
|
||||
{
|
||||
// (*it)->m_dwIndexPosition = i + j * 12;
|
||||
|
||||
Item::ItemPos pItemIndex;
|
||||
CItemInstance *lpItem;
|
||||
lpItem = new CItemInstance;
|
||||
lpItem->m_bTradeItem = TRUE;
|
||||
pItemIndex.SetZIndex((*it)->m_wTabPage);
|
||||
pItemIndex.m_cPos = (*it)->m_dwIndexPosition;
|
||||
|
||||
lpItem->SetItemInfofromID((*it)->m_wKindItem, pItemIndex);
|
||||
|
||||
m_lstTradeItem.push_back(lpItem);
|
||||
|
||||
lpItem->m_wPutX = m_rcWindowSize.left + 9 + 26 * i + (((lpItem->GetItemInfo().m_DetailData.m_cXSize * 26 - 1) - lpItem->m_lpSprite->GetSizeX()) / 2);
|
||||
lpItem->m_wPutY = m_rcWindowSize.top + 85 + 26 * j + (((lpItem->GetItemInfo().m_DetailData.m_cYSize * 26 - 1) - lpItem->m_lpSprite->GetSizeY()) / 2);
|
||||
for(cy = j; cy < j + dwSizeY; cy++)
|
||||
{
|
||||
for(cx = i; cx < i + dwSizeX; cx++)
|
||||
{
|
||||
arySpace[cy][cx] = 1;
|
||||
}
|
||||
}
|
||||
goto loopend;
|
||||
}
|
||||
}
|
||||
}
|
||||
loopend:;
|
||||
}
|
||||
}
|
||||
43
GameTools/NeoRylClient/AkhanTrade.h
Normal file
43
GameTools/NeoRylClient/AkhanTrade.h
Normal file
@@ -0,0 +1,43 @@
|
||||
// AkhanTrade.h: interface for the CAkhanTrade class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_AKHANTRADE_H__FE4BF087_F3A7_4BBA_B4EE_50975C9C2171__INCLUDED_)
|
||||
#define AFX_AKHANTRADE_H__FE4BF087_F3A7_4BBA_B4EE_50975C9C2171__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
#include "Creature\NPC\NPCList.h"
|
||||
#include <vector>
|
||||
#include "ItemInstance.h" // Added by ClassView
|
||||
|
||||
class CAkhanTrade : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CItemInstance *m_lpBuyItem;
|
||||
unsigned long m_dwBuyResult;
|
||||
unsigned long m_dwSellResult;
|
||||
void InitTradeWindow(LPNPCNode lpNpcNode);
|
||||
unsigned long m_dwKindTitle;
|
||||
unsigned long m_dwTradeTab;
|
||||
unsigned long m_dwItemNumber;
|
||||
BOOL m_bBalckMarket;
|
||||
|
||||
void DeleteTradeItem(void);
|
||||
vector<CItemInstance *> m_lstTradeItem;
|
||||
|
||||
void InitTrade(unsigned long dwNPCID);
|
||||
CAkhanTrade();
|
||||
~CAkhanTrade();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_AKHANTRADE_H__FE4BF087_F3A7_4BBA_B4EE_50975C9C2171__INCLUDED_)
|
||||
130
GameTools/NeoRylClient/AntiHack.h
Normal file
130
GameTools/NeoRylClient/AntiHack.h
Normal file
@@ -0,0 +1,130 @@
|
||||
#ifndef _ANTIHACK_H_
|
||||
#define _ANTIHACK_H_
|
||||
|
||||
#define MAX_HACKCOUNT 5
|
||||
|
||||
#define HACK0 0
|
||||
#define HACK1 0
|
||||
#define HACK2 0
|
||||
|
||||
#define XCHG( dwAddress ) (((DWORD) dwAddress) << 16) | (((DWORD) dwAddress) >> 16)
|
||||
|
||||
#pragma comment( lib, "version" )
|
||||
|
||||
#define DECLARE_ANTIHACK() CAntiHack g_AntiHack
|
||||
#define USE_ANTIHACK1() g_AntiHack.AntiDebug1();
|
||||
#define USE_ANTIHACK2(Func) g_AntiHack.AntiDebug2( XCHG( Func ) );
|
||||
#define USE_ANTIHACK3(Inst) g_AntiHack.AntiDebug3( Inst );
|
||||
|
||||
class CAntiHack
|
||||
{
|
||||
private:
|
||||
char m_szTmp[ MAX_PATH ];
|
||||
BOOL (WINAPI *pCall)( HINSTANCE hInstance );
|
||||
BOOL m_bAntiHack[ MAX_HACKCOUNT ];
|
||||
BOOL m_bWinNT;
|
||||
|
||||
public:
|
||||
CAntiHack()
|
||||
{
|
||||
for( int i=0; i < MAX_HACKCOUNT; i++ )
|
||||
m_bAntiHack[ i ] = TRUE;
|
||||
|
||||
OSVERSIONINFOEX osv;
|
||||
|
||||
osv.dwOSVersionInfoSize = sizeof( osv );
|
||||
GetVersionEx( (LPOSVERSIONINFO) &osv );
|
||||
m_bWinNT = (bool) ( osv.dwPlatformId == VER_PLATFORM_WIN32_NT );
|
||||
|
||||
HMODULE hKernel;
|
||||
|
||||
if( NULL == (hKernel = LoadLibrary( DecryptText( "KDPKAG-+&;BA" ))) ) // LoadLibrary( "KERNEL32.DLL" );
|
||||
return;
|
||||
BOOL (WINAPI *pIsDebuggerPresent)( void );
|
||||
pIsDebuggerPresent = GetProcAddress( (HMODULE) hKernel, DecryptText( "IrBb^pa`]iFgYfW_d" ) ); // GetProcAddress( "IsDebuggerPresent" );
|
||||
m_bAntiHack[HACK0] = pIsDebuggerPresent();
|
||||
FreeLibrary( hKernel );
|
||||
}
|
||||
|
||||
~CAntiHack()
|
||||
{
|
||||
}
|
||||
|
||||
void AntiDebug1( void )
|
||||
{
|
||||
#if USE_ANTIHACK == 1
|
||||
if( m_bAntiHack[HACK1] ) {
|
||||
MessageBox( NULL, "Please turn your Debugger off!", "ERROR", MB_OK );
|
||||
ExitProcess( 0 );
|
||||
}
|
||||
m_bAntiHack[ HACK1 ] = (CreateFileA( "\\[,YOD=>", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ) != INVALID_HANDLE_VALUE ); // \\.\SICE
|
||||
m_bAntiHack[ HACK2 ] = (CreateFileA( "\\[,YJOC<=", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 ) != INVALID_HANDLE_VALUE ); // \\.\NTICE
|
||||
#endif
|
||||
}
|
||||
|
||||
void AntiDebug2( DWORD dwAddress )
|
||||
{
|
||||
#if USE_ANTIHACK == 1
|
||||
if( m_bAntiHack[ HACK2 ] || m_bAntiHack[ HACK1 ] ) {
|
||||
WinExit( EWX_SHUTDOWN | EWX_FORCE );
|
||||
}
|
||||
#endif
|
||||
pCall = (BOOL (WINAPI *)( HINSTANCE )) (XCHG( dwAddress ));
|
||||
}
|
||||
|
||||
BOOL AntiDebug3( HINSTANCE hInstance )
|
||||
{
|
||||
return pCall( hInstance );
|
||||
}
|
||||
|
||||
protected:
|
||||
char *DecryptText( char *lpData )
|
||||
{
|
||||
strcpy( m_szTmp, lpData );
|
||||
Decrypt( (unsigned char *) m_szTmp, (DWORD) strlen( m_szTmp ) );
|
||||
return m_szTmp;
|
||||
}
|
||||
bool Encrypt( unsigned char *lpData, DWORD dwLength )
|
||||
{
|
||||
for( int i=0; i < (int) dwLength; i++ )
|
||||
*(lpData + i) -= i;
|
||||
return true;
|
||||
}
|
||||
bool Decrypt( unsigned char *lpData, DWORD dwLength )
|
||||
{
|
||||
for( int i=0; i < (int) dwLength; i++ )
|
||||
*(lpData + i) += i;
|
||||
return true;
|
||||
}
|
||||
BOOL SetPrivilege( unsigned char *name, BOOL bEnable )
|
||||
{
|
||||
BOOL bResult = FALSE;
|
||||
HANDLE hToken;
|
||||
DWORD dwRetLen;
|
||||
TOKEN_PRIVILEGES tpToken, tpPrev;
|
||||
|
||||
OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken );
|
||||
tpToken.PrivilegeCount = 1;
|
||||
if( LookupPrivilegeValue( NULL, (LPCSTR) name, &(tpToken.Privileges[0].Luid) ) == TRUE ) {
|
||||
if( bEnable )
|
||||
tpToken.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
||||
else
|
||||
tpToken.Privileges[0].Attributes = 0;
|
||||
dwRetLen = 0;
|
||||
bResult = AdjustTokenPrivileges( hToken, FALSE, &tpToken, sizeof( tpPrev ), &tpPrev, &dwRetLen );
|
||||
}
|
||||
CloseHandle( hToken );
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool WinExit( DWORD dwFlags )
|
||||
{
|
||||
if( SetPrivilege( (unsigned char *) "SeShutdownPrivilege", TRUE ) ) {
|
||||
ExitWindowsEx( dwFlags, 0 );
|
||||
SetPrivilege( (unsigned char *) "SeShutdownPrivilege", FALSE );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
2175
GameTools/NeoRylClient/BaseGUI.cpp
Normal file
2175
GameTools/NeoRylClient/BaseGUI.cpp
Normal file
File diff suppressed because it is too large
Load Diff
229
GameTools/NeoRylClient/BaseGUI.h
Normal file
229
GameTools/NeoRylClient/BaseGUI.h
Normal file
@@ -0,0 +1,229 @@
|
||||
// BaseGUI.h: interface for the CBaseGUI class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_BASEGUI_H__3E9B914A_483F_4DBB_A374_227D1CAAC19F__INCLUDED_)
|
||||
#define AFX_BASEGUI_H__3E9B914A_483F_4DBB_A374_227D1CAAC19F__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <Texture.h>
|
||||
#include "GUIWindow.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define POPUP_NORMAL 1
|
||||
#define POPUP_GUARD 2
|
||||
#define POPUP_NOBIND 3
|
||||
|
||||
#define POPUP_WEAPONMERCHANT 11
|
||||
#define POPUP_ARMOURMERCHANT 12
|
||||
#define POPUP_ETCMERCHANT 13
|
||||
|
||||
#define POPUP_WEAPONNARMOURMERCHANT 14
|
||||
|
||||
#define POPUP_DARKWEAPONMERCHANT 16
|
||||
#define POPUP_DARKARMOURMERCHANT 17
|
||||
#define POPUP_DARKETCMERCHANT 18
|
||||
|
||||
#define POPUP_BLACKSMITH 21
|
||||
|
||||
#define POPUP_COUNSELLER 26
|
||||
|
||||
#define POPUP_ADVENTURETRAINER 31
|
||||
#define POPUP_FIGHTERTRAINER 32
|
||||
#define POPUP_ROGUETRAINER 33
|
||||
#define POPUP_MAGETRAINER 34
|
||||
#define POPUP_ACOLYTETRAINER 35
|
||||
|
||||
#define POPUP_TELEPORTER 41
|
||||
#define POPUP_PEACEGUILD 42
|
||||
#define POPUP_CONTAINER 43
|
||||
|
||||
#define POPUP_A_NORMAL 51
|
||||
#define POPUP_A_GUARD 52
|
||||
#define POPUP_A_NOBIND 53
|
||||
|
||||
#define POPUP_A_WEAPONMERCHANT 61
|
||||
#define POPUP_A_ARMOURMERCHANT 62
|
||||
#define POPUP_A_ETCMERCHANT 63
|
||||
|
||||
#define POPUP_A_DARKWEAPONMERCHANT 66
|
||||
#define POPUP_A_DARKARMOURMERCHANT 67
|
||||
#define POPUP_A_DARKETCMERCHANT 68
|
||||
|
||||
#define POPUP_A_BLACKSMITH 71
|
||||
|
||||
#define POPUP_A_COUNSELLER 76
|
||||
|
||||
#define POPUP_A_BEGINNERTRAINER 81
|
||||
#define POPUP_A_COMBATANTTRAINER 82
|
||||
#define POPUP_A_OPPICATERTRAINER 83
|
||||
|
||||
#define POPUP_A_TELEPORTER 91
|
||||
#define POPUP_A_PEACEGUILD 92
|
||||
#define POPUP_A_CONTAINER 93
|
||||
|
||||
#define POPUP_PC 100
|
||||
#define POPUP_LEADER 101
|
||||
#define POPUP_MEMBER 102
|
||||
|
||||
|
||||
#define POPUPMENU_EXCHANGE 0
|
||||
#define POPUPMENU_DUEL 1
|
||||
#define POPUPMENU_PARTYINVATE 2
|
||||
#define POPUPMENU_STREETSTALL 3
|
||||
#define POPUPMENU_LEADER 4
|
||||
#define POPUPMENU_VANISH 5
|
||||
#define POPUPMENU_DIALOG 6
|
||||
#define POPUPMENU_SAVEPOS 7
|
||||
#define POPUPMENU_TRADE 8
|
||||
#define POPUPMENU_UPGRADE 9
|
||||
#define POPUPMENU_UNLOCK 10
|
||||
#define POPUPMENU_JOBCHANGE 11
|
||||
#define POPUPMENU_ZONEMOVE 12
|
||||
#define POPUPMENU_DIALOG2 13
|
||||
#define POPUPMENU_DEPOSIT 14
|
||||
#define POPUPMENU_PARTYDUEL 15
|
||||
#define POPUPMENU_QUEST 16
|
||||
#define POPUPMENU_FRIEND 17
|
||||
#define POPUPMENU_BAN 18
|
||||
#define POPUPMENU_PEACE 19
|
||||
|
||||
|
||||
#define CHRSELECT_SELECT 0
|
||||
#define CHRSELECT_START 1
|
||||
#define CHRSELECT_CREATE 2
|
||||
#define CHRSELECT_INITSELECT 3
|
||||
#define CHRSELECT_INITSTART 4
|
||||
#define CHRSELECT_INITCREATE 5
|
||||
|
||||
#define GAME_LOADING 6
|
||||
#define GAME_PLAYING 7
|
||||
#define GAME_END 8
|
||||
|
||||
typedef struct PopupMenu
|
||||
{
|
||||
unsigned long m_dwPopupKind;
|
||||
char m_strPopupStr[MAX_PATH];
|
||||
unsigned long m_dwQuestID;
|
||||
} PopupMenu;
|
||||
|
||||
class CBaseGUI
|
||||
{
|
||||
public:
|
||||
void RenderChant(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
BOOL InitZone(unsigned long dwZoneNumber);
|
||||
void ProcessSkill(void);
|
||||
void RenderCrossHair(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned long dwMode);
|
||||
|
||||
static void PickItem(DWORD nSelectItem);
|
||||
void RenderChrName(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned long dwUID, short wPosX, short wPosY);
|
||||
void RenderSkillGauge(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
BOOL SelectNPC(unsigned long dwTargetID, BOOL bButton = FALSE);
|
||||
void NPCSpawn(void);
|
||||
unsigned long m_dwKindMarket;
|
||||
BOOL UpdatePopup(void);
|
||||
unsigned long m_dwKindPos;
|
||||
unsigned long m_dwPopupSelect;
|
||||
|
||||
PopupMenu m_pmPopupMenu[20];
|
||||
// char m_strPopupMenu[6][MAX_PATH];
|
||||
int m_nPopupWindowY;
|
||||
int m_nPopupWindowX;
|
||||
|
||||
unsigned long m_dwNormalTargetChrID;
|
||||
unsigned long m_dwSpecialTargetChrID;
|
||||
unsigned long m_dwRangedWeaponTargetChrID;
|
||||
|
||||
unsigned long m_dwPopupWindowLength;
|
||||
unsigned long m_dwPopupMenu;
|
||||
BOOL m_bPopupShow;
|
||||
unsigned long m_dwPopupSelectChrID;
|
||||
unsigned long m_dwKindPopup;
|
||||
vector<CTexture *> m_lstTexture;
|
||||
vector<CGUIWindow *> m_lstWindow;
|
||||
|
||||
BOOL m_bQuickWeaponExchange;
|
||||
BOOL m_bWeaponExchageAble;
|
||||
float m_fWeaponExchageAbleTimeCounter;
|
||||
|
||||
BOOL m_bExchange;
|
||||
unsigned long m_dwExchangeCmdResult;
|
||||
unsigned long m_dwExchangeCmdSenderID;
|
||||
unsigned long m_dwExchangeCmdType;
|
||||
|
||||
unsigned long m_dwDuelCmdResult;
|
||||
unsigned long m_dwDuelCmdSenderID;
|
||||
unsigned long m_dwDuelCmdType;
|
||||
|
||||
unsigned long m_dwPartyDuelCmdResult;
|
||||
unsigned long m_dwPartyDuelCmdSenderID;
|
||||
unsigned long m_dwPartyDuelCmdType;
|
||||
|
||||
unsigned long m_dwPartyCmdResult;
|
||||
unsigned long m_dwPartyCmdType;
|
||||
unsigned long m_dwPartyCmdSenderID;
|
||||
|
||||
CSprite *m_lpSkillGaugeFrame;
|
||||
CSprite *m_lpSkillGauge[5];
|
||||
CSprite *m_lpTarget[2];
|
||||
CSprite *m_lpHPGauge;
|
||||
CSprite *m_lpQuiver;
|
||||
CSprite *m_lpChant[42];
|
||||
|
||||
CTexture *m_lpChrButtonTexture;
|
||||
CTexture *m_lpPopupTexture;
|
||||
CTexture *m_lpSocket;
|
||||
CTexture *m_lpCommonWindow;
|
||||
CTexture *m_lpChantIcon;
|
||||
|
||||
list<unsigned long> m_lstDeleteChr;
|
||||
unsigned long m_dwSpendTime[6];
|
||||
|
||||
BOOL m_bClickButton;
|
||||
BOOL m_bShowHelp;
|
||||
BOOL m_bShowSkillError;
|
||||
|
||||
void RenderChrButton(LPDIRECT3DDEVICE8 lpD3DDevice, char *strText, short wPosX, short wPosY);
|
||||
void RenderChrButton(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned long dwUID, short wPosX, short wPosY);
|
||||
void RenderPopUp(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
|
||||
void DestroyAllObject(void);
|
||||
|
||||
CBaseGUI();
|
||||
virtual ~CBaseGUI();
|
||||
|
||||
virtual BOOL InitChrSelect(void) = 0;
|
||||
virtual void UpdateChrSelect(void) = 0;
|
||||
virtual void RenderChrSelect(LPDIRECT3DDEVICE8 lpD3DDevice) = 0;
|
||||
virtual BOOL InitGame(void) = 0;
|
||||
virtual void UpdateGame(void) = 0;
|
||||
virtual void RenderGame(LPDIRECT3DDEVICE8 lpD3DDevice) = 0;
|
||||
virtual void InitTrade(unsigned long dwKindMarket, unsigned long dwNPCID) = 0;
|
||||
virtual BOOL GetIsTrade(void) = 0;
|
||||
virtual void InitClassChange(unsigned long dwNPCID) = 0;
|
||||
virtual void ProcessExchangeCmd(unsigned long dwSenderID, unsigned short wCmd) = 0;
|
||||
virtual void InitPos(CItemInstance *lpItem) = 0;
|
||||
virtual BOOL GetIsExchange(void) = 0;
|
||||
// virtual BOOL StartSkill(void);
|
||||
virtual BOOL InitPopup(unsigned long dwKindPopup, unsigned long dwUID, unsigned long dwKindPos) = 0;
|
||||
virtual void InitSkillUnLock(unsigned long dwNPCID) = 0;
|
||||
virtual void InitChannel(unsigned char cChannelNum, unsigned short *lpChannel) = 0;
|
||||
virtual void InitRespawn(unsigned char cZoneNum) = 0;
|
||||
virtual BOOL GetIsRespawn(void) = 0;
|
||||
virtual void DestroyRespawn(void) = 0;
|
||||
virtual BOOL GetEnableChat(void) = 0;
|
||||
virtual void InitDeposit(void) = 0;
|
||||
virtual void ShowWindow(unsigned long dwWindowNum) = 0;
|
||||
virtual BOOL GetBusy(void) = 0;
|
||||
virtual BOOL GetIsBlackMarket(void) = 0;
|
||||
virtual void InitStreetStall(unsigned long dwChrID, char *lpstrStreetName) = 0;
|
||||
virtual void InitQuest(unsigned long dwChrID, unsigned long dwQuestID) = 0;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_BASEGUI_H__3E9B914A_483F_4DBB_A374_227D1CAAC19F__INCLUDED_)
|
||||
3596
GameTools/NeoRylClient/CharStatus.cpp
Normal file
3596
GameTools/NeoRylClient/CharStatus.cpp
Normal file
File diff suppressed because it is too large
Load Diff
225
GameTools/NeoRylClient/CharStatus.h
Normal file
225
GameTools/NeoRylClient/CharStatus.h
Normal file
@@ -0,0 +1,225 @@
|
||||
// CharStatus.h: interface for the CCharStatus class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CHARSTATUS_H__E6A8A3B4_7211_4E9F_85BE_2C83B5D9BC51__INCLUDED_)
|
||||
#define AFX_CHARSTATUS_H__E6A8A3B4_7211_4E9F_85BE_2C83B5D9BC51__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ItemInstance.h"
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
//#include "DefaultDef.h"
|
||||
#include "DB\DBdefine.h"
|
||||
|
||||
#include "..\\GlobalScript\\Creature\\NPC\\NPCList.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define ITEM_FAILED 0xFFFFFFFFFFFFFFFF
|
||||
#define ITEM_EMPTY 0xFEFFFFFFFFFFFFFF
|
||||
|
||||
#define STATUS_STR 0
|
||||
#define STATUS_DEX 1
|
||||
#define STATUS_CON 2
|
||||
#define STATUS_INT 3
|
||||
#define STATUS_WIS 4
|
||||
|
||||
typedef struct _FieldInstance : public FieldObject {
|
||||
unsigned long m_dwInstanceID;
|
||||
long m_lLifeTick;
|
||||
} FieldInstance, *LPFieldInstance;
|
||||
|
||||
typedef struct QuestInstance
|
||||
{
|
||||
unsigned long m_dwQuestID;
|
||||
unsigned long m_dwPresentPhase;
|
||||
vector<unsigned long> m_lstTriggerCount;
|
||||
LPQuestNode m_lpQuestScript;
|
||||
LPPhaseNode m_lpPhaseScript;
|
||||
|
||||
BOOL StartPhase(unsigned long dwPhase);
|
||||
BOOL StartTrigger(LPTriggerNode lpTrigger, BOOL bSuccess);
|
||||
|
||||
BOOL EventPhase(unsigned long dwPhase);
|
||||
BOOL EventMsgBox(char *strWord);
|
||||
} QuestInstance, *LPQuestInstance;
|
||||
|
||||
class CCharStatus
|
||||
{
|
||||
public:
|
||||
LPTriggerNode GetTriggertoGeton(LPQuestInstance lpQuest, unsigned long *dwCount, vector3 vecPos);
|
||||
LPTriggerNode GetTriggertoTalk(LPQuestInstance &lpQuest, unsigned long *dwCount, unsigned long dwChrID);
|
||||
LPQuestInstance GetProcessQuest(unsigned short wQuestID);
|
||||
BOOL GetCorrectClass(unsigned long dwClassFlag);
|
||||
void ChantDisable(void);
|
||||
void PayDepositPrice(unsigned short wSrcPos, unsigned short wDstPos);
|
||||
void Destroy(void);
|
||||
BOOL CheckStatus(void);
|
||||
void SetActivateSkill(CItemInstance *lpUseSkill);
|
||||
BOOL CheckUseSkill(void);
|
||||
BOOL GetExistExchangeItem(void);
|
||||
BOOL CheckItemByStatus(CItemInstance *lpItem);
|
||||
void SetQuickSlot(CItemInstance *lpItem);
|
||||
BOOL SetQuickSlotItemNumber(CItemInstance *lpItem);
|
||||
unsigned long CheckUsePotion(CItemInstance *lpItem);
|
||||
unsigned long CheckUseSkillBook(CItemInstance *lpItem);
|
||||
long GetUseIP(unsigned long dwKindStatus);
|
||||
unsigned long IsCheckClassforSkill(unsigned short wSkill);
|
||||
BOOL IsCheckStatusforSkill(unsigned short wSkill);
|
||||
BOOL CheckPartyMember(unsigned long dwChrID);
|
||||
BOOL GetIsInstallSocket(CItemInstance *lpEquipItem, CItemInstance *lpSocketItem);
|
||||
char *LogoutPartyPlayer(unsigned long dwChrID);
|
||||
char *LoginPartyPlayer(unsigned long dwChrID, unsigned long dwServerID);
|
||||
void AddPartyPlayer(unsigned long dwChrID, unsigned long dwServerID, char *strName);
|
||||
void DeletePartyPlayer(unsigned long dwChrID);
|
||||
void DestroyParty(void);
|
||||
SKILLSLOT *GetSkillSlot(unsigned short wSkill);
|
||||
|
||||
void AddEquipItem(unsigned long dwPos, CItemInstance *AddItem, BOOL bSound = TRUE);
|
||||
void AddInventoryItem(CItemInstance *AddItem, BOOL bSound = TRUE);
|
||||
void AddDepositItem(CItemInstance *AddItem, BOOL bSound = TRUE);
|
||||
void AddExchangeItem(CItemInstance *AddItem, BOOL bSelf = TRUE, BOOL bSound = TRUE);
|
||||
void AddStreetTradeItem(CItemInstance *AddItem, BOOL bSound = TRUE);
|
||||
|
||||
void DeleteInventoryItem(CItemInstance *lpDelete);
|
||||
void DeleteDepositItem(CItemInstance *lpDelete);
|
||||
void DeleteExchangeItem(CItemInstance *lpDelete, BOOL bSelf = TRUE);
|
||||
void DeleteStreetTradeItem(CItemInstance *lpDelete);
|
||||
|
||||
void CheckInvenField(unsigned long dwCommand, CItemInstance *lpItem);
|
||||
void CheckDepositField(unsigned long dwCommand, CItemInstance *lpItem);
|
||||
void CheckExchangeField(unsigned long dwCommand, CItemInstance *lpItem, BOOL bSelf = TRUE);
|
||||
void CheckStreetTradeField(unsigned long dwCommand, CItemInstance *lpItem);
|
||||
|
||||
CItemInstance *GetInventoryItemfromID(unsigned short wProtoTypeID);
|
||||
CItemInstance *GetInventoryItem(Item::ItemPos &pIndex);
|
||||
CItemInstance *GetInventoryItem(unsigned short wIndex);
|
||||
CItemInstance *GetInventoryItem(__int64 ddItemUID);
|
||||
CItemInstance *GetExchangeItemfromID(unsigned short wProtoTypeID, BOOL bSelf = TRUE);
|
||||
CItemInstance *GetExchangeItem(Item::ItemPos &pIndex, BOOL bSelf = TRUE);
|
||||
CItemInstance *GetExchangeItem(unsigned short wIndex, BOOL bSelf = TRUE);
|
||||
CItemInstance *GetExchangeItem(__int64 ddItemUID, BOOL bSelf = TRUE);
|
||||
CItemInstance *GetDepositItemfromID(unsigned short wProtoTypeID);
|
||||
CItemInstance *GetDepositItem(Item::ItemPos &pIndex);
|
||||
CItemInstance *GetDepositItem(unsigned short wIndex);
|
||||
CItemInstance *GetDepositItem(__int64 ddItemUID);
|
||||
CItemInstance *GetStreetTradeItemfromID(unsigned short wProtoTypeID);
|
||||
CItemInstance *GetStreetTradeItem(Item::ItemPos &pIndex);
|
||||
CItemInstance *GetStreetTradeItem(unsigned short wIndex);
|
||||
CItemInstance *GetStreetTradeItem(__int64 ddItemUID);
|
||||
|
||||
BOOL AddFriend(unsigned long dwChrID, char *strName);
|
||||
BOOL AddBan(unsigned long dwChrID, char *strName);
|
||||
BOOL DeleteFriend(unsigned long dwChrID);
|
||||
BOOL DeleteBan(unsigned long dwChrID);
|
||||
BOOL GetIsFriend(unsigned long dwChrID);
|
||||
BOOL GetIsBan(unsigned long dwChrID);
|
||||
FriendInfo *GetFriend(unsigned long dwChrID);
|
||||
FriendInfo *GetFriendtoNum(unsigned long dwNum);
|
||||
BanInfo *GetBantoNum(unsigned long dwNum);
|
||||
|
||||
unsigned short GetSkillIDbyChantID(unsigned char cChant);
|
||||
void SetClassSkill(void);
|
||||
|
||||
BOOL DeleteQuest(LPQuestInstance lpDeleteQuest);
|
||||
|
||||
CHAR_INFOST m_Info;
|
||||
// 전직시 이전의 스테이스 저장
|
||||
CHAR_INFOST m_BeforeInfo;
|
||||
|
||||
CHAR_POS m_InfoPos;
|
||||
SKILL m_Skill;
|
||||
PARTY m_PartyInfo;
|
||||
|
||||
BOOL m_bUseChant;
|
||||
BOOL m_bRangedWeapon;
|
||||
|
||||
unsigned short m_aryEnchantLevel[32];
|
||||
|
||||
vector<CItemInstance *> m_lstClassSkill;
|
||||
CItemInstance *m_lpUpgrade[2];
|
||||
CItemInstance *m_lpQuickSelected;
|
||||
CItemInstance *m_lstEquipment[15];
|
||||
CItemInstance *m_lstQuickSlot[10];
|
||||
CItemInstance *m_lstSkillSlot[20];
|
||||
list<CItemInstance *> m_lstInventory;
|
||||
|
||||
list<FriendInfo *> m_lstFriendList;
|
||||
list<BanInfo *> m_lstBanList;
|
||||
|
||||
list<CItemInstance *> m_lstDeposit;
|
||||
__int64 m_aryDeposit[4][12][8];
|
||||
unsigned long m_dwDepositGold;
|
||||
char m_cSavePass, m_cUsedDeposit;
|
||||
unsigned long m_dwDepositFlag;
|
||||
unsigned long m_dwMaxTab;
|
||||
|
||||
list<CItemInstance *> m_lstStreetTrade;
|
||||
__int64 m_aryStreetTrade[8][8];
|
||||
|
||||
list<CItemInstance *> m_lstExchange;
|
||||
list<CItemInstance *> m_lstExchange2;
|
||||
__int64 m_aryExchange[4][8];
|
||||
__int64 m_aryExchange2[4][8];
|
||||
unsigned long m_dwExchangeGold;
|
||||
unsigned long m_dwExchange2Gold;
|
||||
|
||||
unsigned long m_dwSelectQuickslot;
|
||||
__int64 m_aryInven[3][6][6];
|
||||
char m_cWeaponPos;
|
||||
|
||||
list<LPQuestInstance> m_lstQuest;
|
||||
|
||||
__int64 m_llExpMax;
|
||||
|
||||
int m_MaxHP;
|
||||
int m_MaxMP;
|
||||
|
||||
long m_lRealMinDamage;
|
||||
long m_lRealMaxDamage;
|
||||
long m_lRealDefensePower;
|
||||
float m_fRealBlockPercent;
|
||||
|
||||
long m_lMinDamage;
|
||||
long m_lMaxDamage;
|
||||
long m_lDefensePower;
|
||||
long m_lAttackRevision;
|
||||
long m_lDefenseRevision;
|
||||
long m_lCriticalPercent;
|
||||
float m_fBlockPercent;
|
||||
long m_lMagicResistance;
|
||||
|
||||
long m_lAddMaxHP;
|
||||
long m_lAddMaxMP;
|
||||
long m_lAddSTR;
|
||||
long m_lAddDEX;
|
||||
long m_lAddCON;
|
||||
long m_lAddINT;
|
||||
long m_lAddWIS;
|
||||
|
||||
long m_lPotionCoolDownTime;
|
||||
|
||||
CCharStatus();
|
||||
~CCharStatus();
|
||||
|
||||
void StatusUpdate();
|
||||
|
||||
/* void Backup()
|
||||
{
|
||||
memcpy(&m_BackupItem,&m_Item,sizeof(CHAR_ITEM));
|
||||
}
|
||||
void Restore()
|
||||
{
|
||||
memcpy(&m_Item,&m_BackupItem,sizeof(CHAR_ITEM));
|
||||
}*/
|
||||
|
||||
__int64 IsCheckItem(CItemInstance *lpItem, unsigned long dwPos, unsigned long dwInvenX, unsigned long dwInvenY = 0, unsigned long dwInvenTab = 0);
|
||||
unsigned char GetAbleInven(LPFieldInstance lpFieldInstance, Item::ItemPos &pItemIndex, BOOL bStack = TRUE);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_CHARSTATUS_H__E6A8A3B4_7211_4E9F_85BE_2C83B5D9BC51__INCLUDED_)
|
||||
3114
GameTools/NeoRylClient/ClientMain.cpp
Normal file
3114
GameTools/NeoRylClient/ClientMain.cpp
Normal file
File diff suppressed because it is too large
Load Diff
233
GameTools/NeoRylClient/ClientMain.h
Normal file
233
GameTools/NeoRylClient/ClientMain.h
Normal file
@@ -0,0 +1,233 @@
|
||||
// ClientMain.h: interface for the CClientMain class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_CLIENTMAIN_H__5547537B_9A6B_4077_96C4_62EAB9D06E84__INCLUDED_)
|
||||
#define AFX_CLIENTMAIN_H__5547537B_9A6B_4077_96C4_62EAB9D06E84__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "Network.h"
|
||||
#include "BaseGraphicsLayer.h"
|
||||
#include "SceneManager.h"
|
||||
#include "BaseGUI.h"
|
||||
#include "StringTable.h"
|
||||
#include "CommonInterface.h"
|
||||
#include "CharStatus.h"
|
||||
#include "CharacterControl.h"
|
||||
#include <list>
|
||||
|
||||
#define CLIENT_LOGO 0
|
||||
#define CLIENT_MAIN 1
|
||||
#define CLIENT_NATIONSELECT 2
|
||||
#define CLIENT_CHARACTERSELECT 3
|
||||
#define CLIENT_GAME 4
|
||||
#define CLIENT_END 5
|
||||
#define CLIENT_CHARACTERSELECTLOADING 6
|
||||
#define CLIENT_GAMELOADING 7
|
||||
#define CLIENT_ZONEMOVE 8
|
||||
|
||||
#define NATION_HUMAN 0
|
||||
#define NATION_AKHAN 1
|
||||
#define NATION_UNKNONE 2
|
||||
|
||||
#define CURSOR_NORMAL 0
|
||||
#define CURSOR_CLICK 1
|
||||
#define CURSOR_PICKUP 2
|
||||
#define CURSOR_ATTACK 3
|
||||
#define CURSOR_DIALOG 4
|
||||
#define CURSOR_REPAIR 5
|
||||
#define CURSOR_TOOLTIP 6
|
||||
#define CURSOR_POPUP 7
|
||||
|
||||
#define WriteLog(s) WriteLogtoFile(s, __FILE__, __LINE__)
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CClientMain
|
||||
{
|
||||
public:
|
||||
void ProjectPt( D3DXVECTOR3 *V, float *xScreen, float *yScreen );
|
||||
void SetTipBroadTimer(long lTimer);
|
||||
void SetSkillCoolDown(unsigned short wSkill);
|
||||
void ResetTerrain(void);
|
||||
void PrintException(EXCEPTION_RECORD &SavedExceptRec, CONTEXT &SavedContext);
|
||||
void SetSkillClearCoolDown(void);
|
||||
void SetPotionCoolDown(void);
|
||||
void SetSkillCoolDown(unsigned short wGrade, unsigned char cEndCooldown);
|
||||
void WriteLogtoFile(const char *strLog, const char *strFileName, int nLine);
|
||||
void ProcessScreenshot(void);
|
||||
void RenderMain(void);
|
||||
static vector3 GetMonsterMinBox(unsigned long dwChrID);
|
||||
static vector3 GetMonsterMaxBox(unsigned long dwChrID);
|
||||
static void SetChangeWeapon(BOOL bChangeWeapon);
|
||||
static void SetAutoRun(BOOL bAutoRun);
|
||||
static BOOL GetAutoRun(void);
|
||||
static void CheckTargetforSkill(unsigned long &dwTargetID, BOOL bCheckLength);
|
||||
static void SetKillCounter(long lKillCounter);
|
||||
static BOOL CheckAttackable(void);
|
||||
unsigned long GetScreenPosChr(POINT &Point, int nMode, float fLength);
|
||||
DWORD m_dwSoundTickCount;
|
||||
ISoundObject *m_CheckSoundBuffer;
|
||||
bool CheckSoundBufferSpeedHack();
|
||||
BOOL GetSpeedHack(void);
|
||||
static char *GetMotionSheet(char *strWeaponName, char *strShieldName, unsigned short wClass);
|
||||
static unsigned long GetWeaponType(char *strWeaponName);
|
||||
static char m_strSheet[MAX_PATH];
|
||||
static BOOL CheckSkillStart(BOOL bDown);
|
||||
static BOOL CheckStillCasting(unsigned long &dwFunction);
|
||||
static void ChangeWeapon(void);
|
||||
BOOL GetChangeWeapon(void);
|
||||
|
||||
void SetPickItem(CItemInstance *lpItem, BOOL bSound = TRUE);
|
||||
|
||||
LPFieldInstance GetFieldObject(unsigned long dwFieldInstanceID);
|
||||
void DeleteFieldObject(unsigned long dwFieldInstanceID);
|
||||
void AddFieldObject(LPFieldObject lpObject);
|
||||
void SetDayTimer(void);
|
||||
BOOL CreateNationInterface(unsigned long dwNation);
|
||||
void EnterClient(void);
|
||||
void Destroy(void);
|
||||
HINSTANCE m_hInstance;
|
||||
HWND m_hWnd;
|
||||
char m_strClientPath[MAX_PATH];
|
||||
char m_strIP[MAX_PATH];
|
||||
unsigned long m_dwUserID, m_dwSessionID, m_dwChannelID, m_dwVersion, m_dwServerID;
|
||||
float m_fClientVersion;
|
||||
unsigned long m_dwClientMode;
|
||||
unsigned long m_dwClientNation;
|
||||
|
||||
unsigned long m_nShowInterfaceTimerID;
|
||||
unsigned long m_nSceneManagerTimerID;
|
||||
// unsigned long m_nSystemUpdateTimerID;
|
||||
unsigned long m_nWeatherTimerID;
|
||||
unsigned long m_dwServerTime;
|
||||
unsigned long m_dwStartTime;
|
||||
unsigned long m_dwPartyInfoTimerID;
|
||||
unsigned long m_dwSpeedHackCheckTimerID;
|
||||
unsigned long m_dwUpdateAddressTimerID;
|
||||
unsigned long m_dwUpdateFlushTimerID;
|
||||
unsigned long m_dwCheckStatusTimerID;
|
||||
unsigned long m_dwPingTimerID;
|
||||
|
||||
unsigned long m_dwNumScreenShot;
|
||||
unsigned long m_dwFunction;
|
||||
|
||||
BOOL m_bShowInfo;
|
||||
BOOL m_bUpdateMove;
|
||||
BOOL m_bMovieVersion;
|
||||
|
||||
unsigned long m_dwInternationalCode;
|
||||
BOOL m_bTestServerVersion;
|
||||
BOOL m_bAdminMode;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Game Data
|
||||
unsigned long m_dwStartQuickSlot;
|
||||
unsigned long m_dwMyChrID; // 내 캐릭터 ID
|
||||
vector3 m_vecStartPosition;
|
||||
CCharStatus m_csStatus;
|
||||
BOOL m_bMouseMode;
|
||||
BOOL m_bAutoRunMode;
|
||||
BOOL m_bSimpleMode;
|
||||
unsigned long m_dwTradingNpcID;
|
||||
unsigned long m_dwCursorTimer;
|
||||
BOOL m_bCursorToggle;
|
||||
BOOL m_bHardwareCursor;
|
||||
BOOL m_bShowCursor;
|
||||
BOOL m_bSystemConsoleShow;
|
||||
unsigned long m_dwKindCursor;
|
||||
unsigned long m_dwMessageBoxResult;
|
||||
char m_strRecentChatChrID[MAX_PATH];
|
||||
char m_strWhisperChrID[MAX_PATH];
|
||||
BOOL m_bInstanceWhisper;
|
||||
BOOL m_bTargetMouseMode;
|
||||
BOOL m_bChangeWeapon;
|
||||
BOOL m_bInterfaceAlreadyLoad;
|
||||
BOOL m_bStreetStallEnter;
|
||||
|
||||
long m_lTipBroadCounterSeed;
|
||||
long m_lTipBroadCounter;
|
||||
vector<char *> m_lstTipBroad;
|
||||
|
||||
long m_lKillCounter;
|
||||
unsigned long m_dwPresentZone;
|
||||
unsigned long m_dwNextZone;
|
||||
|
||||
unsigned long m_dwRespawnResult;
|
||||
|
||||
unsigned long m_dwPeaceModeResult;
|
||||
unsigned long m_dwPeaceMode;
|
||||
|
||||
unsigned long m_dwAuthorizeResult;
|
||||
unsigned long m_dwAuthorizeCasterID;
|
||||
unsigned char m_cAuthorizeCmd;
|
||||
|
||||
unsigned long m_dwFriendResult;
|
||||
char m_strFriendName[MAX_PATH];
|
||||
|
||||
bool m_bPeaceMode;
|
||||
RejectOption m_roOption;
|
||||
BOOL m_bPartyFind;
|
||||
BOOL m_bPartyPlayerFind;
|
||||
unsigned char m_cNumMember;
|
||||
unsigned char m_cNumParty;
|
||||
char m_cEliteNation;
|
||||
unsigned char m_cEliteLevel;
|
||||
MemberFindParty m_mfpMember[30];
|
||||
PartyFindMember m_pfmParty[30];
|
||||
unsigned long m_dwSelectMemberSlot;
|
||||
unsigned long m_dwSelectPartySlot;
|
||||
|
||||
char m_strChatMessage[3][MAX_PATH]; // 도배 방지
|
||||
|
||||
CItemInstance *m_lpPickItem;
|
||||
|
||||
list<LPFieldInstance> m_lstFieldItem;
|
||||
CEffScript *m_ClassEffectPtr; // 전직 이팩트 스크립트 pointer
|
||||
int m_ClassEffectAlpha; // 전직 이팩트시 나오는 글자의 alpha value
|
||||
|
||||
CEffScript *m_pEnemySelectEff;
|
||||
CEffScript *m_pEnemySkillSelectEff;
|
||||
CEffScript *m_pPlayerSelectEff;
|
||||
CEffScript *m_pPlayerSkillSelectEff;
|
||||
|
||||
ISoundObject *m_lpBackGroundMusic;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Login
|
||||
CHAR_VIEW m_scLoginChar[3]; // 로그인 캐릭터 정보(3명)
|
||||
vector3 m_vecCharSelectPos[3];
|
||||
unsigned long m_dwSelectChr;
|
||||
unsigned long m_dwClientState;
|
||||
BOOL m_bCreateChar;
|
||||
BOOL m_bDeleteChar;
|
||||
BOOL m_bSelectChar;
|
||||
BOOL m_bGameStartState[2];
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CInitValue m_InitValue; // Init Value Class /Video,Adapter,Mode/
|
||||
BaseGraphicsLayer m_BaseGraphicLayer; // BaseGraphics Layer Class
|
||||
CSceneManager *m_lpSceneManager; // SceneManager Class
|
||||
CNetwork m_Network; // Network
|
||||
CBaseGUI *m_lpInterface;
|
||||
CCommonInterface *m_lpCommonInterface;
|
||||
|
||||
BOOL Init(HINSTANCE hInstance);
|
||||
void Update(void);
|
||||
void ProcessLogin(void);
|
||||
void Render(void);
|
||||
// void ResetTerrain(void);
|
||||
unsigned long ClientProc(HWND hWnd, unsigned int uMsg, WPARAM wParam, LPARAM lParam);
|
||||
void SetFocus(void) { ::SetFocus(m_hWnd); }
|
||||
CClientMain(void);
|
||||
~CClientMain(void);
|
||||
};
|
||||
|
||||
extern CClientMain g_ClientMain;
|
||||
extern CCharacterControl g_CharacterData;
|
||||
|
||||
#endif // !defined(AFX_CLIENTMAIN_H__5547537B_9A6B_4077_96C4_62EAB9D06E84__INCLUDED_)
|
||||
23
GameTools/NeoRylClient/Common.h
Normal file
23
GameTools/NeoRylClient/Common.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _COMMON_H_
|
||||
#define _COMMON_H_
|
||||
|
||||
#ifndef _QWORD_DEFINED
|
||||
#define _QWORD_DEFINED
|
||||
typedef __int64 QWORD, *LPQWORD;
|
||||
#endif
|
||||
|
||||
#define MAKEQWORD(a, b) \
|
||||
((QWORD)( ((QWORD) ((DWORD) (a))) << 32 | ((DWORD) (b))))
|
||||
|
||||
#define LODWORD(l) \
|
||||
((DWORD)(l))
|
||||
#define HIDWORD(l) \
|
||||
((DWORD)(((QWORD)(l) >> 32) & 0xFFFFFFFF))
|
||||
|
||||
// Read 4K of data at a time (used in the C++ streams, Win32 I/O, and assembly functions)
|
||||
#define MAX_BUFFER_SIZE 4096
|
||||
|
||||
// Map a "view" size of 10MB (used in the filemap function)
|
||||
#define MAX_VIEW_SIZE 10485760
|
||||
|
||||
#endif
|
||||
1332
GameTools/NeoRylClient/CommonInterface.cpp
Normal file
1332
GameTools/NeoRylClient/CommonInterface.cpp
Normal file
File diff suppressed because it is too large
Load Diff
108
GameTools/NeoRylClient/CommonInterface.h
Normal file
108
GameTools/NeoRylClient/CommonInterface.h
Normal file
@@ -0,0 +1,108 @@
|
||||
// CommonInterface.h: interface for the CCommonInterface class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_COMMONINTERFACE_H__A2DB72A2_BB7E_451E_87A3_2BA37A643318__INCLUDED_)
|
||||
#define AFX_COMMONINTERFACE_H__A2DB72A2_BB7E_451E_87A3_2BA37A643318__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
#include "Sprite.h"
|
||||
#include "GUIButton.h"
|
||||
#include "GUITooltipButton.h"
|
||||
#include "GUIScroll.h"
|
||||
|
||||
#define FADE_IN 0
|
||||
#define FADE_OUT 1
|
||||
#define FADE_NONE 0xFFFFFFFF
|
||||
|
||||
#define FADE_START 0
|
||||
#define FADE_END 200
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CCommonInterface
|
||||
{
|
||||
protected:
|
||||
long m_lScreenFade;
|
||||
long m_lItemFade;
|
||||
unsigned long m_dwFadeMode;
|
||||
|
||||
public:
|
||||
void RenderCursor(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned short wPosX, unsigned short wPosY, unsigned long dwKindCursor, unsigned char cAlpha = 0xFF);
|
||||
BOOL EncodeJPGFile(LPTSTR strFilename, LPDIRECT3DSURFACE8 lpSurface);
|
||||
void TakeScreenShot(LPDIRECT3DDEVICE8 lpD3DDevice, LPCTSTR strFilename);
|
||||
void RenderStackNumber(LPDIRECT3DDEVICE8 lpD3DDevice, short sPosX, short sPosY, long lValue);
|
||||
void RenderNumber(LPDIRECT3DDEVICE8 lpD3DDevice, short sPosX, short sPosY, unsigned char cAlpha, unsigned short wMode, long lValue, float fRate = 1.0f);
|
||||
void DestroyMain(void);
|
||||
char *GetClassName(unsigned short wClass);
|
||||
void RenderNum(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned long dwNum, RECT *lpRect);
|
||||
void RenderRect(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, unsigned long dwColor, unsigned char cAlpha);
|
||||
void Destroy(void);
|
||||
CCommonInterface();
|
||||
virtual ~CCommonInterface();
|
||||
|
||||
/////////////// 커서
|
||||
CTexture *m_lpCursor;
|
||||
|
||||
/////////////// 풀 화면 용
|
||||
CSprite *m_lpFullScreenSprite[12];
|
||||
CTexture *m_lpFullScreenTexture[9];
|
||||
|
||||
/////////////// 로고 화면 용
|
||||
unsigned long m_dwLogoTimer;
|
||||
|
||||
/////////////// 메인 로고 용
|
||||
CSprite *m_lpMainSprite[6];
|
||||
CTexture *m_lpMainTexture[5];
|
||||
vector<char *> m_lstNotice;
|
||||
CGUIScroll *m_lpScroll;
|
||||
unsigned long m_dwStartNotice;
|
||||
CGUIButton *m_lpMainButton;
|
||||
|
||||
/////////////// 종족 선택 화면 용
|
||||
CSprite *m_lpNationSprite[15];
|
||||
CTexture *m_lpNationTexture[13];
|
||||
CGUITooltipButton *m_lpNationTooltip[3];
|
||||
CGUIButton *m_lpNationButton[2];
|
||||
unsigned long m_dwNationOverMouse, m_dwNationSelect;
|
||||
|
||||
CTexture *m_lpNumber;
|
||||
CTexture *m_lpStackNumber;
|
||||
|
||||
void CreateFullScreen(void);
|
||||
void DestroyFullScreen(void);
|
||||
|
||||
void FadeIn(void)
|
||||
{
|
||||
m_dwFadeMode = FADE_IN;
|
||||
m_lScreenFade = FADE_START;
|
||||
m_lItemFade = FADE_START;
|
||||
}
|
||||
void FadeOut(void)
|
||||
{
|
||||
m_dwFadeMode = FADE_OUT;
|
||||
m_lScreenFade = FADE_END;
|
||||
m_lItemFade = FADE_END;
|
||||
}
|
||||
BOOL InitLogo(void);
|
||||
BOOL InitMain(void);
|
||||
BOOL InitNationSelect(void);
|
||||
BOOL InitHelp(void);
|
||||
BOOL InitLoading(void);
|
||||
|
||||
void UpdateLogo(void);
|
||||
void RenderLogo(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void UpdateMain(void);
|
||||
void RenderMain(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void UpdateNationSelect(void);
|
||||
void RenderNationSelect(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void RenderHelp(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void RenderLoading(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_COMMONINTERFACE_H__A2DB72A2_BB7E_451E_87A3_2BA37A643318__INCLUDED_)
|
||||
382
GameTools/NeoRylClient/CommonOption.cpp
Normal file
382
GameTools/NeoRylClient/CommonOption.cpp
Normal file
@@ -0,0 +1,382 @@
|
||||
// CommonOption.cpp: implementation of the CCommonOption class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "CommonOption.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CCommonOption::CCommonOption()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CCommonOption::~CCommonOption()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CCommonOption::InitValue()
|
||||
{
|
||||
m_dwShowOption = 0;
|
||||
m_dwStartMusic = 0;
|
||||
m_dwStartSound = 0;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[4]->ShowButton(TRUE);
|
||||
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[6]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[7]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[8]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[9]->ShowButton(FALSE);
|
||||
}
|
||||
|
||||
BOOL CCommonOption::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[19]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 217, 0, 0, 222, 114, g_ClientMain.m_lpInterface->m_lstTexture[40]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(48, 59, 48, 59, 175, 85, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(48, 59, 0, 220, 127, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(77, 291, 77, 74, 145, 100, g_ClientMain.m_lpInterface->m_lstTexture[40]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(77, 291, 127, 220, 195, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(41, 102, 41, 102, 182, 118, g_ClientMain.m_lpInterface->m_lstTexture[19]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(41, 102, 0, 32, 141, 48, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(41, 102, 0, 112, 141, 128, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(41, 136, 41, 136, 182, 152, g_ClientMain.m_lpInterface->m_lstTexture[19]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(41, 136, 0, 48, 141, 64, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(41, 136, 0, 128, 141, 144, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(41, 172, 41, 172, 182, 188, g_ClientMain.m_lpInterface->m_lstTexture[19]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(41, 172, 0, 64, 141, 80, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(41, 172, 0, 144, 141, 160, g_ClientMain.m_lpInterface->m_lstTexture[20]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(30, 169, 30, 169, 48, 186, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(30, 169, 195, 229, 213, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(30, 193, 30, 193, 48, 210, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(30, 193, 195, 229, 213, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(30, 217, 30, 0, 48, 17, g_ClientMain.m_lpInterface->m_lstTexture[40]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(30, 217, 195, 229, 213, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(30, 241, 30, 24, 48, 41, g_ClientMain.m_lpInterface->m_lstTexture[40]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(30, 241, 195, 229, 213, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(30, 265, 30, 24, 48, 41, g_ClientMain.m_lpInterface->m_lstTexture[40]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(30, 265, 195, 229, 213, 246, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
CGUIScroll *lpScroll;
|
||||
lpScroll = new CGUIScroll;
|
||||
lpScroll->m_lpBarButton = new CGUIButton;
|
||||
lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton->Create(83, 105, 195, 220, 211, 229, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(83, 105, 195, 220, 211, 229, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
|
||||
lpScroll->m_lValue = (long *)&m_dwStartMusic;
|
||||
lpScroll->SetScrollKind(SCROLL_HSCROLL);
|
||||
lpScroll->SetMove(x, y);
|
||||
lpScroll->SetPosition(83, 105);
|
||||
lpScroll->SetEdge(0, 0, 102, 11);
|
||||
lpScroll->SetRange(0, 6);
|
||||
m_lstScroll.push_back(lpScroll);
|
||||
|
||||
lpScroll = new CGUIScroll;
|
||||
lpScroll->m_lpBarButton = new CGUIButton;
|
||||
lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton->Create(83, 127, 195, 220, 211, 229, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(83, 127, 195, 220, 211, 229, g_ClientMain.m_lpInterface->m_lstTexture[21]);
|
||||
|
||||
lpScroll->m_lValue = (long *)&m_dwStartMusic;
|
||||
lpScroll->SetScrollKind(SCROLL_HSCROLL);
|
||||
lpScroll->SetMove(x, y);
|
||||
lpScroll->SetPosition(83, 127);
|
||||
lpScroll->SetEdge(0, 0, 102, 11);
|
||||
lpScroll->SetRange(0, 6);
|
||||
m_lstScroll.push_back(lpScroll);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 222; m_rcWindowSize.bottom = y + 480;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 150; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CCommonOption::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
switch(m_dwShowOption)
|
||||
{
|
||||
case 0: // 메인 메뉴
|
||||
if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
SendMessage(g_ClientMain.m_hWnd, WM_DESTROY, 0, 0);
|
||||
g_ClientMain.m_dwClientMode = CLIENT_END;
|
||||
|
||||
return FALSE;
|
||||
} else if(m_ButtonManager.m_lstButton[3]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwShowOption = 1;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[4]->ShowButton(FALSE);
|
||||
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[6]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[7]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[8]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[9]->ShowButton(TRUE);
|
||||
} else if(m_ButtonManager.m_lstButton[4]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_bShow = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1: // 세부 옵션
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_dwShowOption = 0;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[4]->ShowButton(TRUE);
|
||||
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[6]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[7]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[8]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[9]->ShowButton(FALSE);
|
||||
}
|
||||
|
||||
m_lstScroll[0]->Update();
|
||||
m_lstScroll[1]->Update();
|
||||
break;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 30, m_rcWindowSize.top + 169, m_rcWindowSize.left + 48, m_rcWindowSize.top + 186) && g_DeviceInput.GetIsLeftMouseDown()) // 파티 거부
|
||||
{
|
||||
RejectOption roOption;
|
||||
roOption.m_wReject = g_ClientMain.m_roOption.m_wReject;
|
||||
if(roOption.Reject.m_Party)
|
||||
roOption.Reject.m_Party = 0;
|
||||
else
|
||||
roOption.Reject.m_Party = 1;
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharControlOption(g_ClientMain.m_dwMyChrID, roOption);
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 30, m_rcWindowSize.top + 193, m_rcWindowSize.left + 48, m_rcWindowSize.top + 210) && g_DeviceInput.GetIsLeftMouseDown()) // 교환 거부
|
||||
{
|
||||
RejectOption roOption;
|
||||
roOption.m_wReject = g_ClientMain.m_roOption.m_wReject;
|
||||
if(roOption.Reject.m_Exchange)
|
||||
roOption.Reject.m_Exchange = 0;
|
||||
else
|
||||
roOption.Reject.m_Exchange = 1;
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharControlOption(g_ClientMain.m_dwMyChrID, roOption);
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 30, m_rcWindowSize.top + 217, m_rcWindowSize.left + 48, m_rcWindowSize.top + 234) && g_DeviceInput.GetIsLeftMouseDown()) // 귓속말 거부
|
||||
{
|
||||
RejectOption roOption;
|
||||
roOption.m_wReject = g_ClientMain.m_roOption.m_wReject;
|
||||
if(roOption.Reject.m_Whisper)
|
||||
roOption.Reject.m_Whisper = 0;
|
||||
else
|
||||
roOption.Reject.m_Whisper = 1;
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharControlOption(g_ClientMain.m_dwMyChrID, roOption);
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 30, m_rcWindowSize.top + 241, m_rcWindowSize.left + 48, m_rcWindowSize.top + 258) && g_DeviceInput.GetIsLeftMouseDown()) // 결투 거부
|
||||
{
|
||||
RejectOption roOption;
|
||||
roOption.m_wReject = g_ClientMain.m_roOption.m_wReject;
|
||||
if(roOption.Reject.m_Duel)
|
||||
roOption.Reject.m_Duel = 0;
|
||||
else
|
||||
roOption.Reject.m_Duel = 1;
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharControlOption(g_ClientMain.m_dwMyChrID, roOption);
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 30, m_rcWindowSize.top + 265, m_rcWindowSize.left + 48, m_rcWindowSize.top + 282) && g_DeviceInput.GetIsLeftMouseDown()) // 친구 등록 거부
|
||||
{
|
||||
RejectOption roOption;
|
||||
roOption.m_wReject = g_ClientMain.m_roOption.m_wReject;
|
||||
if(roOption.Reject.m_Friend)
|
||||
roOption.Reject.m_Friend = 0;
|
||||
else
|
||||
roOption.Reject.m_Friend = 1;
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharControlOption(g_ClientMain.m_dwMyChrID, roOption);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CCommonOption::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
switch(m_dwShowOption)
|
||||
{
|
||||
case 0:
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[2]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
if(g_ClientMain.m_roOption.Reject.m_Party)
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_ON;
|
||||
else
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_OFF;
|
||||
|
||||
if(g_ClientMain.m_roOption.Reject.m_Exchange)
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_ON;
|
||||
else
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_OFF;
|
||||
|
||||
if(g_ClientMain.m_roOption.Reject.m_Whisper)
|
||||
m_ButtonManager.m_lstButton[7]->m_nState = BUTTON_ON;
|
||||
else
|
||||
m_ButtonManager.m_lstButton[7]->m_nState = BUTTON_OFF;
|
||||
|
||||
if(g_ClientMain.m_roOption.Reject.m_Duel)
|
||||
m_ButtonManager.m_lstButton[8]->m_nState = BUTTON_ON;
|
||||
else
|
||||
m_ButtonManager.m_lstButton[8]->m_nState = BUTTON_OFF;
|
||||
|
||||
if(g_ClientMain.m_roOption.Reject.m_Friend)
|
||||
m_ButtonManager.m_lstButton[9]->m_nState = BUTTON_ON;
|
||||
else
|
||||
m_ButtonManager.m_lstButton[9]->m_nState = BUTTON_OFF;
|
||||
|
||||
m_lstScroll[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstScroll[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
break;
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
31
GameTools/NeoRylClient/CommonOption.h
Normal file
31
GameTools/NeoRylClient/CommonOption.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// CommonOption.h: interface for the CCommonOption class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_COMMONOPTION_H__AE9ED6FC_651F_41A2_933A_AB88CF554CCE__INCLUDED_)
|
||||
#define AFX_COMMONOPTION_H__AE9ED6FC_651F_41A2_933A_AB88CF554CCE__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CCommonOption : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
unsigned long m_dwShowOption;
|
||||
unsigned long m_dwStartMusic;
|
||||
unsigned long m_dwStartSound;
|
||||
|
||||
CCommonOption();
|
||||
~CCommonOption();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_COMMONOPTION_H__AE9ED6FC_651F_41A2_933A_AB88CF554CCE__INCLUDED_)
|
||||
436
GameTools/NeoRylClient/Crc32Static.cpp
Normal file
436
GameTools/NeoRylClient/Crc32Static.cpp
Normal file
@@ -0,0 +1,436 @@
|
||||
#include <windows.h>
|
||||
#include <fstream.h>
|
||||
#include <crtdbg.h>
|
||||
#include <tchar.h>
|
||||
#include "Crc32Static.h"
|
||||
|
||||
// Static CRC table
|
||||
unsigned long CCrc32Static::s_arrdwCrc32Table[256] =
|
||||
{
|
||||
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
|
||||
0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
|
||||
0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
|
||||
0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
|
||||
0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
|
||||
0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
|
||||
0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
|
||||
0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
|
||||
0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
|
||||
0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
|
||||
0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
|
||||
0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
|
||||
0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
|
||||
0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
|
||||
0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
|
||||
0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
|
||||
|
||||
0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
|
||||
0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
|
||||
0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
|
||||
0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
|
||||
0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
|
||||
0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
|
||||
0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
|
||||
0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
|
||||
0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
|
||||
0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
|
||||
0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
|
||||
0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
|
||||
0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
|
||||
0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
|
||||
0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
|
||||
0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
|
||||
|
||||
0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
|
||||
0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
|
||||
0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
|
||||
0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
|
||||
0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
|
||||
0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
|
||||
0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
|
||||
0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
|
||||
0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
|
||||
0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
|
||||
0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
|
||||
0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
|
||||
0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
|
||||
0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
|
||||
0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
|
||||
0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
|
||||
|
||||
0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
|
||||
0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
|
||||
0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
|
||||
0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
|
||||
0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
|
||||
0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
|
||||
0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
|
||||
0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
|
||||
0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
|
||||
0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
|
||||
0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
|
||||
0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
|
||||
0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
|
||||
0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
|
||||
0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
|
||||
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D,
|
||||
};
|
||||
|
||||
//***********************************************
|
||||
CCrc32Static::CCrc32Static()
|
||||
{
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
CCrc32Static::~CCrc32Static()
|
||||
{
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
inline void CCrc32Static::CalcCrc32(const BYTE byte, unsigned long &dwCrc32)
|
||||
{
|
||||
dwCrc32 = ((dwCrc32) >> 8) ^ s_arrdwCrc32Table[(byte) ^ ((dwCrc32) & 0x000000FF)];
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
bool CCrc32Static::GetFileSizeQW(const HANDLE hFile, QWORD &qwSize)
|
||||
{
|
||||
_ASSERTE(hFile != INVALID_HANDLE_VALUE);
|
||||
|
||||
bool bSuccess = true;
|
||||
|
||||
try
|
||||
{
|
||||
unsigned long dwLo = 0, dwHi = 0;
|
||||
dwLo = GetFileSize(hFile, &dwHi);
|
||||
|
||||
if(dwLo == INVALID_FILE_SIZE && GetLastError() != NO_ERROR)
|
||||
{
|
||||
bSuccess = false;
|
||||
qwSize = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
qwSize = MAKEQWORD(dwHi, dwLo);
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
bSuccess = false;
|
||||
}
|
||||
|
||||
return bSuccess;
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
unsigned long CCrc32Static::StringCrc32(LPCTSTR szString, unsigned long &dwCrc32)
|
||||
{
|
||||
_ASSERTE(szString);
|
||||
|
||||
unsigned long dwErrorCode = NO_ERROR;
|
||||
|
||||
dwCrc32 = 0xFFFFFFFF;
|
||||
|
||||
try
|
||||
{
|
||||
while(*szString != _T('\0'))
|
||||
{
|
||||
CalcCrc32((BYTE)*szString, dwCrc32);
|
||||
szString++;
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// An unknown exception happened
|
||||
dwErrorCode = ERROR_CRC;
|
||||
}
|
||||
|
||||
dwCrc32 = ~dwCrc32;
|
||||
|
||||
return dwErrorCode;
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
unsigned long CCrc32Static::FileCrc32Streams(LPCTSTR szFilename, unsigned long &dwCrc32)
|
||||
{
|
||||
#if UNICODE || _UNICODE
|
||||
return ERROR_NOT_SUPPORTED;
|
||||
#else
|
||||
_ASSERTE(szFilename);
|
||||
_ASSERTE(lstrlen(szFilename));
|
||||
|
||||
unsigned long dwErrorCode = NO_ERROR;
|
||||
ifstream file;
|
||||
|
||||
dwCrc32 = 0xFFFFFFFF;
|
||||
|
||||
try
|
||||
{
|
||||
// Open the file
|
||||
file.open(szFilename, ios::in | ios::nocreate | ios::binary, filebuf::sh_read);
|
||||
|
||||
if(file.is_open())
|
||||
{
|
||||
char buffer[MAX_BUFFER_SIZE];
|
||||
int nLoop, nCount;
|
||||
nCount = file.read(buffer, sizeof(buffer)).gcount();
|
||||
while(nCount)
|
||||
{
|
||||
for(nLoop = 0; nLoop < nCount; nLoop++)
|
||||
CalcCrc32(buffer[nLoop], dwCrc32);
|
||||
nCount = file.read(buffer, sizeof(buffer)).gcount();
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// An unknown exception happened
|
||||
dwErrorCode = ERROR_CRC;
|
||||
}
|
||||
|
||||
if(file.is_open()) file.close();
|
||||
|
||||
dwCrc32 = ~dwCrc32;
|
||||
|
||||
return dwErrorCode;
|
||||
#endif
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
unsigned long CCrc32Static::FileCrc32Win32(LPCTSTR szFilename, unsigned long &dwCrc32)
|
||||
{
|
||||
_ASSERTE(szFilename);
|
||||
_ASSERTE(lstrlen(szFilename));
|
||||
|
||||
unsigned long dwErrorCode = NO_ERROR;
|
||||
HANDLE hFile = NULL;
|
||||
|
||||
dwCrc32 = 0xFFFFFFFF;
|
||||
|
||||
try
|
||||
{
|
||||
// Open the file
|
||||
hFile = CreateFile(szFilename,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||
NULL);
|
||||
if(hFile == INVALID_HANDLE_VALUE)
|
||||
dwErrorCode = GetLastError();
|
||||
else
|
||||
{
|
||||
BYTE buffer[MAX_BUFFER_SIZE];
|
||||
unsigned long dwBytesRead, dwLoop;
|
||||
BOOL bSuccess = ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL);
|
||||
while(bSuccess && dwBytesRead)
|
||||
{
|
||||
for(dwLoop = 0; dwLoop < dwBytesRead; dwLoop++)
|
||||
CalcCrc32(buffer[dwLoop], dwCrc32);
|
||||
bSuccess = ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// An unknown exception happened
|
||||
dwErrorCode = ERROR_CRC;
|
||||
}
|
||||
|
||||
if(hFile != NULL) CloseHandle(hFile);
|
||||
|
||||
dwCrc32 = ~dwCrc32;
|
||||
|
||||
return dwErrorCode;
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
unsigned long CCrc32Static::FileCrc32Filemap(LPCTSTR szFilename, unsigned long &dwCrc32)
|
||||
{
|
||||
_ASSERTE(szFilename);
|
||||
_ASSERTE(lstrlen(szFilename));
|
||||
|
||||
unsigned long dwErrorCode = NO_ERROR;
|
||||
HANDLE hFile = NULL, hFilemap = NULL;
|
||||
|
||||
dwCrc32 = 0xFFFFFFFF;
|
||||
|
||||
try
|
||||
{
|
||||
// Open the file
|
||||
hFile = CreateFile(szFilename,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||
NULL);
|
||||
if(hFile == INVALID_HANDLE_VALUE)
|
||||
dwErrorCode = GetLastError();
|
||||
else
|
||||
{
|
||||
QWORD qwFileSize = 0, qwFileOffset = 0;
|
||||
unsigned long dwByteCount, dwViewSize;
|
||||
unsigned long dwBaseAddress;
|
||||
|
||||
// Get the file size
|
||||
if(!GetFileSizeQW(hFile, qwFileSize))
|
||||
dwErrorCode = ERROR_BAD_LENGTH;
|
||||
else if(qwFileSize != 0) // We cannot CRC zero byte files
|
||||
{
|
||||
// Create the file mapping
|
||||
hFilemap = CreateFileMapping(hFile,
|
||||
NULL,
|
||||
PAGE_READONLY,
|
||||
0,
|
||||
0,
|
||||
NULL);
|
||||
if(hFilemap == NULL)
|
||||
dwErrorCode = GetLastError();
|
||||
else
|
||||
{
|
||||
LPBYTE pByte;
|
||||
|
||||
// Loop while we map a section of the file and CRC it
|
||||
while(qwFileSize > 0)
|
||||
{
|
||||
if(qwFileSize < MAX_VIEW_SIZE)
|
||||
dwViewSize = LODWORD(qwFileSize);
|
||||
else
|
||||
dwViewSize = MAX_VIEW_SIZE;
|
||||
|
||||
dwBaseAddress = (unsigned long)MapViewOfFile(hFilemap,
|
||||
FILE_MAP_READ,
|
||||
HIDWORD(qwFileOffset),
|
||||
LODWORD(qwFileOffset),
|
||||
dwViewSize);
|
||||
|
||||
dwByteCount = dwViewSize;
|
||||
pByte = (LPBYTE)dwBaseAddress;
|
||||
while(dwByteCount-- > 0)
|
||||
{
|
||||
CalcCrc32(*pByte, dwCrc32);
|
||||
pByte++;
|
||||
}
|
||||
|
||||
UnmapViewOfFile((LPVOID)dwBaseAddress);
|
||||
qwFileOffset += dwViewSize;
|
||||
qwFileSize -= dwViewSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// An unknown exception happened
|
||||
dwErrorCode = ERROR_CRC;
|
||||
}
|
||||
|
||||
if(hFile != NULL) CloseHandle(hFile);
|
||||
if(hFilemap != NULL) CloseHandle(hFilemap);
|
||||
|
||||
dwCrc32 = ~dwCrc32;
|
||||
|
||||
return dwErrorCode;
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
unsigned long CCrc32Static::FileCrc32Assembly(LPCTSTR szFilename, unsigned long &dwCrc32)
|
||||
{
|
||||
_ASSERTE(szFilename);
|
||||
_ASSERTE(lstrlen(szFilename));
|
||||
|
||||
unsigned long dwErrorCode = NO_ERROR;
|
||||
HANDLE hFile = NULL;
|
||||
|
||||
dwCrc32 = 0xFFFFFFFF;
|
||||
|
||||
try
|
||||
{
|
||||
// Open the file
|
||||
hFile = CreateFile(szFilename,
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
NULL,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||
NULL);
|
||||
if(hFile == INVALID_HANDLE_VALUE)
|
||||
dwErrorCode = GetLastError();
|
||||
else
|
||||
{
|
||||
// There is a bug in the Microsoft compilers where inline assembly
|
||||
// code cannot access static member variables. This is a work around
|
||||
// for that bug. For more info see Knowledgebase article Q88092
|
||||
LPVOID ptrCrc32Table = &s_arrdwCrc32Table;
|
||||
|
||||
BYTE buffer[MAX_BUFFER_SIZE];
|
||||
unsigned long dwBytesRead;
|
||||
BOOL bSuccess = ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL);
|
||||
while(bSuccess && dwBytesRead)
|
||||
{
|
||||
// Register use:
|
||||
// eax - CRC32 value
|
||||
// ebx - a lot of things
|
||||
// ecx - CRC32 value
|
||||
// edx - address of end of buffer
|
||||
// esi - address of start of buffer
|
||||
// edi - CRC32 table
|
||||
__asm
|
||||
{
|
||||
// Save the esi and edi registers
|
||||
push esi
|
||||
push edi
|
||||
|
||||
mov eax, dwCrc32 // Load the pointer to dwCrc32
|
||||
mov ecx, [eax] // Dereference the pointer to load dwCrc32
|
||||
|
||||
mov edi, ptrCrc32Table // Load the CRC32 table
|
||||
|
||||
lea esi, buffer // Load buffer
|
||||
mov ebx, dwBytesRead // Load dwBytesRead
|
||||
lea edx, [esi + ebx] // Calculate the end of the buffer
|
||||
|
||||
crc32loop:
|
||||
xor eax, eax // Clear the eax register
|
||||
mov bl, byte ptr [esi] // Load the current source byte
|
||||
|
||||
mov al, cl // Copy crc value into eax
|
||||
inc esi // Advance the source pointer
|
||||
|
||||
xor al, bl // Create the index into the CRC32 table
|
||||
shr ecx, 8
|
||||
|
||||
mov ebx, [edi + eax * 4] // Get the value out of the table
|
||||
xor ecx, ebx // xor with the current byte
|
||||
|
||||
cmp edx, esi // Have we reached the end of the buffer?
|
||||
jne crc32loop
|
||||
|
||||
// Restore the edi and esi registers
|
||||
pop edi
|
||||
pop esi
|
||||
|
||||
mov eax, dwCrc32 // Load the pointer to dwCrc32
|
||||
mov [eax], ecx // Write the result
|
||||
}
|
||||
bSuccess = ReadFile(hFile, buffer, sizeof(buffer), &dwBytesRead, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
// An unknown exception happened
|
||||
dwErrorCode = ERROR_CRC;
|
||||
}
|
||||
|
||||
if(hFile != NULL) CloseHandle(hFile);
|
||||
|
||||
dwCrc32 = ~dwCrc32;
|
||||
|
||||
return dwErrorCode;
|
||||
}
|
||||
25
GameTools/NeoRylClient/Crc32Static.h
Normal file
25
GameTools/NeoRylClient/Crc32Static.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _CRC32STATIC_H_
|
||||
#define _CRC32STATIC_H_
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
class CCrc32Static
|
||||
{
|
||||
public:
|
||||
CCrc32Static();
|
||||
virtual ~CCrc32Static();
|
||||
|
||||
static unsigned long StringCrc32(const char *szString, unsigned long &dwCrc32);
|
||||
static unsigned long FileCrc32Streams(const char *szFilename, unsigned long &dwCrc32);
|
||||
static unsigned long FileCrc32Win32(const char *szFilename, unsigned long &dwCrc32);
|
||||
static unsigned long FileCrc32Filemap(const char *szFilename, unsigned long &dwCrc32);
|
||||
static unsigned long FileCrc32Assembly(const char *szFilename, unsigned long &dwCrc32);
|
||||
|
||||
protected:
|
||||
static bool GetFileSizeQW(const HANDLE hFile, __int64 &qwSize);
|
||||
static inline void CalcCrc32(const unsigned char byte, unsigned long &dwCrc32);
|
||||
|
||||
static unsigned long s_arrdwCrc32Table[256];
|
||||
};
|
||||
|
||||
#endif
|
||||
43
GameTools/NeoRylClient/DBGHELPS.H
Normal file
43
GameTools/NeoRylClient/DBGHELPS.H
Normal file
@@ -0,0 +1,43 @@
|
||||
// dbghelp_supp.h : supplement header file for dbghelp.dll
|
||||
// Author: DLL to Lib version 1.26
|
||||
// Date: Thursday, August 29, 2002
|
||||
// Description: The declaration of the dbghelp.dll's entry-point function.
|
||||
// Prototype: BOOL WINAPI xxx_DllMain(HINSTANCE hinstance, DWORD fdwReason, LPVOID lpvReserved);
|
||||
// Parameters:
|
||||
// hinstance
|
||||
// Handle to current instance of the application. Use AfxGetInstanceHandle()
|
||||
// to get the instance handle if your project has MFC support.
|
||||
// fdwReason
|
||||
// Specifies a flag indicating why the entry-point function is being called.
|
||||
// lpvReserved
|
||||
// Specifies further aspects of DLL initialization and cleanup. Should always
|
||||
// be set to NULL;
|
||||
// Comment: Please see the help document for detail information about the entry-point
|
||||
// function
|
||||
// Homepage: http://www.binary-soft.com
|
||||
// Technical Support: support@binary-soft.com
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(D2L_DBGHELP_SUPP_H__66294100_4617_5D23_13FE_283B1AED2B4E__INCLUDED_)
|
||||
#define D2L_DBGHELP_SUPP_H__66294100_4617_5D23_13FE_283B1AED2B4E__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/*This is dbghelp.dll's entry-point function. You should call it to do
|
||||
necessary initialization and finalization.*/
|
||||
BOOL WINAPI DBGHELP_DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !defined(D2L_DBGHELP_SUPP_H__66294100_4617_5D23_13FE_283B1AED2B4E__INCLUDED_)
|
||||
63
GameTools/NeoRylClient/DLLModule.H
Normal file
63
GameTools/NeoRylClient/DLLModule.H
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
class CDLLModule
|
||||
{
|
||||
public:
|
||||
CDLLModule() : m_hDLL(NULL)
|
||||
{
|
||||
}
|
||||
virtual ~CDLLModule() //destructor, free the library
|
||||
{
|
||||
if( m_hDLL )
|
||||
::FreeLibrary( m_hDLL );
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// See if dll been loaded, returning true dose not mean that all
|
||||
// functions of the dll is valid.
|
||||
BOOL IsLoaded(void)
|
||||
{
|
||||
return m_hDLL != NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
// pure virtual, must implemented in derived class
|
||||
// used macros to generate the implementation
|
||||
virtual BOOL Init( LPCTSTR szDll ) = 0;
|
||||
|
||||
protected:
|
||||
HMODULE m_hDLL;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// macros to implement the Init function
|
||||
#define DECLARE_DLL_FUNCTION(ret, cc, func, params) \
|
||||
ret (cc *func)params;
|
||||
|
||||
#define BEGIN_DLL_INIT() \
|
||||
BOOL Init( LPCTSTR szDll ) \
|
||||
{ \
|
||||
if( m_hDLL ) \
|
||||
::FreeLibrary( m_hDLL ); \
|
||||
m_hDLL = ::LoadLibrary( szDll ); \
|
||||
BOOL bOk = FALSE;
|
||||
|
||||
#define INIT_DLL_TWIN_FUNCTION(ret, cc, func, params, origin) \
|
||||
if( m_hDLL ) { \
|
||||
func = (ret (cc* )params) GetProcAddress( m_hDLL, origin ); \
|
||||
} else \
|
||||
func = NULL; \
|
||||
if( func ) \
|
||||
bOk = TRUE;
|
||||
|
||||
#define END_DLL_INIT() \
|
||||
return bOk; \
|
||||
}
|
||||
|
||||
#define INIT_DLL_FUNCTION(ret, cc, func, params) \
|
||||
if( m_hDLL ) { \
|
||||
func = (ret (cc* )params)GetProcAddress( m_hDLL, #func ); \
|
||||
} else \
|
||||
func = NULL; \
|
||||
if( func ) \
|
||||
bOk = TRUE;
|
||||
|
||||
113
GameTools/NeoRylClient/DataTable.h
Normal file
113
GameTools/NeoRylClient/DataTable.h
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
class CDataTable
|
||||
{
|
||||
public:
|
||||
__int64 MAXEXPTABLE[100];
|
||||
|
||||
CDataTable()
|
||||
{
|
||||
MAXEXPTABLE[1] = 100 ;
|
||||
MAXEXPTABLE[2] = 260 ;
|
||||
MAXEXPTABLE[3] = 580 ;
|
||||
MAXEXPTABLE[4] = 1200 ;
|
||||
MAXEXPTABLE[5] = 2300 ;
|
||||
MAXEXPTABLE[6] = 4200 ;
|
||||
MAXEXPTABLE[7] = 7000 ;
|
||||
MAXEXPTABLE[8] = 11300 ;
|
||||
MAXEXPTABLE[9] = 17300 ;
|
||||
MAXEXPTABLE[10] = 25400 ;
|
||||
MAXEXPTABLE[11] = 36300 ;
|
||||
MAXEXPTABLE[12] = 50300 ;
|
||||
MAXEXPTABLE[13] = 68000 ;
|
||||
MAXEXPTABLE[14] = 90200 ;
|
||||
MAXEXPTABLE[15] = 117000 ;
|
||||
MAXEXPTABLE[16] = 150000 ;
|
||||
MAXEXPTABLE[17] = 189000 ;
|
||||
MAXEXPTABLE[18] = 236000 ;
|
||||
MAXEXPTABLE[19] = 291000 ;
|
||||
MAXEXPTABLE[20] = 497000 ;
|
||||
MAXEXPTABLE[21] = 602000 ;
|
||||
MAXEXPTABLE[22] = 724000 ;
|
||||
MAXEXPTABLE[23] = 863000 ;
|
||||
MAXEXPTABLE[24] = 1021000 ;
|
||||
MAXEXPTABLE[25] = 1201000 ;
|
||||
MAXEXPTABLE[26] = 1403000 ;
|
||||
MAXEXPTABLE[27] = 1629000 ;
|
||||
MAXEXPTABLE[28] = 1882000 ;
|
||||
MAXEXPTABLE[29] = 2164000 ;
|
||||
MAXEXPTABLE[30] = 3216000 ;
|
||||
MAXEXPTABLE[31] = 3667000 ;
|
||||
MAXEXPTABLE[32] = 4163000 ;
|
||||
MAXEXPTABLE[33] = 4645000 ;
|
||||
MAXEXPTABLE[34] = 5069000 ;
|
||||
MAXEXPTABLE[35] = 5518000 ;
|
||||
MAXEXPTABLE[36] = 5994000 ;
|
||||
MAXEXPTABLE[37] = 6495000 ;
|
||||
MAXEXPTABLE[38] = 7024000 ;
|
||||
MAXEXPTABLE[39] = 7581000 ;
|
||||
MAXEXPTABLE[40] = 10080000 ;
|
||||
MAXEXPTABLE[41] = 10840000 ;
|
||||
MAXEXPTABLE[42] = 11640000 ;
|
||||
MAXEXPTABLE[43] = 12480000 ;
|
||||
MAXEXPTABLE[44] = 13360000 ;
|
||||
MAXEXPTABLE[45] = 14280000 ;
|
||||
MAXEXPTABLE[46] = 15240000 ;
|
||||
MAXEXPTABLE[47] = 16240000 ;
|
||||
MAXEXPTABLE[48] = 17280000 ;
|
||||
MAXEXPTABLE[49] = 18370000 ;
|
||||
MAXEXPTABLE[50] = 19500000 ;
|
||||
MAXEXPTABLE[51] = 24660000 ;
|
||||
MAXEXPTABLE[52] = 26120000 ;
|
||||
MAXEXPTABLE[53] = 27640000 ;
|
||||
MAXEXPTABLE[54] = 29220000 ;
|
||||
MAXEXPTABLE[55] = 30860000 ;
|
||||
MAXEXPTABLE[56] = 32550000 ;
|
||||
MAXEXPTABLE[57] = 34310000 ;
|
||||
MAXEXPTABLE[58] = 36130000 ;
|
||||
MAXEXPTABLE[59] = 38010000 ;
|
||||
MAXEXPTABLE[60] = 39960000 ;
|
||||
MAXEXPTABLE[61] = 69210000 ;
|
||||
MAXEXPTABLE[62] = 72650000 ;
|
||||
MAXEXPTABLE[63] = 76200000 ;
|
||||
MAXEXPTABLE[64] = 79870000 ;
|
||||
MAXEXPTABLE[65] = 83650000 ;
|
||||
MAXEXPTABLE[66] = 87550000 ;
|
||||
MAXEXPTABLE[67] = 91570000 ;
|
||||
MAXEXPTABLE[68] = 95710000 ;
|
||||
MAXEXPTABLE[69] = 99980000 ;
|
||||
MAXEXPTABLE[70] = 104370000 ;
|
||||
MAXEXPTABLE[71] = 108880000 ;
|
||||
MAXEXPTABLE[72] = 113520000 ;
|
||||
MAXEXPTABLE[73] = 118300000 ;
|
||||
MAXEXPTABLE[74] = 123210000 ;
|
||||
MAXEXPTABLE[75] = 128250000 ;
|
||||
MAXEXPTABLE[76] = 133420000 ;
|
||||
MAXEXPTABLE[77] = 138730000 ;
|
||||
MAXEXPTABLE[78] = 144190000 ;
|
||||
MAXEXPTABLE[79] = 149780000 ;
|
||||
MAXEXPTABLE[80] = 155520000 ;
|
||||
MAXEXPTABLE[81] = 161400000 ;
|
||||
MAXEXPTABLE[82] = 167420000 ;
|
||||
MAXEXPTABLE[83] = 173600000 ;
|
||||
MAXEXPTABLE[84] = 179920000 ;
|
||||
MAXEXPTABLE[85] = 186400000 ;
|
||||
MAXEXPTABLE[86] = 193030000 ;
|
||||
MAXEXPTABLE[87] = 199820000 ;
|
||||
MAXEXPTABLE[88] = 206760000 ;
|
||||
MAXEXPTABLE[89] = 213860000 ;
|
||||
MAXEXPTABLE[90] = 221130000 ;
|
||||
MAXEXPTABLE[91] = 228550000 ;
|
||||
MAXEXPTABLE[92] = 236140000 ;
|
||||
MAXEXPTABLE[93] = 243900000 ;
|
||||
MAXEXPTABLE[94] = 251820000 ;
|
||||
MAXEXPTABLE[95] = 259920000 ;
|
||||
MAXEXPTABLE[96] = 268180000 ;
|
||||
MAXEXPTABLE[97] = 276620000 ;
|
||||
MAXEXPTABLE[98] = 285230000 ;
|
||||
MAXEXPTABLE[99] = 294030000 ;
|
||||
}
|
||||
};
|
||||
|
||||
extern CDataTable g_dtDateTable;
|
||||
|
||||
|
||||
757
GameTools/NeoRylClient/ExceptionReport.CPP
Normal file
757
GameTools/NeoRylClient/ExceptionReport.CPP
Normal file
@@ -0,0 +1,757 @@
|
||||
/* ==========================================================================
|
||||
File : ExceptionReport.h
|
||||
Vers.: 0.9
|
||||
Plat.: Windows 98 or above
|
||||
Desc.: ExceptionHandle routine (report)
|
||||
Req. : DbgHelp v5.1 or above
|
||||
|
||||
Adapted from MSDN March 2002 - Under the Hood
|
||||
========================================================================== */
|
||||
|
||||
// #define _WIN32_WINDOWS 0x0410 // Windows 98
|
||||
// #define _WIN32_WINNT 0x0500 // Windows 2000
|
||||
|
||||
#define USE_DBGHELPS 0
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "ExceptionReport.h"
|
||||
#if USE_DBGHELPS == 1
|
||||
#include "DBGHELPS.H"
|
||||
#endif
|
||||
|
||||
|
||||
CExceptionReport g_CExceptionReport;
|
||||
|
||||
TCHAR CExceptionReport::m_szLogPrefixName[ MAX_PATH ];
|
||||
TCHAR CExceptionReport::m_szModuleName[ MAX_PATH ];
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER CExceptionReport::m_OldFilter;
|
||||
HANDLE CExceptionReport::m_hReportFile;
|
||||
HANDLE CExceptionReport::m_hProcess;
|
||||
BOOL CExceptionReport::m_bHasSymbol;
|
||||
BOOL CExceptionReport::m_bWriteInfo;
|
||||
LPCERUserFunc CExceptionReport::m_lpUserFunc;
|
||||
CDBGFuncClass CExceptionReport::m_DBGHELP;
|
||||
|
||||
// #pragma comment(linker, "/defaultlib:dbghelp.lib")
|
||||
|
||||
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
CExceptionReport::CExceptionReport()
|
||||
{
|
||||
m_bHasSymbol = FALSE;
|
||||
m_bWriteInfo = TRUE;
|
||||
SetProgramName();
|
||||
SetUserFunc( NULL );
|
||||
|
||||
#if USE_DBGHELPS == 1
|
||||
DBGHELP_DllMain( GetModuleHandle( NULL ), DLL_PROCESS_ATTACH, NULL );
|
||||
#else
|
||||
if( m_DBGHELP.Init( "DBGHELP.DLL" ) == TRUE )
|
||||
#endif
|
||||
// Install the unhandled exception filter function
|
||||
m_OldFilter = SetUnhandledExceptionFilter( UnhandledExceptionFilter );
|
||||
m_hProcess = GetCurrentProcess();
|
||||
}
|
||||
|
||||
//
|
||||
// Destructor
|
||||
//
|
||||
CExceptionReport::~CExceptionReport()
|
||||
{
|
||||
SetUnhandledExceptionFilter( m_OldFilter );
|
||||
#if USE_DBGHELPS == 1
|
||||
DBGHELP_DllMain( GetModuleHandle( NULL ), DLL_PROCESS_DETACH, NULL );
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Set application-specific function
|
||||
//
|
||||
void CExceptionReport::SetUserFunc( LPCERUserFunc lpUserFunc )
|
||||
{
|
||||
m_lpUserFunc = lpUserFunc;
|
||||
}
|
||||
|
||||
//
|
||||
// Set application-name for prefix of log filename
|
||||
//
|
||||
void CExceptionReport::SetProgramName( PTSTR pszProgramName )
|
||||
{
|
||||
if( pszProgramName == NULL ) {
|
||||
TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szFilename[MAX_PATH], szExt[MAX_PATH];
|
||||
|
||||
// Figure out what the report file will be named, and store it away
|
||||
GetModuleFileName( 0, m_szLogPrefixName, MAX_PATH );
|
||||
|
||||
PTSTR pszDot = m_szLogPrefixName;
|
||||
// Look for the '.' before the "EXE" extension. Replace '.' to '\0'
|
||||
if( (pszDot = _tcsrchr( pszDot, _T('.') )) )
|
||||
*pszDot = 0;
|
||||
_tsplitpath( m_szLogPrefixName, szDrive, szDir, szFilename, szExt );
|
||||
_tcscpy( m_szLogPrefixName, szFilename );
|
||||
} else {
|
||||
_tcscpy( m_szLogPrefixName, pszProgramName );
|
||||
}
|
||||
}
|
||||
|
||||
LONG WINAPI CExceptionReport::UnhandledExceptionFilterTwo( PEXCEPTION_POINTERS pExceptionInfo )
|
||||
{
|
||||
if( m_hReportFile ) {
|
||||
Printf( "Exception occured AGAIN! EXITING NOW!\r\n" );
|
||||
CloseHandle( m_hReportFile );
|
||||
m_hReportFile = NULL;
|
||||
}
|
||||
if( m_OldFilter )
|
||||
return m_OldFilter( pExceptionInfo );
|
||||
else
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
//
|
||||
// This is called when unhandled exception occurs
|
||||
//
|
||||
LONG WINAPI CExceptionReport::UnhandledExceptionFilter( PEXCEPTION_POINTERS pExceptionInfo )
|
||||
{
|
||||
TCHAR szLogFileName[ MAX_PATH ];
|
||||
|
||||
SetUnhandledExceptionFilter( UnhandledExceptionFilterTwo );
|
||||
|
||||
if(!m_bWriteInfo) return EXCEPTION_EXECUTE_HANDLER;
|
||||
|
||||
_tcscpy( szLogFileName, m_szLogPrefixName );
|
||||
|
||||
SYSTEMTIME stSystemTime;
|
||||
GetLocalTime( &stSystemTime );
|
||||
|
||||
wsprintf( szLogFileName + strlen( szLogFileName ), " %04d-%02d-%02d %02d,%02d,%02d.TXT",
|
||||
stSystemTime.wYear, stSystemTime.wMonth, stSystemTime.wDay,
|
||||
stSystemTime.wHour, stSystemTime.wMinute, stSystemTime.wSecond );
|
||||
|
||||
if( (m_hReportFile = CreateFile( szLogFileName, GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, 0 )) != INVALID_HANDLE_VALUE ) {
|
||||
SetFilePointer( m_hReportFile, 0, 0, FILE_END );
|
||||
WriteExceptionReport( pExceptionInfo );
|
||||
CloseHandle( m_hReportFile );
|
||||
m_hReportFile = NULL;
|
||||
}
|
||||
|
||||
#if USE_MINIDUMP == 1
|
||||
TCHAR szDumpFileName[ MAX_PATH ];
|
||||
|
||||
_tcscpy( szDumpFileName, m_szLogPrefixName );
|
||||
wsprintf( szDumpFileName + strlen( szDumpFileName ), " %04d-%02d-%02d %02d,%02d,%02d.DMP",
|
||||
stSystemTime.wYear, stSystemTime.wMonth, stSystemTime.wDay,
|
||||
stSystemTime.wHour, stSystemTime.wMinute, stSystemTime.wSecond );
|
||||
|
||||
HANDLE hDumpFile;
|
||||
|
||||
if( m_DBGHELP.MiniDumpWriteDump &&(hDumpFile = CreateFile( szDumpFileName, GENERIC_WRITE, FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 )) != INVALID_HANDLE_VALUE ) {
|
||||
MINIDUMP_EXCEPTION_INFORMATION ExInfo;
|
||||
|
||||
ExInfo.ThreadId = ::GetCurrentThreadId();
|
||||
ExInfo.ExceptionPointers = pExceptionInfo;
|
||||
ExInfo.ClientPointers = NULL;
|
||||
|
||||
m_DBGHELP.MiniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &ExInfo, NULL, NULL );
|
||||
CloseHandle( hDumpFile );
|
||||
}
|
||||
#endif
|
||||
|
||||
if( m_lpUserFunc && (m_hReportFile = CreateFile( szLogFileName, GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, 0 )) != INVALID_HANDLE_VALUE ) {
|
||||
SetFilePointer( m_hReportFile, 0, 0, FILE_END );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " Application-specific log\r\n" ) );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
m_lpUserFunc( m_hReportFile );
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T( "==============================================================================\r\n" ) );
|
||||
CloseHandle( m_hReportFile );
|
||||
m_hReportFile = NULL;
|
||||
}
|
||||
|
||||
// if( m_OldFilter )
|
||||
// return m_OldFilter( pExceptionInfo );
|
||||
// else
|
||||
// return EXCEPTION_CONTINUE_SEARCH;
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
//
|
||||
// Write informations to Report file. Called by UnhandledExceptionFilter
|
||||
//
|
||||
void CExceptionReport::WriteExceptionReport( PEXCEPTION_POINTERS pExceptionInfo )
|
||||
{
|
||||
// Start out with a banner
|
||||
Printf( _T( "==============================================================================\r\n\r\n" ) );
|
||||
WriteBasicInfo( pExceptionInfo->ExceptionRecord );
|
||||
WriteRegistersInfo( pExceptionInfo->ContextRecord );
|
||||
|
||||
if( !m_DBGHELP.SymInitialize )
|
||||
return;
|
||||
|
||||
// if( m_DBGHELP.SymSetOptions )
|
||||
// m_DBGHELP.SymSetOptions( SYMOPT_DEFERRED_LOADS );
|
||||
// Initialize DbgHelp
|
||||
if( !m_DBGHELP.SymInitialize( GetCurrentProcess(), 0, TRUE ) )
|
||||
return;
|
||||
CONTEXT trashableContext = *(pExceptionInfo->ContextRecord);
|
||||
WriteStackDetails( &trashableContext, FALSE );
|
||||
#ifdef _M_IX86 // X86 Only!
|
||||
if( m_bHasSymbol ) {
|
||||
trashableContext = *(pExceptionInfo->ContextRecord);
|
||||
WriteStackDetails( &trashableContext, TRUE );
|
||||
// Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
// Printf( _T( " Global Variables\r\n" ) );
|
||||
// Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
// Printf( _T( "\r\n" ) );
|
||||
// if( m_DBGHELP.SymEnumSymbols)
|
||||
// m_DBGHELP.SymEnumSymbols( GetCurrentProcess(), (DWORD64) GetModuleHandle( m_szModuleName ), 0, EnumerateSymbolsCallback, 0 );
|
||||
}
|
||||
#endif // X86 Only!
|
||||
if( m_DBGHELP.SymCleanup )
|
||||
m_DBGHELP.SymCleanup( GetCurrentProcess() );
|
||||
|
||||
Printf( _T("\r\n") );
|
||||
Printf( _T("\r\n") );
|
||||
|
||||
WriteMemoryDump( pExceptionInfo->ContextRecord );
|
||||
|
||||
if( m_lpUserFunc ) {
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " Application-specific log\r\n" ) );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
m_lpUserFunc( m_hReportFile );
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
}
|
||||
|
||||
if( !m_lpUserFunc )
|
||||
Printf( _T( "==============================================================================\r\n" ) );
|
||||
}
|
||||
|
||||
//
|
||||
// Write basic informations(user, computer name, error type)
|
||||
//
|
||||
void CExceptionReport::WriteBasicInfo( PEXCEPTION_RECORD pExceptionRecord )
|
||||
{
|
||||
TCHAR szFileName[MAX_PATH] = _T( "" ), szUserName[MAX_PATH] = _T( "" ), szComputerName[MAX_PATH] = _T( "" );
|
||||
DWORD dwUserLen = MAX_PATH, dwComputerLen = MAX_PATH;
|
||||
|
||||
SYSTEMTIME stSystemTime;
|
||||
GetLocalTime( &stSystemTime );
|
||||
|
||||
GetModuleFileName( (HMODULE) NULL, szFileName, MAX_PATH );
|
||||
GetUserName( szUserName, &dwUserLen );
|
||||
GetComputerName( szComputerName, &dwComputerLen );
|
||||
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " Basic Information\r\n" ) );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
Printf( _T( "Program Name : %s\r\n" ), m_szLogPrefixName );
|
||||
Printf( _T( "EXE : %s\r\n" ), szFileName );
|
||||
Printf( _T( "User : %s\r\n" ), szUserName );
|
||||
Printf( _T( "Computer : %s\r\n" ), szComputerName );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
// Print information about the type of fault and where the fault occured
|
||||
DWORD section, offset;
|
||||
GetLogicalAddress( pExceptionRecord->ExceptionAddress, m_szModuleName, sizeof( m_szModuleName ), section, offset );
|
||||
Printf( _T( "Program : %s\r\n" ), m_szModuleName );
|
||||
Printf( _T( "Exception : %08X (%s)\r\n"), pExceptionRecord->ExceptionCode, GetExceptionString( pExceptionRecord->ExceptionCode ) );
|
||||
Printf( _T( "Fault Address: %08X %02X:%08X\r\n"), pExceptionRecord->ExceptionAddress, section, offset );
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
// TODO: System Information!
|
||||
}
|
||||
|
||||
//
|
||||
// Show the registers
|
||||
//
|
||||
void CExceptionReport::WriteRegistersInfo( PCONTEXT pContext )
|
||||
{
|
||||
#ifdef _M_IX86 // X86 Only!
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " x86 Registers\r\n" ) );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
Printf( _T("EAX=%08X EBX=%08X ECX=%08X EDX=%08X\r\n"), pContext->Eax, pContext->Ebx, pContext->Ecx, pContext->Edx );
|
||||
Printf( _T("ESI=%08X EDI=%08X EBP=%08X\r\n"), pContext->Esi, pContext->Edi, pContext->Ebp );
|
||||
Printf( _T("DS =%04X ES=%04X FS=%04X GS:%04X\r\n"), pContext->SegDs, pContext->SegEs, pContext->SegFs, pContext->SegGs );
|
||||
Printf( _T("CS:EIP=%04X:%08X\r\n"), pContext->SegCs, pContext->Eip );
|
||||
Printf( _T("SS:ESP=%04X:%08X\r\n"), pContext->SegSs, pContext->Esp );
|
||||
Printf( _T("Flags=%08X\r\n"), pContext->EFlags );
|
||||
Printf( _T("\r\n") );
|
||||
Printf( _T("\r\n") );
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Show the Memory
|
||||
//
|
||||
void CExceptionReport::WriteMemoryDump( PCONTEXT pContext )
|
||||
{
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " Memory Dump\r\n" ) );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
|
||||
Printf( _T( "Code: %d bytes starting at (EIP = %08lX)\r\n" ), 16, pContext->Eip );
|
||||
Dump( pContext->Eip, 16, FALSE );
|
||||
Printf( _T("\r\n") );
|
||||
|
||||
Printf( _T( "Stack: %d bytes starting at (ESP = %08lX)\r\n" ), 1024, pContext->Esp );
|
||||
Dump( pContext->Esp, 1024, TRUE );
|
||||
Printf( _T("\r\n") );
|
||||
Printf( _T("\r\n") );
|
||||
}
|
||||
|
||||
//
|
||||
// Given an exception code, returns a pointer to a static string with a description of the exception
|
||||
//
|
||||
#define EXCEPTION( x ) case EXCEPTION_##x: return _T(#x);
|
||||
|
||||
LPTSTR CExceptionReport::GetExceptionString( DWORD dwCode )
|
||||
{
|
||||
switch ( dwCode ) {
|
||||
EXCEPTION( ACCESS_VIOLATION )
|
||||
EXCEPTION( DATATYPE_MISALIGNMENT )
|
||||
EXCEPTION( BREAKPOINT )
|
||||
EXCEPTION( SINGLE_STEP )
|
||||
EXCEPTION( ARRAY_BOUNDS_EXCEEDED )
|
||||
EXCEPTION( FLT_DENORMAL_OPERAND )
|
||||
EXCEPTION( FLT_DIVIDE_BY_ZERO )
|
||||
EXCEPTION( FLT_INEXACT_RESULT )
|
||||
EXCEPTION( FLT_INVALID_OPERATION )
|
||||
EXCEPTION( FLT_OVERFLOW )
|
||||
EXCEPTION( FLT_STACK_CHECK )
|
||||
EXCEPTION( FLT_UNDERFLOW )
|
||||
EXCEPTION( INT_DIVIDE_BY_ZERO )
|
||||
EXCEPTION( INT_OVERFLOW )
|
||||
EXCEPTION( PRIV_INSTRUCTION )
|
||||
EXCEPTION( IN_PAGE_ERROR )
|
||||
EXCEPTION( ILLEGAL_INSTRUCTION )
|
||||
EXCEPTION( NONCONTINUABLE_EXCEPTION )
|
||||
EXCEPTION( STACK_OVERFLOW )
|
||||
EXCEPTION( INVALID_DISPOSITION )
|
||||
EXCEPTION( GUARD_PAGE )
|
||||
EXCEPTION( INVALID_HANDLE )
|
||||
}
|
||||
|
||||
// If not one of the "known" exceptions, try to get the string
|
||||
// from NTDLL.DLL's message table.
|
||||
|
||||
static TCHAR szBuffer[512] = { 0 };
|
||||
|
||||
FormatMessage( FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
|
||||
GetModuleHandle( _T("NTDLL.DLL") ),
|
||||
dwCode, 0, szBuffer, sizeof( szBuffer ), 0 );
|
||||
|
||||
return szBuffer;
|
||||
}
|
||||
|
||||
#undef EXCEPTION
|
||||
|
||||
//
|
||||
// Given a linear address, locates the module, section, and offset containing that address.
|
||||
// Note: the szModule paramater buffer is an output buffer of length specified by the len parameter (in characters!)
|
||||
//
|
||||
BOOL CExceptionReport::GetLogicalAddress( PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD& offset )
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
|
||||
if( !VirtualQuery( addr, &mbi, sizeof( mbi ) ) )
|
||||
return FALSE;
|
||||
|
||||
PVOID hMod = mbi.AllocationBase;
|
||||
|
||||
if( !GetModuleFileName( (HMODULE) hMod, szModule, len ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Point to the DOS header in memory
|
||||
PIMAGE_DOS_HEADER pDosHdr = (PIMAGE_DOS_HEADER) hMod;
|
||||
|
||||
// From the DOS header, find the NT (PE) header
|
||||
PIMAGE_NT_HEADERS pNtHdr = (PIMAGE_NT_HEADERS)(((DWORD64) hMod) + pDosHdr->e_lfanew);
|
||||
|
||||
PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION( pNtHdr );
|
||||
|
||||
DWORD64 rva = (DWORD64)addr - (DWORD64)hMod; // RVA is offset from module load address
|
||||
|
||||
// Iterate through the section table, looking for the one that encompasses
|
||||
// the linear address.
|
||||
for( unsigned i = 0; i < pNtHdr->FileHeader.NumberOfSections; i++, pSection++ ) {
|
||||
DWORD sectionStart = pSection->VirtualAddress;
|
||||
DWORD sectionEnd = sectionStart + max(pSection->SizeOfRawData, pSection->Misc.VirtualSize);
|
||||
|
||||
// Is the address in this section???
|
||||
if ( (rva >= sectionStart) && (rva <= sectionEnd) ) {
|
||||
// Yes, address is in the section. Calculate section and offset,
|
||||
// and store in the "section" & "offset" params, which were
|
||||
// passed by reference.
|
||||
section = i+1;
|
||||
offset = (DWORD) (rva - sectionStart);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE; // Should never get here!
|
||||
}
|
||||
|
||||
//
|
||||
// Walks the stack, and writes the results to the report file
|
||||
//
|
||||
void CExceptionReport::WriteStackDetails( PCONTEXT pContext, BOOL bWriteVariables ) // TRUE if local/params should be output
|
||||
{
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( " Call Stack (%s)\r\n" ), bWriteVariables ? "Detail" : "Short" );
|
||||
Printf( _T( "------------------------------------------------------------------------------\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T("Address Frame Function SourceFile\r\n") );
|
||||
DWORD dwMachineType = 0;
|
||||
// Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag
|
||||
STACKFRAME sf;
|
||||
|
||||
memset( &sf, 0, sizeof(sf) );
|
||||
|
||||
#ifdef _M_IX86
|
||||
// Initialize the STACKFRAME structure for the first call. This is only
|
||||
// necessary for Intel CPUs, and isn't mentioned in the documentation.
|
||||
sf.AddrPC.Offset = pContext->Eip;
|
||||
sf.AddrPC.Mode = AddrModeFlat;
|
||||
sf.AddrStack.Offset = pContext->Esp;
|
||||
sf.AddrStack.Mode = AddrModeFlat;
|
||||
sf.AddrFrame.Offset = pContext->Ebp;
|
||||
sf.AddrFrame.Mode = AddrModeFlat;
|
||||
|
||||
dwMachineType = IMAGE_FILE_MACHINE_I386;
|
||||
#endif
|
||||
while( 1 ) {
|
||||
// Get the next stack frame
|
||||
if( !m_DBGHELP.StackWalk )
|
||||
break;
|
||||
if( !m_DBGHELP.StackWalk( dwMachineType, m_hProcess, GetCurrentThread(), &sf, pContext, 0, m_DBGHELP.SymFunctionTableAccess, m_DBGHELP.SymGetModuleBase, 0 ) )
|
||||
break;
|
||||
if( sf.AddrFrame.Offset == 0 ) // Basic sanity check to make sure
|
||||
break; // the frame is OK. Bail if not.
|
||||
Printf( _T("%08X %08X "), sf.AddrPC.Offset, sf.AddrFrame.Offset );
|
||||
|
||||
// Get the name of the function for this stack frame entry
|
||||
BYTE symbolBuffer[ sizeof(SYMBOL_INFO) + 2048 ];
|
||||
PSYMBOL_INFO pSymbol = (PSYMBOL_INFO)symbolBuffer;
|
||||
pSymbol->SizeOfStruct = sizeof(symbolBuffer);
|
||||
pSymbol->MaxNameLen = 2048;
|
||||
|
||||
DWORD64 symDisplacement = 0; // Displacement of the input address,
|
||||
// relative to the start of the symbol
|
||||
if( m_DBGHELP.SymFromAddr && m_DBGHELP.SymFromAddr( m_hProcess, sf.AddrPC.Offset, &symDisplacement, pSymbol ) ) {
|
||||
TCHAR szModule[MAX_PATH] = _T("");
|
||||
|
||||
wsprintf( szModule, _T("%-s+%I64X"), pSymbol->Name, symDisplacement );
|
||||
Printf( _T( "%-30s" ), szModule );
|
||||
} else {
|
||||
// No symbol found. Print out the logical address instead.
|
||||
TCHAR szModule[MAX_PATH] = _T("");
|
||||
DWORD section = 0, offset = 0;
|
||||
|
||||
GetLogicalAddress( (PVOID) (DWORD64) sf.AddrPC.Offset, szModule, sizeof( szModule ), section, offset );
|
||||
Printf( _T("%04X:%08X %s"), section, offset, szModule );
|
||||
}
|
||||
|
||||
// Get the source line for this stack frame entry
|
||||
IMAGEHLP_LINE lineInfo = { sizeof(IMAGEHLP_LINE) };
|
||||
DWORD dwLineDisplacement;
|
||||
if ( m_DBGHELP.SymGetLineFromAddr && (m_DBGHELP.SymGetLineFromAddr( m_hProcess, sf.AddrPC.Offset, &dwLineDisplacement, &lineInfo )) ) {
|
||||
Printf(_T(" %s line %u"),lineInfo.FileName,lineInfo.LineNumber);
|
||||
if( m_bHasSymbol == FALSE )
|
||||
m_bHasSymbol = TRUE;
|
||||
}
|
||||
Printf( _T("\r\n") );
|
||||
|
||||
// Write out the variables, if desired
|
||||
if( bWriteVariables ) {
|
||||
// Use SymSetContext to get just the locals/params for this frame
|
||||
IMAGEHLP_STACK_FRAME imagehlpStackFrame;
|
||||
|
||||
imagehlpStackFrame.InstructionOffset = sf.AddrPC.Offset;
|
||||
if( m_DBGHELP.SymSetContext )
|
||||
m_DBGHELP.SymSetContext( m_hProcess, &imagehlpStackFrame, 0 );
|
||||
|
||||
// Enumerate the locals/parameters
|
||||
if( m_DBGHELP.SymEnumSymbols)
|
||||
m_DBGHELP.SymEnumSymbols( m_hProcess, 0, 0, EnumerateSymbolsCallback, &sf );
|
||||
|
||||
Printf( _T("\r\n") );
|
||||
}
|
||||
}
|
||||
Printf( _T( "\r\n" ) );
|
||||
Printf( _T( "\r\n" ) );
|
||||
}
|
||||
|
||||
//
|
||||
// The function invoked by SymEnumSymbols
|
||||
//
|
||||
BOOL CALLBACK CExceptionReport::EnumerateSymbolsCallback( PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext )
|
||||
{
|
||||
char szBuffer[2048];
|
||||
|
||||
__try {
|
||||
if( FormatSymbolValue( pSymInfo, (STACKFRAME *) UserContext, szBuffer, sizeof( szBuffer ) ) )
|
||||
Printf( _T("\t%s\r\n"), szBuffer );
|
||||
}
|
||||
__except( 1 ) {
|
||||
Printf( _T("punting on symbol %s\r\n"), pSymInfo->Name );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// Given a SYMBOL_INFO representing a particular variable, displays its contents.
|
||||
// If it's a user defined type, display the members and their values.
|
||||
//
|
||||
BOOL CExceptionReport::FormatSymbolValue( PSYMBOL_INFO pSym, STACKFRAME * sf, char * pszBuffer, unsigned cbBuffer )
|
||||
{
|
||||
char * pszCurrBuffer = pszBuffer;
|
||||
|
||||
// Indicate if the variable is a local or parameter
|
||||
if( pSym->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER )
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "Parameter " );
|
||||
else if( pSym->Flags & IMAGEHLP_SYMBOL_INFO_LOCAL )
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "Local " );
|
||||
|
||||
// If it's a function, don't do anything.
|
||||
if ( pSym->Tag == 5 ) // SymTagFunction from CVCONST.H from the DIA SDK
|
||||
return FALSE;
|
||||
|
||||
// Emit the variable name
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "\'%s\'", pSym->Name );
|
||||
|
||||
DWORD_PTR pVariable = 0; // Will point to the variable's data in memory
|
||||
|
||||
if( pSym->Flags & IMAGEHLP_SYMBOL_INFO_REGRELATIVE ) {
|
||||
// if ( pSym->Register == 8 ) // EBP is the value 8 (in DBGHELP 5.1)
|
||||
{ // This may change!!!
|
||||
pVariable = sf->AddrFrame.Offset;
|
||||
pVariable += (DWORD_PTR)pSym->Address;
|
||||
}
|
||||
// else
|
||||
// return FALSE;
|
||||
}
|
||||
else if ( pSym->Flags & IMAGEHLP_SYMBOL_INFO_REGISTER ) {
|
||||
return FALSE; // Don't try to report register variable
|
||||
} else {
|
||||
pVariable = (DWORD_PTR)pSym->Address; // It must be a global variable
|
||||
}
|
||||
|
||||
// Determine if the variable is a user defined type (UDT). IF so, bHandled
|
||||
// will return TRUE.
|
||||
BOOL bHandled;
|
||||
pszCurrBuffer = DumpTypeIndex(pszCurrBuffer,pSym->ModBase, pSym->TypeIndex, 0, pVariable, bHandled );
|
||||
if( !bHandled ) {
|
||||
// The symbol wasn't a UDT, so do basic, stupid formatting of the
|
||||
// variable. Based on the size, we're assuming it's a char, WORD, or
|
||||
// DWORD.
|
||||
BasicType basicType = GetBasicType( pSym->TypeIndex, pSym->ModBase );
|
||||
pszCurrBuffer = FormatOutputValue(pszCurrBuffer, basicType, pSym->Size, (PVOID) pVariable );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// If it's a user defined type (UDT), recurse through its members until we're
|
||||
// at fundamental types. When he hit fundamental types, return
|
||||
// bHandled = FALSE, so that FormatSymbolValue() will format them.
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
char *CExceptionReport::DumpTypeIndex( char *pszCurrBuffer, DWORD64 modBase, DWORD dwTypeIndex, unsigned nestingLevel, DWORD_PTR offset, BOOL & bHandled )
|
||||
{
|
||||
bHandled = FALSE;
|
||||
|
||||
if( !m_DBGHELP.SymGetTypeInfo )
|
||||
return NULL;
|
||||
|
||||
// Get the name of the symbol. This will either be a Type name (if a UDT), or the structure member name.
|
||||
WCHAR * pwszTypeName;
|
||||
if( m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, dwTypeIndex, TI_GET_SYMNAME, &pwszTypeName ) ) {
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " %ls", pwszTypeName );
|
||||
LocalFree( pwszTypeName );
|
||||
}
|
||||
|
||||
// Determine how many children this type has.
|
||||
DWORD dwChildrenCount = 0;
|
||||
m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, &dwChildrenCount );
|
||||
|
||||
if( !dwChildrenCount ) // If no children, we're done
|
||||
return pszCurrBuffer;
|
||||
|
||||
// Prepare to get an array of "TypeIds", representing each of the children.
|
||||
// SymGetTypeInfo(TI_FINDCHILDREN) expects more memory than just a
|
||||
// TI_FINDCHILDREN_PARAMS struct has. Use derivation to accomplish this.
|
||||
struct FINDCHILDREN : TI_FINDCHILDREN_PARAMS {
|
||||
ULONG MoreChildIds[1024];
|
||||
FINDCHILDREN(){Count = sizeof(MoreChildIds) / sizeof(MoreChildIds[0]);}
|
||||
} children;
|
||||
|
||||
children.Count = dwChildrenCount;
|
||||
children.Start= 0;
|
||||
// Get the array of TypeIds, one for each child type
|
||||
if( !m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, dwTypeIndex, TI_FINDCHILDREN, &children ) ) {
|
||||
return pszCurrBuffer;
|
||||
}
|
||||
|
||||
// Append a line feed
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "\r\n" );
|
||||
|
||||
// Iterate through each of the children
|
||||
for( unsigned i = 0; i < dwChildrenCount; i++ ) {
|
||||
// Add appropriate indentation level (since this routine is recursive)
|
||||
for( unsigned j = 0; j <= nestingLevel+1; j++ )
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "\t" );
|
||||
|
||||
// Recurse for each of the child types
|
||||
BOOL bHandled2;
|
||||
pszCurrBuffer = DumpTypeIndex( pszCurrBuffer, modBase, children.ChildId[i], nestingLevel+1, offset, bHandled2 );
|
||||
|
||||
// If the child wasn't a UDT, format it appropriately
|
||||
if( !bHandled2 ) {
|
||||
// Get the offset of the child member, relative to its parent
|
||||
DWORD dwMemberOffset;
|
||||
m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, children.ChildId[i], TI_GET_OFFSET, &dwMemberOffset );
|
||||
|
||||
// Get the real "TypeId" of the child. We need this for the SymGetTypeInfo( TI_GET_TYPEID ) call below.
|
||||
DWORD typeId;
|
||||
m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, children.ChildId[i], TI_GET_TYPEID, &typeId );
|
||||
|
||||
// Get the size of the child member
|
||||
ULONG64 length;
|
||||
m_DBGHELP.SymGetTypeInfo(m_hProcess, modBase, typeId, TI_GET_LENGTH,&length);
|
||||
|
||||
// Calculate the address of the member
|
||||
DWORD_PTR dwFinalOffset = offset + dwMemberOffset;
|
||||
|
||||
BasicType basicType = GetBasicType(children.ChildId[i], modBase );
|
||||
|
||||
pszCurrBuffer = FormatOutputValue( pszCurrBuffer, basicType, length, (PVOID)dwFinalOffset );
|
||||
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, "\r\n" );
|
||||
}
|
||||
}
|
||||
|
||||
bHandled = TRUE;
|
||||
return pszCurrBuffer;
|
||||
}
|
||||
|
||||
char *CExceptionReport::FormatOutputValue( char *pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress )
|
||||
{
|
||||
// Format appropriately (assuming it's a 1, 2, or 4 bytes (!!!)
|
||||
if( length == 1 )
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = %X", *(PBYTE)pAddress );
|
||||
else if ( length == 2 )
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = %X", *(PWORD)pAddress );
|
||||
else if ( length == 4 ) {
|
||||
if ( basicType == btFloat ) {
|
||||
pszCurrBuffer += sprintf(pszCurrBuffer," = %f", *(PFLOAT)pAddress);
|
||||
} else if ( basicType == btChar ) {
|
||||
if( !IsBadStringPtr( *(PSTR*)pAddress, 32) ) {
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = \"%.31s\"", *(PDWORD)pAddress );
|
||||
} else
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = %X", *(PDWORD)pAddress );
|
||||
} else
|
||||
pszCurrBuffer += sprintf(pszCurrBuffer," = %X", *(PDWORD)pAddress);
|
||||
} else if ( length == 8 ) {
|
||||
if( basicType == btFloat ) {
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = %lf", *(double *)pAddress );
|
||||
} else
|
||||
pszCurrBuffer += sprintf( pszCurrBuffer, " = %I64X", *(DWORD64*)pAddress );
|
||||
}
|
||||
return pszCurrBuffer;
|
||||
}
|
||||
|
||||
BasicType CExceptionReport::GetBasicType( DWORD typeIndex, DWORD64 modBase )
|
||||
{
|
||||
BasicType basicType;
|
||||
|
||||
if( !m_DBGHELP.SymGetTypeInfo )
|
||||
return btNoType;
|
||||
if( m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, typeIndex, TI_GET_BASETYPE, &basicType ) ) {
|
||||
return basicType;
|
||||
}
|
||||
// Get the real "TypeId" of the child. We need this for the
|
||||
// SymGetTypeInfo( TI_GET_TYPEID ) call below.
|
||||
DWORD typeId;
|
||||
if (m_DBGHELP.SymGetTypeInfo(m_hProcess,modBase, typeIndex, TI_GET_TYPEID, &typeId)) {
|
||||
if ( m_DBGHELP.SymGetTypeInfo( m_hProcess, modBase, typeId, TI_GET_BASETYPE, &basicType ) ) {
|
||||
return basicType;
|
||||
}
|
||||
}
|
||||
return btNoType;
|
||||
}
|
||||
|
||||
#define BYTES_PER_LINE 16
|
||||
#define SHIFT_NUM 4
|
||||
|
||||
#define IsPrint(c) ( isprint(c) || ((c) >= 0xA1) && ((c) <= 0xFE) )
|
||||
//
|
||||
// Memory Dump function
|
||||
//
|
||||
void CExceptionReport::Dump( DWORD64 dw64Offset, DWORD dwSize, BOOL bAlign )
|
||||
{
|
||||
DWORD dwLoc, dwILoc, dwX;
|
||||
LPBYTE pOut = (LPBYTE) dw64Offset;
|
||||
|
||||
if( bAlign == TRUE )
|
||||
pOut = (LPBYTE) ((dw64Offset >> SHIFT_NUM) << SHIFT_NUM);
|
||||
for( dwLoc = 0; dwLoc < dwSize; dwLoc += 16, pOut += BYTES_PER_LINE ) {
|
||||
LPBYTE pLine = pOut;
|
||||
|
||||
Printf( _T( "%08lX: " ), (DWORD64) pOut );
|
||||
for( dwX = 0, dwILoc = dwLoc; dwX < BYTES_PER_LINE; dwX++ ) {
|
||||
if( dwX == (BYTES_PER_LINE / 2) )
|
||||
Printf( _T( " " ) );
|
||||
if( dwILoc++ > dwSize ) {
|
||||
Printf( _T( "?? " ) );
|
||||
} else {
|
||||
Printf( _T( "%02X " ), *(pLine++) );
|
||||
}
|
||||
}
|
||||
pLine = pOut;
|
||||
Printf( " " );
|
||||
for( dwX = 0, dwILoc = dwLoc; dwX < BYTES_PER_LINE; dwX++ ) {
|
||||
if( dwILoc++ > dwSize ) {
|
||||
Printf( _T( " " ) );
|
||||
} else {
|
||||
Printf( _T( "%c" ), isprint( *pLine ) ? *pLine : '.');
|
||||
pLine++;
|
||||
}
|
||||
}
|
||||
Printf( "\r\n" );
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Helper function that writes to the report file, and allows the user to use printf style formating
|
||||
//
|
||||
int __cdecl CExceptionReport::Printf( const TCHAR * format, ... )
|
||||
{
|
||||
TCHAR szBuff[2048];
|
||||
int retValue;
|
||||
DWORD cbWritten;
|
||||
va_list argptr;
|
||||
|
||||
va_start( argptr, format );
|
||||
retValue = vsprintf( szBuff, format, argptr );
|
||||
va_end( argptr );
|
||||
WriteFile( m_hReportFile, szBuff, retValue * sizeof( TCHAR ), &cbWritten, 0 );
|
||||
return retValue;
|
||||
}
|
||||
123
GameTools/NeoRylClient/ExceptionReport.H
Normal file
123
GameTools/NeoRylClient/ExceptionReport.H
Normal file
@@ -0,0 +1,123 @@
|
||||
#pragma once
|
||||
|
||||
#define USE_MINIDUMP 1
|
||||
#define USE_DBGHELPS 0
|
||||
|
||||
#include <dbghelp.h>
|
||||
|
||||
#include "DLLModule.h"
|
||||
|
||||
class CDBGFuncClass : public CDLLModule
|
||||
{
|
||||
public :
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, MiniDumpWriteDump, ( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, CONST PMINIDUMP_EXCEPTION_INFORMATION, CONST PMINIDUMP_USER_STREAM_INFORMATION, CONST PMINIDUMP_CALLBACK_INFORMATION ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymEnumSymbols, ( HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID ) )
|
||||
DECLARE_DLL_FUNCTION( ULONG, WINAPI, SymSetContext, ( HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymFromAddr, ( HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO ) )
|
||||
// DECLARE_DLL_FUNCTION( BOOL, WINAPI, StackWalk64, ( DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID, PREAD_PROCESS_MEMORY_ROUTINE64, PFUNCTION_TABLE_ACCESS_ROUTINE64, PGET_MODULE_BASE_ROUTINE64, PTRANSLATE_ADDRESS_ROUTINE64 ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, StackWalk, ( DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymGetLineFromAddr, ( HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE ) ) // ImageHlp
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymGetLineFromAddr64, ( HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64 ) )
|
||||
DECLARE_DLL_FUNCTION( PVOID, WINAPI, SymFunctionTableAccess, ( HANDLE, DWORD ) ) // ImageHlp
|
||||
// DECLARE_DLL_FUNCTION( PVOID, WINAPI, SymFunctionTableAccess64, ( HANDLE, DWORD64 ) )
|
||||
DECLARE_DLL_FUNCTION( DWORD64,WINAPI, SymGetModuleBase64, ( HANDLE, DWORD64 ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymInitialize, ( HANDLE, PSTR, BOOL ) )
|
||||
DECLARE_DLL_FUNCTION( DWORD, WINAPI, SymSetOptions, ( DWORD ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymCleanup, ( HANDLE ) )
|
||||
// DECLARE_DLL_FUNCTION( DWORD64,WINAPI, SymGetModuleBase64, ( HANDLE, DWORD64 ) )
|
||||
DECLARE_DLL_FUNCTION( DWORD, WINAPI, SymGetModuleBase, ( HANDLE, DWORD ) )
|
||||
DECLARE_DLL_FUNCTION( BOOL, WINAPI, SymGetTypeInfo, ( HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID ) )
|
||||
|
||||
public:
|
||||
BEGIN_DLL_INIT()
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, MiniDumpWriteDump, ( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, CONST PMINIDUMP_EXCEPTION_INFORMATION, CONST PMINIDUMP_USER_STREAM_INFORMATION, CONST PMINIDUMP_CALLBACK_INFORMATION ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymEnumSymbols, ( HANDLE, ULONG64, PCSTR, PSYM_ENUMERATESYMBOLS_CALLBACK, PVOID ) )
|
||||
INIT_DLL_FUNCTION( ULONG, WINAPI, SymSetContext, ( HANDLE, PIMAGEHLP_STACK_FRAME, PIMAGEHLP_CONTEXT ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymFromAddr, ( HANDLE, DWORD64, PDWORD64, PSYMBOL_INFO ) )
|
||||
// INIT_DLL_FUNCTION( BOOL, WINAPI, StackWalk64, ( DWORD, HANDLE, HANDLE, LPSTACKFRAME64, PVOID, PREAD_PROCESS_MEMORY_ROUTINE64, PFUNCTION_TABLE_ACCESS_ROUTINE64, PGET_MODULE_BASE_ROUTINE64, PTRANSLATE_ADDRESS_ROUTINE64 ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, StackWalk, ( DWORD, HANDLE, HANDLE, LPSTACKFRAME, PVOID, PREAD_PROCESS_MEMORY_ROUTINE, PFUNCTION_TABLE_ACCESS_ROUTINE, PGET_MODULE_BASE_ROUTINE, PTRANSLATE_ADDRESS_ROUTINE ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymGetLineFromAddr, ( HANDLE, DWORD, PDWORD, PIMAGEHLP_LINE ) ) // ImageHlp
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymGetLineFromAddr64, ( HANDLE, DWORD64, PDWORD, PIMAGEHLP_LINE64 ) )
|
||||
INIT_DLL_FUNCTION( PVOID, WINAPI, SymFunctionTableAccess, ( HANDLE, DWORD ) )
|
||||
// INIT_DLL_FUNCTION( PVOID, WINAPI, SymFunctionTableAccess64, ( HANDLE, DWORD64 ) )
|
||||
INIT_DLL_FUNCTION( DWORD64,WINAPI, SymGetModuleBase64, ( HANDLE, DWORD64 ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymInitialize, ( HANDLE, PSTR, BOOL ) )
|
||||
INIT_DLL_FUNCTION( DWORD, WINAPI, SymSetOptions, ( DWORD ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymCleanup, ( HANDLE ) )
|
||||
// INIT_DLL_FUNCTION( DWORD64,WINAPI, SymGetModuleBase64, ( HANDLE, DWORD64 ) )
|
||||
INIT_DLL_FUNCTION( DWORD, WINAPI, SymGetModuleBase, ( HANDLE, DWORD ) )
|
||||
INIT_DLL_FUNCTION( BOOL, WINAPI, SymGetTypeInfo, ( HANDLE, DWORD64, ULONG, IMAGEHLP_SYMBOL_TYPE_INFO, PVOID ) )
|
||||
END_DLL_INIT()
|
||||
};
|
||||
|
||||
enum BasicType // Stolen from CVCONST.H in the DIA 2.0 SDK
|
||||
{
|
||||
btNoType = 0,
|
||||
btVoid = 1,
|
||||
btChar = 2,
|
||||
btWChar = 3,
|
||||
btInt = 6,
|
||||
btUInt = 7,
|
||||
btFloat = 8,
|
||||
btBCD = 9,
|
||||
btBool = 10,
|
||||
btLong = 13,
|
||||
btULong = 14,
|
||||
btCurrency = 25,
|
||||
btDate = 26,
|
||||
btVariant = 27,
|
||||
btComplex = 28,
|
||||
btBit = 29,
|
||||
btBSTR = 30,
|
||||
btHresult = 31
|
||||
};
|
||||
|
||||
typedef LONG (WINAPI *PCERUserFunc)( HANDLE hFile );
|
||||
typedef PCERUserFunc LPCERUserFunc;
|
||||
|
||||
class CExceptionReport
|
||||
{
|
||||
public:
|
||||
CExceptionReport();
|
||||
~CExceptionReport();
|
||||
|
||||
static void SetProgramName( PTSTR pszProgamName = NULL );
|
||||
static void SetUserFunc( LPCERUserFunc lpUserFunc );
|
||||
static void SetWriteInfo(BOOL bWriteInfo) { m_bWriteInfo = bWriteInfo; }
|
||||
|
||||
static LONG WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS pExceptionInfo );
|
||||
static LONG WINAPI UnhandledExceptionFilterTwo( PEXCEPTION_POINTERS pExceptionInfo );
|
||||
|
||||
static int __cdecl Printf( const TCHAR * format, ... );
|
||||
|
||||
private:
|
||||
static CDBGFuncClass m_DBGHELP;
|
||||
|
||||
static void WriteBasicInfo( PEXCEPTION_RECORD pExceptionRecord );
|
||||
static void WriteExceptionReport( PEXCEPTION_POINTERS pExceptionInfo );
|
||||
static void WriteStackDetails( PCONTEXT pContext, BOOL bWriteVariables );
|
||||
static void WriteRegistersInfo( PCONTEXT pContext );
|
||||
static void WriteMemoryDump( PCONTEXT pContext );
|
||||
|
||||
static void StoreCoreDump( void );
|
||||
static void Dump( DWORD64 pData, DWORD dwSize, BOOL bAlign );
|
||||
|
||||
static LPTSTR GetExceptionString( DWORD dwCode );
|
||||
static BOOL GetLogicalAddress( PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD& offset );
|
||||
static BOOL CALLBACK EnumerateSymbolsCallback(PSYMBOL_INFO,ULONG, PVOID);
|
||||
static BOOL FormatSymbolValue( PSYMBOL_INFO, STACKFRAME *, char * pszBuffer, unsigned cbBuffer );
|
||||
static char * DumpTypeIndex( char *, DWORD64, DWORD, unsigned, DWORD_PTR, BOOL & );
|
||||
static char * FormatOutputValue( char * pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress );
|
||||
static BasicType GetBasicType( DWORD typeIndex, DWORD64 modBase );
|
||||
|
||||
static LPCERUserFunc m_lpUserFunc;
|
||||
static LPTOP_LEVEL_EXCEPTION_FILTER m_OldFilter;
|
||||
static TCHAR m_szLogPrefixName[ MAX_PATH ];
|
||||
static TCHAR m_szModuleName[ MAX_PATH ];
|
||||
static HANDLE m_hReportFile;
|
||||
static HANDLE m_hProcess;
|
||||
static BOOL m_bHasSymbol;
|
||||
static BOOL m_bWriteInfo;
|
||||
};
|
||||
|
||||
extern CExceptionReport g_CExceptionReport;
|
||||
264
GameTools/NeoRylClient/GUIButton.cpp
Normal file
264
GameTools/NeoRylClient/GUIButton.cpp
Normal file
@@ -0,0 +1,264 @@
|
||||
// GUIButton.cpp: implementation of the CGUIButton class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "SoundBuffer.h"
|
||||
#include "SoundManager.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUIButton.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUIButton::CGUIButton()
|
||||
{
|
||||
m_lpNormalButton = NULL;
|
||||
m_lpOnMouseButton = NULL;
|
||||
m_lpClickMouseButton = NULL;
|
||||
|
||||
m_lpTooltip = NULL;
|
||||
|
||||
m_bExistItemPress = FALSE;
|
||||
m_bShow = TRUE;
|
||||
m_bPress = FALSE;
|
||||
m_nState = BUTTON_NONE;
|
||||
m_nMethod = BUTTON_NORMAL;
|
||||
|
||||
m_lMoveX = 0;
|
||||
m_lMoveY = 0;
|
||||
}
|
||||
|
||||
CGUIButton::~CGUIButton()
|
||||
{
|
||||
if(m_lpNormalButton) { delete m_lpNormalButton; m_lpNormalButton = NULL; }
|
||||
if(m_lpOnMouseButton) { delete m_lpOnMouseButton; m_lpOnMouseButton = NULL; }
|
||||
if(m_lpClickMouseButton) { delete m_lpClickMouseButton; m_lpClickMouseButton = NULL; }
|
||||
}
|
||||
|
||||
void CGUIButton::Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha, long x, long y)
|
||||
{
|
||||
if(m_bShow)
|
||||
{
|
||||
switch(m_nState)
|
||||
{
|
||||
case BUTTON_OFF:
|
||||
case BUTTON_NONE:
|
||||
m_lpNormalButton->Render(lpD3DDevice, cAlpha, m_lMoveX + x, m_lMoveY + y);
|
||||
break;
|
||||
|
||||
case BUTTON_OVER:
|
||||
m_lpOnMouseButton->Render(lpD3DDevice, cAlpha, m_lMoveX + x, m_lMoveY + y);
|
||||
break;
|
||||
|
||||
case BUTTON_PRESS:
|
||||
case BUTTON_CLICK:
|
||||
case BUTTON_ON:
|
||||
case BUTTON_HOLD:
|
||||
m_lpClickMouseButton->Render(lpD3DDevice, cAlpha, m_lMoveX + x, m_lMoveY + y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUIButton::SetTooltip(CGUITooltipManager *lpTooltipManager, const char *strTooltip)
|
||||
{
|
||||
if(!m_lpTooltip)
|
||||
{
|
||||
m_lpTooltip = new CGUITooltipButton;
|
||||
m_lpTooltip->InitTooltip(strTooltip);
|
||||
m_lpTooltip->SetRect( m_lpNormalButton->m_nPutX + m_lMoveX, m_lpNormalButton->m_nPutY + m_lMoveY,
|
||||
m_lpNormalButton->m_nPutX + m_lMoveX + m_lpNormalButton->GetSizeX(),
|
||||
m_lpNormalButton->m_nPutY + m_lMoveY + m_lpNormalButton->GetSizeY() );
|
||||
lpTooltipManager->AddTooltip(m_lpTooltip);
|
||||
} else
|
||||
{
|
||||
m_lpTooltip->InitTooltip(strTooltip);
|
||||
}
|
||||
}
|
||||
|
||||
void CGUIButton::Update()
|
||||
{
|
||||
if(!m_bShow || (!m_bExistItemPress && g_ClientMain.m_lpPickItem))
|
||||
{
|
||||
m_nState = BUTTON_NONE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RECT rc;
|
||||
rc.left = m_lpNormalButton->m_nPutX + m_lMoveX;
|
||||
rc.right = m_lpNormalButton->m_nPutX + m_lMoveX + m_lpNormalButton->GetSizeX() - 1;
|
||||
rc.top = m_lpNormalButton->m_nPutY + m_lMoveY;
|
||||
rc.bottom = m_lpNormalButton->m_nPutY + m_lMoveY + m_lpNormalButton->GetSizeY() - 1;
|
||||
|
||||
if(m_nMethod == BUTTON_NORMAL)
|
||||
{
|
||||
if(g_DeviceInput.InRect(rc.left, rc.top, rc.right, rc.bottom))
|
||||
{
|
||||
m_nState = BUTTON_OVER;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
m_bPress = TRUE;
|
||||
CSoundManager &sm = CSoundManager::GetInstance();
|
||||
char Temp[MAX_PATH];
|
||||
sprintf(Temp, "%s\\Sound\\Interface\\click.mnd", g_ClientMain.m_strClientPath);
|
||||
ISoundObject &sb = sm.GetBuffer(Temp, false);
|
||||
sb.Play(false);
|
||||
}
|
||||
|
||||
if(m_bPress)
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMousePress())
|
||||
{
|
||||
m_nState = BUTTON_PRESS;
|
||||
} else if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
m_nState = BUTTON_CLICK;
|
||||
m_bPress = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_bPress && g_DeviceInput.GetIsLeftMousePress())
|
||||
m_nState = BUTTON_PRESS;
|
||||
else
|
||||
m_nState = BUTTON_NONE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
m_bPress = FALSE;
|
||||
}
|
||||
}
|
||||
} else if(m_nMethod == BUTTON_SIMPLE)
|
||||
{
|
||||
if(g_DeviceInput.InRect(rc.left, rc.top, rc.right, rc.bottom))
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
m_bPress = TRUE;
|
||||
CSoundManager &sm = CSoundManager::GetInstance();
|
||||
char Temp[MAX_PATH];
|
||||
sprintf(Temp, "%s\\Sound\\Interface\\click.mnd", g_ClientMain.m_strClientPath);
|
||||
ISoundObject &sb = sm.GetBuffer(Temp, false);
|
||||
sb.Play(false);
|
||||
}
|
||||
|
||||
if(m_bPress)
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMousePress())
|
||||
{
|
||||
m_nState = BUTTON_PRESS;
|
||||
} else if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
m_nState = BUTTON_CLICK;
|
||||
m_bPress = FALSE;
|
||||
}
|
||||
} else
|
||||
{
|
||||
m_nState = BUTTON_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_bPress && g_DeviceInput.GetIsLeftMousePress())
|
||||
m_nState = BUTTON_PRESS;
|
||||
else
|
||||
m_nState = BUTTON_NONE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
m_bPress = FALSE;
|
||||
}
|
||||
}
|
||||
} else if(m_nMethod == BUTTON_SIMPLECHECK)
|
||||
{
|
||||
if(m_nState == BUTTON_OFF)
|
||||
{
|
||||
m_nState = BUTTON_NONE;
|
||||
} else if(m_nState == BUTTON_ON)
|
||||
{
|
||||
m_nState = BUTTON_HOLD;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.InRect(rc.left, rc.top, rc.right, rc.bottom) && g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
CSoundManager &sm = CSoundManager::GetInstance();
|
||||
char Temp[MAX_PATH];
|
||||
sprintf(Temp, "%s\\Sound\\Interface\\click.mnd", g_ClientMain.m_strClientPath);
|
||||
ISoundObject &sb = sm.GetBuffer(Temp, false);
|
||||
sb.Play(false);
|
||||
}/**/
|
||||
// CZ3DSound::QuickPlay("\\Interface\\click.mnd");
|
||||
if(m_nState == BUTTON_NONE)
|
||||
{
|
||||
m_nState = BUTTON_ON;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nState = BUTTON_OFF;
|
||||
}
|
||||
}
|
||||
} else if(m_nMethod == BUTTON_CHECK)
|
||||
{
|
||||
if(m_nState == BUTTON_OFF)
|
||||
{
|
||||
m_nState = BUTTON_NONE;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.InRect(rc.left, rc.top, rc.right, rc.bottom))
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
CSoundManager &sm = CSoundManager::GetInstance();
|
||||
char Temp[MAX_PATH];
|
||||
sprintf(Temp, "%s\\Sound\\Interface\\click.mnd", g_ClientMain.m_strClientPath);
|
||||
ISoundObject &sb = sm.GetBuffer(Temp, false);
|
||||
sb.Play(false);
|
||||
}/**/
|
||||
if(m_nState == BUTTON_NONE || m_nState == BUTTON_OVER || m_nState == BUTTON_PRESS)
|
||||
{
|
||||
m_nState = BUTTON_OVER;
|
||||
if(g_DeviceInput.GetIsLeftMousePress())
|
||||
{
|
||||
m_nState = BUTTON_PRESS;
|
||||
}
|
||||
if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
// CZ3DSound::QuickPlay("\\Interface\\click.mnd");
|
||||
m_nState = BUTTON_CLICK;//¼¼ÆÃ
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nState = BUTTON_ON;
|
||||
if(g_DeviceInput.GetIsLeftMousePress())
|
||||
{
|
||||
m_nState = BUTTON_HOLD;
|
||||
}
|
||||
if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
// CZ3DSound::QuickPlay("\\Interface\\click.mnd");
|
||||
m_nState = BUTTON_OFF;//¼¼ÆÃ
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_nState == BUTTON_NONE || m_nState == BUTTON_OVER || m_nState == BUTTON_PRESS)
|
||||
m_nState = BUTTON_NONE;
|
||||
else
|
||||
m_nState = BUTTON_ON;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseUp())
|
||||
{
|
||||
m_bPress = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
69
GameTools/NeoRylClient/GUIButton.h
Normal file
69
GameTools/NeoRylClient/GUIButton.h
Normal file
@@ -0,0 +1,69 @@
|
||||
// GUIButton.h: interface for the CGUIButton class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUIBUTTON_H__69F2BC23_45CD_4DF9_86C8_597585E6AE49__INCLUDED_)
|
||||
#define AFX_GUIBUTTON_H__69F2BC23_45CD_4DF9_86C8_597585E6AE49__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define BUTTON_NORMAL 0
|
||||
#define BUTTON_CHECK 1
|
||||
#define BUTTON_SIMPLE 2
|
||||
#define BUTTON_SIMPLECHECK 3
|
||||
|
||||
#define BUTTON_NONE 0
|
||||
#define BUTTON_OVER 1
|
||||
#define BUTTON_PRESS 2
|
||||
#define BUTTON_CLICK 3
|
||||
#define BUTTON_ON 4
|
||||
#define BUTTON_HOLD 5
|
||||
#define BUTTON_OFF 6
|
||||
|
||||
#include "Sprite.h"
|
||||
#include "GUITooltipButton.h"
|
||||
#include "GUITooltipManager.h"
|
||||
|
||||
class CGUIButton
|
||||
{
|
||||
public:
|
||||
void Update(void);
|
||||
long m_nMethod;
|
||||
CSprite *m_lpNormalButton;
|
||||
CSprite *m_lpOnMouseButton;
|
||||
CSprite *m_lpClickMouseButton;
|
||||
CGUITooltipButton *m_lpTooltip;
|
||||
BOOL m_bShow;
|
||||
long m_nState;
|
||||
long m_lMoveX;
|
||||
long m_lMoveY;
|
||||
BOOL m_bPress;
|
||||
BOOL m_bExistItemPress;
|
||||
|
||||
CGUIButton();
|
||||
~CGUIButton();
|
||||
|
||||
void SetMove(long lMoveX, long lMoveY)
|
||||
{
|
||||
m_lMoveX = lMoveX; m_lMoveY = lMoveY;
|
||||
if(m_lpTooltip)
|
||||
{
|
||||
m_lpTooltip->SetRect( m_lpNormalButton->m_nPutX + m_lMoveX, m_lpNormalButton->m_nPutY + m_lMoveY,
|
||||
m_lpNormalButton->m_nPutX + m_lMoveX + m_lpNormalButton->GetSizeX(),
|
||||
m_lpNormalButton->m_nPutY + m_lMoveY + m_lpNormalButton->GetSizeY() );
|
||||
}
|
||||
}
|
||||
long GetMoveX(void) { return m_lMoveX; }
|
||||
long GetMoveY(void) { return m_lMoveY; }
|
||||
void ShowButton(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
if(m_lpTooltip && m_lpTooltip->GetIsTooltip()) m_lpTooltip->m_bShow = bShow;
|
||||
}
|
||||
void SetTooltip(CGUITooltipManager *lpTooltipManager, const char *strTooltip);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha = 0xFF, long x = 0, long y = 0);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUIBUTTON_H__69F2BC23_45CD_4DF9_86C8_597585E6AE49__INCLUDED_)
|
||||
60
GameTools/NeoRylClient/GUIButtonManager.cpp
Normal file
60
GameTools/NeoRylClient/GUIButtonManager.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
// GUIButtonManager.cpp: implementation of the CGUIButtonManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "GUIButtonManager.h"
|
||||
|
||||
CGUIButtonManager g_ButtonManager;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUIButtonManager::CGUIButtonManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CGUIButtonManager::~CGUIButtonManager()
|
||||
{
|
||||
DestroyAllButton();
|
||||
}
|
||||
|
||||
BOOL CGUIButtonManager::AddButton(CGUIButton *pButton)
|
||||
{
|
||||
m_lstButton.push_back(pButton);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CGUIButtonManager::Update(void)
|
||||
{
|
||||
vector<CGUIButton *>::iterator it;
|
||||
|
||||
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
||||
{
|
||||
(*it)->Update();
|
||||
}
|
||||
}
|
||||
|
||||
void CGUIButtonManager::DestroyAllButton()
|
||||
{
|
||||
vector<CGUIButton *>::iterator it;
|
||||
|
||||
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
||||
{
|
||||
if((*it)) { delete (*it); (*it) = NULL; }
|
||||
}
|
||||
|
||||
m_lstButton.clear();
|
||||
}
|
||||
|
||||
void CGUIButtonManager::Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha)
|
||||
{
|
||||
vector<CGUIButton *>::iterator it;
|
||||
|
||||
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
||||
{
|
||||
if((*it)->m_bShow) (*it)->Render(lpD3DDevice, cAlpha);
|
||||
}
|
||||
}
|
||||
44
GameTools/NeoRylClient/GUIButtonManager.h
Normal file
44
GameTools/NeoRylClient/GUIButtonManager.h
Normal file
@@ -0,0 +1,44 @@
|
||||
// GUIButtonManager.h: interface for the CGUIButtonManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUIBUTTONMANAGER_H__148D53DB_B19B_4701_A72A_CBE12492825A__INCLUDED_)
|
||||
#define AFX_GUIBUTTONMANAGER_H__148D53DB_B19B_4701_A72A_CBE12492825A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <vector>
|
||||
#include "GUIButton.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUIButtonManager
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
vector<CGUIButton *> m_lstButton;
|
||||
|
||||
void SetMove(long lMoveX, long lMoveY)
|
||||
{
|
||||
vector<CGUIButton *>::iterator it;
|
||||
|
||||
for(it = m_lstButton.begin(); it != m_lstButton.end(); it++)
|
||||
{
|
||||
(*it)->SetMove(lMoveX, lMoveY);
|
||||
}
|
||||
}
|
||||
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha = 0xFF);
|
||||
void DestroyAllButton(void);
|
||||
void Update(void);
|
||||
BOOL AddButton(CGUIButton *pButton);
|
||||
CGUIButtonManager();
|
||||
~CGUIButtonManager();
|
||||
};
|
||||
|
||||
extern CGUIButtonManager g_ButtonManager;
|
||||
|
||||
#endif // !defined(AFX_GUIBUTTONMANAGER_H__148D53DB_B19B_4701_A72A_CBE12492825A__INCLUDED_)
|
||||
542
GameTools/NeoRylClient/GUIMessageBox.cpp
Normal file
542
GameTools/NeoRylClient/GUIMessageBox.cpp
Normal file
@@ -0,0 +1,542 @@
|
||||
// GUIMessageBox.cpp: implementation of the CGUIMessageBox class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "GUIMessageBox.h"
|
||||
#include "GUIMessageBoxManager.h"
|
||||
#include "Creature\NPC\NPCList.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
CGUIMessageBox::CGUIMessageBox(void)
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
m_lTick = 3000;
|
||||
m_lpResultValue = NULL;
|
||||
m_lpValue = NULL;
|
||||
m_lpstrValue = NULL;
|
||||
m_bEnableEnter = TRUE;
|
||||
m_bWordBreak = TRUE;
|
||||
}
|
||||
|
||||
CGUIMessageBox::~CGUIMessageBox()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void CGUIMessageBox::Create(const char *strMessage, unsigned long dwFlag, float posX, float posY)
|
||||
{
|
||||
m_dwFlag = dwFlag;
|
||||
|
||||
if(m_dwFlag & MB_EXIT)
|
||||
{
|
||||
m_btnButton[4].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[4].m_bExistItemPress = TRUE;
|
||||
m_btnButton[4].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[4].m_lpNormalButton->Create(0, 0, 92, 68, 105, 79, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[4].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[4].m_lpClickMouseButton->Create(0, 0, 105, 68, 118, 79, g_MessageBoxManager.m_lpTexture);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_PREV)
|
||||
{
|
||||
m_btnButton[2].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[2].m_bExistItemPress = TRUE;
|
||||
m_btnButton[2].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[2].m_lpNormalButton->Create(0, 0, 92, 91, 105, 103, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[2].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[2].m_lpClickMouseButton->Create(0, 0, 105, 91, 118, 103, g_MessageBoxManager.m_lpTexture);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_NEXT)
|
||||
{
|
||||
m_btnButton[3].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[3].m_bExistItemPress = TRUE;
|
||||
m_btnButton[3].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[3].m_lpNormalButton->Create(0, 0, 92, 79, 105, 91, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[3].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[3].m_lpClickMouseButton->Create(0, 0, 105, 79, 105, 91, g_MessageBoxManager.m_lpTexture);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_CONFIRM)
|
||||
{
|
||||
m_btnButton[0].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[0].m_bExistItemPress = TRUE;
|
||||
m_btnButton[0].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[0].m_lpNormalButton->Create(0, 0, 3, 100, 44, 117, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[0].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[0].m_lpClickMouseButton->Create(0, 0, 44, 100, 85, 117, g_MessageBoxManager.m_lpTexture);
|
||||
} else if(m_dwFlag & MB_YES)
|
||||
{
|
||||
m_btnButton[0].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[0].m_bExistItemPress = TRUE;
|
||||
m_btnButton[0].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[0].m_lpNormalButton->Create(0, 0, 3, 66, 44, 83, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[0].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[0].m_lpClickMouseButton->Create(0, 0, 44, 66, 85, 83, g_MessageBoxManager.m_lpTexture);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_CANCEL)
|
||||
{
|
||||
m_btnButton[1].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[1].m_bExistItemPress = TRUE;
|
||||
m_btnButton[1].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[1].m_lpNormalButton->Create(0, 0, 3, 117, 44, 134, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[1].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[1].m_lpClickMouseButton->Create(0, 0, 44, 117, 85, 134, g_MessageBoxManager.m_lpTexture);
|
||||
} else if(m_dwFlag & MB_NO)
|
||||
{
|
||||
m_btnButton[1].m_nMethod = BUTTON_SIMPLE;
|
||||
m_btnButton[1].m_bExistItemPress = TRUE;
|
||||
m_btnButton[1].m_lpNormalButton = new CSprite;
|
||||
m_btnButton[1].m_lpNormalButton->Create(0, 0, 3, 83, 44, 100, g_MessageBoxManager.m_lpTexture);
|
||||
m_btnButton[1].m_lpClickMouseButton = new CSprite;
|
||||
m_btnButton[1].m_lpClickMouseButton->Create(0, 0, 44, 83, 85, 100, g_MessageBoxManager.m_lpTexture);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_NUMBER)
|
||||
{
|
||||
m_spNumber.Create(0, 0, 118, 66, 254, 87, g_MessageBoxManager.m_lpTexture);
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_NUMBER;
|
||||
g_TextEdit.SetFocus();
|
||||
g_TextEdit.SetEditLength(9);
|
||||
// char strText[20];
|
||||
// sprintf(strText, "%u", m_dwValue);
|
||||
// g_TextEdit.SetWindowText(strText);
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_STRING)
|
||||
{
|
||||
m_spNumber.Create(0, 0, 3, 151, 196, 173, g_MessageBoxManager.m_lpTexture);
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_NUMBER;
|
||||
g_TextEdit.SetFocus();
|
||||
g_TextEdit.SetEditLength(30);
|
||||
// char strText[20];
|
||||
// sprintf(strText, "%u", m_dwValue);
|
||||
// g_TextEdit.SetWindowText(strText);
|
||||
}
|
||||
|
||||
m_wIndex[ 0] = 0; m_wIndex[ 1] = 1; m_wIndex[ 2] = 4;
|
||||
m_wIndex[ 3] = 1; m_wIndex[ 4] = 5; m_wIndex[ 5] = 4;
|
||||
m_wIndex[ 6] = 1; m_wIndex[ 7] = 2; m_wIndex[ 8] = 5;
|
||||
m_wIndex[ 9] = 2; m_wIndex[10] = 6; m_wIndex[11] = 5;
|
||||
m_wIndex[12] = 2; m_wIndex[13] = 3; m_wIndex[14] = 6;
|
||||
m_wIndex[15] = 3; m_wIndex[16] = 7; m_wIndex[17] = 6;
|
||||
m_wIndex[18] = 4; m_wIndex[19] = 5; m_wIndex[20] = 8;
|
||||
m_wIndex[21] = 5; m_wIndex[22] = 9; m_wIndex[23] = 8;
|
||||
m_wIndex[24] = 5; m_wIndex[25] = 6; m_wIndex[26] = 9;
|
||||
m_wIndex[27] = 6; m_wIndex[28] = 10; m_wIndex[29] = 9;
|
||||
m_wIndex[30] = 6; m_wIndex[31] = 7; m_wIndex[32] = 10;
|
||||
m_wIndex[33] = 7; m_wIndex[34] = 11; m_wIndex[35] = 10;
|
||||
m_wIndex[36] = 8; m_wIndex[37] = 9; m_wIndex[38] = 12;
|
||||
m_wIndex[39] = 9; m_wIndex[40] = 13; m_wIndex[41] = 12;
|
||||
m_wIndex[42] = 9; m_wIndex[43] = 10; m_wIndex[44] = 13;
|
||||
m_wIndex[45] = 10; m_wIndex[46] = 14; m_wIndex[47] = 13;
|
||||
m_wIndex[48] = 10; m_wIndex[49] = 11; m_wIndex[50] = 14;
|
||||
m_wIndex[51] = 11; m_wIndex[52] = 15; m_wIndex[53] = 14;
|
||||
|
||||
SetText(strMessage);
|
||||
SetPosition(posX, posY);
|
||||
|
||||
g_MessageBoxManager.AddMessageBox(this);
|
||||
}
|
||||
|
||||
BOOL CGUIMessageBox::ShowDialog(unsigned long dwChrID, unsigned long dwPage)
|
||||
{
|
||||
NPCNode *lpNPCNode;
|
||||
lpNPCNode = g_NPCList.GetNPCNode(dwChrID);
|
||||
if(lpNPCNode)
|
||||
{
|
||||
LPDialogNode lpDialog = lpNPCNode->GetScript(dwPage);
|
||||
|
||||
if(lpDialog)
|
||||
{
|
||||
Create(lpDialog->m_strWord, /*lpDialog->m_dwFlag | */MB_EXIT);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CGUIMessageBox::Destroy()
|
||||
{
|
||||
vector<LPWORDNode>::iterator it;
|
||||
vector<char *>::iterator itchar;
|
||||
LPWORDNode lpWord;
|
||||
char *lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpWord = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
for(itchar = lpWord->m_lstMessage.begin(); itchar != lpWord->m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*itchar);
|
||||
itchar = lpWord->m_lstMessage.erase(itchar);
|
||||
|
||||
delete[] lpMessage;
|
||||
}
|
||||
lpWord->m_lstMessage.clear();
|
||||
|
||||
delete lpWord;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
if(m_btnButton[i].m_lpNormalButton) { delete m_btnButton[i].m_lpNormalButton; m_btnButton[i].m_lpNormalButton = NULL; }
|
||||
if(m_btnButton[i].m_lpClickMouseButton) { delete m_btnButton[i].m_lpClickMouseButton; m_btnButton[i].m_lpClickMouseButton = NULL; }
|
||||
}
|
||||
|
||||
if(m_lpResultValue && *m_lpResultValue == 0) *m_lpResultValue = MB_EXIT;
|
||||
if(m_lpValue && *m_lpValue == 0)
|
||||
{
|
||||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||||
{
|
||||
*m_lpValue = atoi(g_TextEdit.GetMessage());
|
||||
} else
|
||||
{
|
||||
*m_lpValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||||
{
|
||||
g_ClientMain.SetFocus();
|
||||
g_TextEdit.InitMessage();
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_TextEdit.SetEditLength(100);
|
||||
}
|
||||
|
||||
g_MessageBoxManager.DeleteMessageBox(this);
|
||||
}
|
||||
|
||||
void CGUIMessageBox::SetText(const char *strMessage)
|
||||
{
|
||||
vector<LPWORDNode>::iterator it;
|
||||
vector<char *>::iterator itchar;
|
||||
LPWORDNode lpWord;
|
||||
char *lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpWord = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
for(itchar = lpWord->m_lstMessage.begin(); itchar != lpWord->m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*itchar);
|
||||
itchar = lpWord->m_lstMessage.erase(itchar);
|
||||
|
||||
delete[] lpMessage;
|
||||
}
|
||||
lpWord->m_lstMessage.clear();
|
||||
|
||||
delete lpWord;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
|
||||
char *strMessageTemp, *strMessageTemp2, *token, seps[] = "\\";
|
||||
strMessageTemp = new char[strlen(strMessage) + 100];
|
||||
|
||||
if(m_bWordBreak)
|
||||
{
|
||||
strcpy(strMessageTemp, g_TextEdit.MakeWordBreak(strMessage, 268));
|
||||
} else
|
||||
{
|
||||
strcpy(strMessageTemp, strMessage);
|
||||
}
|
||||
token = strtok(strMessageTemp, seps);
|
||||
|
||||
while(token != NULL)
|
||||
{
|
||||
{
|
||||
lpWord = new WORDNode;
|
||||
lpWord->m_dwNum = 1; // 임시
|
||||
lpWord->m_bFirstLink = FALSE; // 임시
|
||||
strMessageTemp2 = new char[strlen(token) + 100];
|
||||
strcpy(strMessageTemp2, token);
|
||||
lpWord->m_lstMessage.push_back(strMessageTemp2);
|
||||
}
|
||||
|
||||
m_lstMessage.push_back(lpWord);
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
}
|
||||
|
||||
delete[] strMessageTemp;
|
||||
}
|
||||
|
||||
void CGUIMessageBox::SetPosition(float fPosX, float fPosY) //x, y는 메시지 박스의 left top이 아닌 정가운데점.
|
||||
{
|
||||
m_fPosX = fPosX;
|
||||
m_fPosY = fPosY;
|
||||
|
||||
int i;
|
||||
for(i = 0; i < 16; i++)
|
||||
{
|
||||
m_Vertexes[i].Diffuse.c = 0xFFFFFFFF;
|
||||
m_Vertexes[i].Specular.c = 0;
|
||||
m_Vertexes[i].w = 0.1f;
|
||||
m_Vertexes[i].v.z = 0.1f;
|
||||
}
|
||||
float height = m_lstMessage.size() * 16;
|
||||
if(m_dwFlag & 0x00011110) height += 20; // 버튼 크기
|
||||
|
||||
m_rcRect.left = fPosX;
|
||||
m_rcRect.top = fPosY;
|
||||
m_rcRect.right = fPosX + 316;
|
||||
m_rcRect.bottom = fPosY + 45 + height;
|
||||
|
||||
for(i = 0; i < 4; i++)
|
||||
{
|
||||
m_Vertexes[i * 4].tu = 0.0f;
|
||||
m_Vertexes[i * 4 + 1].tu = 24.0f / 256.0f;
|
||||
m_Vertexes[i * 4 + 2].tu = 232.0f / 256.0f;
|
||||
m_Vertexes[i * 4 + 3].tu = 1.0f;
|
||||
|
||||
m_Vertexes[i * 4].v.x = m_rcRect.left - 0.5f;
|
||||
m_Vertexes[i * 4 + 1].v.x = m_rcRect.left + 24.0f - 0.5f;
|
||||
m_Vertexes[i * 4 + 2].v.x = m_rcRect.right - 24.0f - 0.5f;
|
||||
m_Vertexes[i * 4 + 3].v.x = m_rcRect.right - 0.5f;
|
||||
|
||||
m_Vertexes[i].tv = 0.0f;
|
||||
m_Vertexes[i + 4].tv = 20.0f / 256.0f;
|
||||
m_Vertexes[i + 8].tv = 44.0f / 256.0f;
|
||||
m_Vertexes[i + 12].tv = 0.25f;
|
||||
|
||||
m_Vertexes[i].v.y = m_rcRect.top - 0.5f;
|
||||
m_Vertexes[i + 4].v.y = m_rcRect.top + 20.0f - 0.5f;
|
||||
m_Vertexes[i + 8].v.y = m_rcRect.bottom - 20.0f - 0.5f;
|
||||
m_Vertexes[i + 12].v.y = m_rcRect.bottom - 0.5f;
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_EXIT)
|
||||
{
|
||||
m_btnButton[4].m_lMoveX = m_rcRect.right - 21;
|
||||
m_btnButton[4].m_lMoveY = m_rcRect.top + 8;
|
||||
}
|
||||
if(m_dwFlag & MB_PREV)
|
||||
{
|
||||
m_btnButton[2].m_lMoveX = m_rcRect.right - 57;
|
||||
m_btnButton[2].m_lMoveY = m_rcRect.top + 11;
|
||||
}
|
||||
if(m_dwFlag & MB_NEXT)
|
||||
{
|
||||
m_btnButton[3].m_lMoveX = m_rcRect.right - 41;
|
||||
m_btnButton[3].m_lMoveY = m_rcRect.top + 11;
|
||||
}
|
||||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||||
{
|
||||
m_btnButton[1].m_lMoveX = m_rcRect.right - 56;
|
||||
m_btnButton[1].m_lMoveY = m_rcRect.bottom - 32;
|
||||
}
|
||||
if((m_dwFlag & MB_CONFIRM) || (m_dwFlag & MB_YES))
|
||||
{
|
||||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||||
{
|
||||
m_btnButton[0].m_lMoveX = m_rcRect.right - 103;
|
||||
m_btnButton[0].m_lMoveY = m_rcRect.bottom - 32;
|
||||
} else
|
||||
{
|
||||
m_btnButton[0].m_lMoveX = m_rcRect.right - 56;
|
||||
m_btnButton[0].m_lMoveY = m_rcRect.bottom - 32;
|
||||
}
|
||||
}
|
||||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||||
{
|
||||
m_spNumber.m_nPutX = m_rcRect.left + 13;
|
||||
m_spNumber.m_nPutY = m_rcRect.bottom - 34;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGUIMessageBox::Update(float fTick, BOOL &bClick, BOOL bAble)
|
||||
{
|
||||
if((m_dwFlag & MB_EXIT))
|
||||
{
|
||||
if(bAble)
|
||||
{
|
||||
m_btnButton[4].Update();
|
||||
|
||||
if(m_btnButton[4].m_nState == BUTTON_CLICK)
|
||||
{
|
||||
bClick = TRUE;
|
||||
if(m_lpResultValue) *m_lpResultValue = MB_EXIT;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
m_lTick -= fTick;
|
||||
if(m_lpResultValue) *m_lpResultValue = MB_EXIT;
|
||||
if(m_lTick <= 0) return FALSE;
|
||||
}
|
||||
|
||||
if(bAble)
|
||||
{
|
||||
if(m_dwFlag & MB_PREV)
|
||||
{
|
||||
m_btnButton[2].Update();
|
||||
|
||||
if(m_btnButton[2].m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_lpResultValue) *m_lpResultValue = MB_PREV;
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
if(m_dwFlag & MB_NEXT)
|
||||
{
|
||||
m_btnButton[3].Update();
|
||||
|
||||
if(m_btnButton[3].m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_lpResultValue) *m_lpResultValue = MB_NEXT;
|
||||
if(m_lpValue) *m_lpValue = 0;
|
||||
if(m_dwFlag & MB_NUMBER)
|
||||
{
|
||||
g_ClientMain.SetFocus();
|
||||
g_TextEdit.InitMessage();
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_TextEdit.SetEditLength(100);
|
||||
}
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
if((m_dwFlag & MB_NO) || (m_dwFlag & MB_CANCEL))
|
||||
{
|
||||
m_btnButton[1].Update();
|
||||
|
||||
if(m_btnButton[1].m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_lpResultValue) { *m_lpResultValue = MB_NO | MB_CANCEL; m_lpResultValue = NULL; }
|
||||
if(m_lpValue) { *m_lpValue = 0; m_lpValue = NULL; }
|
||||
if(m_lpstrValue) { strcpy(m_lpstrValue, ""); m_lpstrValue = NULL; }
|
||||
bClick = TRUE;
|
||||
if(m_dwFlag & MB_NUMBER)
|
||||
{
|
||||
g_ClientMain.SetFocus();
|
||||
g_TextEdit.InitMessage();
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_TextEdit.SetEditLength(100);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if((m_dwFlag & MB_YES) || (m_dwFlag & MB_CONFIRM))
|
||||
{
|
||||
m_btnButton[0].Update();
|
||||
|
||||
if((m_bEnableEnter && GetAsyncKeyState(VK_RETURN)) || m_btnButton[0].m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(m_lpResultValue) { *m_lpResultValue = MB_YES | MB_CONFIRM; m_lpResultValue = NULL; }
|
||||
if(m_lpValue)
|
||||
{
|
||||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||||
{
|
||||
*m_lpValue = atoi(g_TextEdit.GetMessage());
|
||||
} else
|
||||
{
|
||||
*m_lpValue = 0;
|
||||
}
|
||||
m_lpValue = NULL;
|
||||
}
|
||||
if(m_lpstrValue)
|
||||
{
|
||||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||||
{
|
||||
strcpy(m_lpstrValue, g_TextEdit.GetMessage());
|
||||
} else
|
||||
{
|
||||
strcpy(m_lpstrValue, "");
|
||||
}
|
||||
m_lpstrValue = NULL;
|
||||
}
|
||||
bClick = TRUE;
|
||||
if((m_dwFlag & MB_NUMBER) || (m_dwFlag & MB_STRING))
|
||||
{
|
||||
g_ClientMain.SetFocus();
|
||||
g_TextEdit.InitMessage();
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_TextEdit.SetEditLength(100);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CGUIMessageBox::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(!m_bShow) return;
|
||||
|
||||
lpD3DDevice->SetTexture(0, g_MessageBoxManager.m_lpTexture->GetTexture());
|
||||
lpD3DDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 16, 18, m_wIndex, D3DFMT_INDEX16, m_Vertexes, sizeof(TLVertex));
|
||||
|
||||
RECT rect;
|
||||
for(int i = 0; i < m_lstMessage.size(); i++)
|
||||
{
|
||||
rect.left = m_rcRect.left + 24;
|
||||
rect.top = m_rcRect.top + 21 + i * 16;
|
||||
rect.right = m_rcRect.right - 24;
|
||||
rect.bottom = rect.top + 16;
|
||||
|
||||
g_TextEdit.DrawText(m_lstMessage[i]->m_lstMessage[0], &rect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if(m_dwFlag & MB_EXIT)
|
||||
{
|
||||
m_btnButton[4].Render(lpD3DDevice);
|
||||
}
|
||||
if(m_dwFlag & MB_PREV)
|
||||
{
|
||||
m_btnButton[2].Render(lpD3DDevice);
|
||||
}
|
||||
if(m_dwFlag & MB_NEXT)
|
||||
{
|
||||
m_btnButton[3].Render(lpD3DDevice);
|
||||
}
|
||||
if((m_dwFlag & MB_CANCEL) || (m_dwFlag & MB_NO))
|
||||
{
|
||||
m_btnButton[1].Render(lpD3DDevice);
|
||||
}
|
||||
if((m_dwFlag & MB_CONFIRM) || (m_dwFlag & MB_YES))
|
||||
{
|
||||
m_btnButton[0].Render(lpD3DDevice);
|
||||
}
|
||||
if((m_dwFlag & MB_NUMBER))
|
||||
{
|
||||
m_spNumber.Render(lpD3DDevice);
|
||||
|
||||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_NUMBER)
|
||||
{
|
||||
char strText[MAX_PATH];
|
||||
int nNumber;
|
||||
RECT rcRect;
|
||||
|
||||
SetRect(&rcRect, m_spNumber.m_nPutX + 4, m_spNumber.m_nPutY + 2, m_spNumber.m_nPutX + 132, m_spNumber.m_nPutY + 18);
|
||||
nNumber = atoi(g_TextEdit.GetMessage());
|
||||
sprintf(strText, "%s_", g_TextEdit.MakePrintGold((unsigned long)nNumber));
|
||||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
}/**/
|
||||
if(m_dwFlag & MB_STRING)
|
||||
{
|
||||
m_spNumber.Render(lpD3DDevice);
|
||||
|
||||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_NUMBER)
|
||||
{
|
||||
char strText[MAX_PATH];
|
||||
RECT rcRect;
|
||||
|
||||
SetRect(&rcRect, m_spNumber.m_nPutX + 4, m_spNumber.m_nPutY + 2, m_spNumber.m_nPutX + 186, m_spNumber.m_nPutY + 18);
|
||||
sprintf(strText, "%s_", g_TextEdit.GetMessage());
|
||||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
}/**/
|
||||
}
|
||||
82
GameTools/NeoRylClient/GUIMessageBox.h
Normal file
82
GameTools/NeoRylClient/GUIMessageBox.h
Normal file
@@ -0,0 +1,82 @@
|
||||
// GUIMessageBox.h: interface for the CGUIMessageBox class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUIMESSAGEBOX_H__F81A1529_1603_4C04_94BF_02E10D1898E7__INCLUDED_)
|
||||
#define AFX_GUIMESSAGEBOX_H__F81A1529_1603_4C04_94BF_02E10D1898E7__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <vertex.h>
|
||||
#include <vector>
|
||||
#include "GUIButton.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define MB_NORMAL 0x00000000
|
||||
#define MB_EXIT 0x00000001
|
||||
#define MB_CONFIRM 0x00000002
|
||||
#define MB_CANCEL 0x00000004
|
||||
#define MB_YES 0x00000008
|
||||
#define MB_NO 0x00000010
|
||||
#define MB_PREV 0x00000020
|
||||
#define MB_NEXT 0x00000040
|
||||
#define MB_NUMBER 0x00000080
|
||||
#define MB_STRING 0x00000100
|
||||
|
||||
class CGUIMessageBox
|
||||
{
|
||||
typedef struct WORDNode
|
||||
{
|
||||
unsigned long m_dwNum;
|
||||
BOOL m_bFirstLink;
|
||||
vector<char *> m_lstMessage;
|
||||
} WORDNode, *LPWORDNode;
|
||||
|
||||
public:
|
||||
unsigned long *m_lpResultValue;
|
||||
TLVertex m_Vertexes[16];
|
||||
unsigned short m_wIndex[54];
|
||||
unsigned long *m_lpValue;
|
||||
char *m_lpstrValue;
|
||||
CGUIButton m_btnButton[5];
|
||||
CSprite m_spNumber;
|
||||
|
||||
vector<LPWORDNode> m_lstMessage;
|
||||
CGUIMessageBox *m_lpParent;
|
||||
long m_lTick;
|
||||
|
||||
float m_fPosX, m_fPosY;
|
||||
RECT m_rcRect;
|
||||
|
||||
BOOL m_bWordBreak;
|
||||
BOOL m_bShow;
|
||||
unsigned long m_dwFlag;
|
||||
|
||||
BOOL m_bEnableEnter;
|
||||
|
||||
CGUIMessageBox();
|
||||
~CGUIMessageBox();
|
||||
|
||||
void Create(const char *strMessage, unsigned long dwFlag = MB_NORMAL, float posX = 248.0f, float posY = 200.0f);
|
||||
BOOL ShowDialog(unsigned long dwChrID, unsigned long dwPage);
|
||||
|
||||
void Destroy();
|
||||
|
||||
void SetWordBreak(BOOL bWordBreak) { m_bWordBreak = bWordBreak; }
|
||||
void SetEnableEnter(BOOL bEnableEnter) { m_bEnableEnter = bEnableEnter; }
|
||||
void SetResult(unsigned long *lpValue) { m_lpResultValue = lpValue; }
|
||||
void SetValue(unsigned long *lpValue) { m_lpValue = lpValue; }
|
||||
void SetValue(char *lpstrValue) { m_lpstrValue = lpstrValue; }
|
||||
void SetText(const char *strMessage);
|
||||
void SetPosition(float fPosX, float fPosY); //x, y는 메시지 박스의 left top이 아닌 정가운데점.
|
||||
void Show(BOOL bShow) { m_bShow = bShow; }
|
||||
void SetTimer(long lTick) { m_lTick = lTick; }
|
||||
|
||||
BOOL Update(float fTick, BOOL &bClick, BOOL bAble);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUIMESSAGEBOX_H__F81A1529_1603_4C04_94BF_02E10D1898E7__INCLUDED_)
|
||||
99
GameTools/NeoRylClient/GUIMessageBoxManager.cpp
Normal file
99
GameTools/NeoRylClient/GUIMessageBoxManager.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
// GUIMessageBoxManager.cpp: implementation of the CGUIMessageBoxManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "GUIMessageBoxManager.h"
|
||||
#include "BaseDataDefine.h"
|
||||
#include "FrameTimer.h"
|
||||
|
||||
CGUIMessageBoxManager g_MessageBoxManager;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUIMessageBoxManager::CGUIMessageBoxManager()
|
||||
{
|
||||
m_lpTexture = NULL;
|
||||
}
|
||||
|
||||
CGUIMessageBoxManager::~CGUIMessageBoxManager()
|
||||
{
|
||||
if(m_lpTexture) { delete m_lpTexture; m_lpTexture = NULL; }
|
||||
}
|
||||
|
||||
void CGUIMessageBoxManager::AddMessageBox(CGUIMessageBox *lpMessageBox)
|
||||
{
|
||||
m_lstMessageBox.push_back(lpMessageBox);
|
||||
}
|
||||
|
||||
void CGUIMessageBoxManager::Create()
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_lpTexture = new CTexture;
|
||||
m_lpTexture->Load("GUIMsgBox.dds");
|
||||
|
||||
m_dwMessageBoxTick = CFrameTimer::Regist(1000.0f);
|
||||
}
|
||||
|
||||
void CGUIMessageBoxManager::DeleteMessageBox(CGUIMessageBox *lpMessageBox)
|
||||
{
|
||||
vector<CGUIMessageBox *>::iterator it;
|
||||
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end(); it++)
|
||||
{
|
||||
if((*it) == lpMessageBox)
|
||||
{
|
||||
m_lstMessageBox.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGUIMessageBoxManager::Update()
|
||||
{
|
||||
float fTick = CFrameTimer::GetUpdateTimer(m_dwMessageBoxTick);
|
||||
|
||||
vector<CGUIMessageBox *>::iterator it;
|
||||
BOOL bClick = FALSE;
|
||||
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end();)
|
||||
{
|
||||
if(!(*it)->Update(fTick, bClick, !bClick))
|
||||
{
|
||||
CGUIMessageBox *lpDelete = (*it);
|
||||
it = m_lstMessageBox.erase(it);
|
||||
lpDelete->m_bShow = FALSE;
|
||||
delete lpDelete;
|
||||
} else
|
||||
{
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
return bClick;
|
||||
/* if(m_lstMessageBox.empty())
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;*/
|
||||
}
|
||||
|
||||
void CGUIMessageBoxManager::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
vector<CGUIMessageBox *>::iterator it;
|
||||
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end(); it++)
|
||||
{
|
||||
(*it)->Render(lpD3DDevice);
|
||||
}
|
||||
}
|
||||
|
||||
void CGUIMessageBoxManager::DestroyList()
|
||||
{
|
||||
vector<CGUIMessageBox *>::iterator it;
|
||||
CGUIMessageBox *lpDelete;
|
||||
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end();)
|
||||
{
|
||||
lpDelete = (*it);
|
||||
it = m_lstMessageBox.erase(it);
|
||||
delete lpDelete;
|
||||
}
|
||||
m_lstMessageBox.clear();
|
||||
}
|
||||
49
GameTools/NeoRylClient/GUIMessageBoxManager.h
Normal file
49
GameTools/NeoRylClient/GUIMessageBoxManager.h
Normal file
@@ -0,0 +1,49 @@
|
||||
// GUIMessageBoxManager.h: interface for the CGUIMessageBoxManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUIMESSAGEBOXMANAGER_H__BFC6391A_E840_459C_81E6_30E4224A983C__INCLUDED_)
|
||||
#define AFX_GUIMESSAGEBOXMANAGER_H__BFC6391A_E840_459C_81E6_30E4224A983C__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <Texture.h>
|
||||
#include <vector>
|
||||
#include "GUIMessageBox.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUIMessageBoxManager
|
||||
{
|
||||
public:
|
||||
void DestroyList(void);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
BOOL Update(void);
|
||||
void DeleteMessageBox(CGUIMessageBox *lpMessageBox);
|
||||
void Create(void);
|
||||
vector<CGUIMessageBox *> m_lstMessageBox;
|
||||
unsigned long m_dwMessageBoxTick;
|
||||
|
||||
void AddMessageBox(CGUIMessageBox *lpMessageBox);
|
||||
CTexture *m_lpTexture;
|
||||
|
||||
CGUIMessageBoxManager();
|
||||
~CGUIMessageBoxManager();
|
||||
|
||||
BOOL GetIsExistModal()
|
||||
{
|
||||
vector<CGUIMessageBox *>::iterator it;
|
||||
for(it = m_lstMessageBox.begin(); it != m_lstMessageBox.end(); it++)
|
||||
{
|
||||
if((*it)->m_dwFlag) return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
};
|
||||
|
||||
extern CGUIMessageBoxManager g_MessageBoxManager;
|
||||
|
||||
#endif // !defined(AFX_GUIMESSAGEBOXMANAGER_H__BFC6391A_E840_459C_81E6_30E4224A983C__INCLUDED_)
|
||||
156
GameTools/NeoRylClient/GUIScroll.cpp
Normal file
156
GameTools/NeoRylClient/GUIScroll.cpp
Normal file
@@ -0,0 +1,156 @@
|
||||
// GUIScroll.cpp: implementation of the CGUIScroll class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "WinInput.h"
|
||||
#include "GUIScroll.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUIScroll::CGUIScroll()
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
m_lValue = 0;
|
||||
m_lNowPos = 0;
|
||||
|
||||
lMove = 0;
|
||||
bScroll = FALSE;
|
||||
|
||||
m_lpBarButton = NULL;
|
||||
m_lpUpArrowButton = NULL;
|
||||
m_lpDownArrowButton = NULL;
|
||||
|
||||
m_bScrollKind = SCROLL_VSCROLL;
|
||||
}
|
||||
|
||||
CGUIScroll::~CGUIScroll()
|
||||
{
|
||||
if(m_lpDownArrowButton) { delete m_lpDownArrowButton; m_lpDownArrowButton = NULL; }
|
||||
if(m_lpUpArrowButton) { delete m_lpUpArrowButton; m_lpUpArrowButton = NULL; }
|
||||
if(m_lpBarButton) { delete m_lpBarButton; m_lpBarButton = NULL; }
|
||||
}
|
||||
|
||||
void CGUIScroll::Update(void)
|
||||
{
|
||||
if(m_lMin == m_lMax) return;
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
m_lpBarButton->Update();
|
||||
if(m_lpUpArrowButton) m_lpUpArrowButton->Update();
|
||||
if(m_lpDownArrowButton) m_lpDownArrowButton->Update();
|
||||
|
||||
if(m_lpUpArrowButton && m_lpUpArrowButton->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
(*m_lValue)--;
|
||||
if(*m_lValue < m_lMin) (*m_lValue) = m_lMin;
|
||||
} else if(m_lpDownArrowButton && m_lpDownArrowButton->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
(*m_lValue)++;
|
||||
if(*m_lValue > m_lMax) (*m_lValue) = m_lMax;
|
||||
}
|
||||
|
||||
if(m_bScrollKind == SCROLL_VSCROLL)
|
||||
{
|
||||
float fRate = ((float)m_rcEdge.bottom / (m_lMax - m_lMin));
|
||||
|
||||
if(m_lpBarButton->m_nState == BUTTON_PRESS && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
lMove = ptMousePos->y - (m_lpBarButton->m_lMoveY + m_ptPosition.y + m_lNowPos);
|
||||
|
||||
bScroll = TRUE;
|
||||
}
|
||||
|
||||
if(bScroll)
|
||||
{
|
||||
if(m_lpBarButton->m_nState == BUTTON_NONE)
|
||||
{
|
||||
bScroll = FALSE;
|
||||
}
|
||||
|
||||
/* g_DeviceInput.GetIsLeftMouseUp() || !g_DeviceInput.GetIsFocus() ||
|
||||
!g_DeviceInput.InRect(m_rcEdge.left + m_lpBarButton->m_lMoveX + m_ptPosition.x - 3,
|
||||
m_rcEdge.top + m_lpBarButton->m_lMoveY + m_ptPosition.y + lMove - 5,
|
||||
m_rcEdge.right + m_lpBarButton->m_lMoveX + m_ptPosition.x + 3,
|
||||
m_rcEdge.bottom + m_lpBarButton->m_lMoveY + m_ptPosition.y + lMove + 5) )
|
||||
{
|
||||
}*/
|
||||
|
||||
if(ptMousePos->y < m_lpBarButton->m_lMoveY + m_ptPosition.y + lMove)
|
||||
{
|
||||
m_lNowPos = 0;
|
||||
}
|
||||
else if(ptMousePos->y > m_lpBarButton->m_lMoveY + m_ptPosition.y + m_rcEdge.bottom + lMove)
|
||||
{
|
||||
m_lNowPos = m_rcEdge.bottom;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lNowPos = (ptMousePos->y - (m_lpBarButton->m_lMoveY + m_ptPosition.y)) - lMove;
|
||||
if(m_lNowPos < 0) m_lNowPos = 0;
|
||||
}
|
||||
(*m_lValue) = (m_lNowPos / fRate) + m_lMin;
|
||||
}
|
||||
/* else
|
||||
{
|
||||
m_lNowPos = (*m_lValue) * fRate;
|
||||
}*/
|
||||
|
||||
if(m_lpBarButton->m_lpNormalButton) m_lpBarButton->m_lpNormalButton->m_nPutY = m_ptPosition.y + m_lNowPos;
|
||||
if(m_lpBarButton->m_lpOnMouseButton) m_lpBarButton->m_lpOnMouseButton->m_nPutY = m_ptPosition.y + m_lNowPos;
|
||||
if(m_lpBarButton->m_lpClickMouseButton) m_lpBarButton->m_lpClickMouseButton->m_nPutY = m_ptPosition.y + m_lNowPos;
|
||||
} else if(m_bScrollKind == SCROLL_HSCROLL)
|
||||
{
|
||||
float fRate = ((float)m_rcEdge.right / (m_lMax - m_lMin));
|
||||
|
||||
if(m_lpBarButton->m_nState == BUTTON_PRESS && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
lMove = ptMousePos->x - (m_lpBarButton->m_lMoveX + m_ptPosition.x + m_lNowPos);
|
||||
|
||||
bScroll = TRUE;
|
||||
}
|
||||
|
||||
if(bScroll)
|
||||
{
|
||||
if( g_DeviceInput.GetIsLeftMouseUp() || !g_DeviceInput.GetIsFocus() ||
|
||||
!g_DeviceInput.InRect(m_rcEdge.left + m_lpBarButton->m_lMoveX + m_ptPosition.x + lMove - 3,
|
||||
m_rcEdge.top + m_lpBarButton->m_lMoveY + m_ptPosition.y - 5,
|
||||
m_rcEdge.right + m_lpBarButton->m_lMoveX + m_ptPosition.x + lMove + 3,
|
||||
m_rcEdge.bottom + m_lpBarButton->m_lMoveY + m_ptPosition.y + 5) )
|
||||
{
|
||||
bScroll = FALSE;
|
||||
}
|
||||
|
||||
if(ptMousePos->x < m_lpBarButton->m_lMoveX + m_ptPosition.x + lMove)
|
||||
{
|
||||
m_lNowPos = 0;
|
||||
}
|
||||
else if(ptMousePos->x > m_lpBarButton->m_lMoveX + m_ptPosition.x + m_rcEdge.right + lMove)
|
||||
{
|
||||
m_lNowPos = m_rcEdge.right;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lNowPos = (ptMousePos->x - (m_lpBarButton->m_lMoveX + m_ptPosition.x)) - lMove;
|
||||
if(m_lNowPos < 0) m_lNowPos = 0;
|
||||
}
|
||||
(*m_lValue) = (m_lNowPos / fRate) + m_lMin;
|
||||
} else
|
||||
{
|
||||
m_lNowPos = (*m_lValue) * fRate;
|
||||
}
|
||||
|
||||
if(m_lpBarButton->m_lpNormalButton) m_lpBarButton->m_lpNormalButton->m_nPutX = m_ptPosition.x + m_lNowPos;
|
||||
if(m_lpBarButton->m_lpOnMouseButton) m_lpBarButton->m_lpOnMouseButton->m_nPutX = m_ptPosition.x + m_lNowPos;
|
||||
if(m_lpBarButton->m_lpClickMouseButton) m_lpBarButton->m_lpClickMouseButton->m_nPutX = m_ptPosition.x + m_lNowPos;
|
||||
}
|
||||
}
|
||||
|
||||
void CGUIScroll::Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha)
|
||||
{
|
||||
if(m_lpUpArrowButton) m_lpUpArrowButton->Render(lpD3DDevice, cAlpha);
|
||||
if(m_lMin != m_lMax) m_lpBarButton->Render(lpD3DDevice, cAlpha);
|
||||
if(m_lpDownArrowButton) m_lpDownArrowButton->Render(lpD3DDevice, cAlpha);
|
||||
}
|
||||
55
GameTools/NeoRylClient/GUIScroll.h
Normal file
55
GameTools/NeoRylClient/GUIScroll.h
Normal file
@@ -0,0 +1,55 @@
|
||||
// GUIScroll.h: interface for the CGUIScroll class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUISCROLL_H__C81725BD_9D43_4837_9DCC_A1DD9832F875__INCLUDED_)
|
||||
#define AFX_GUISCROLL_H__C81725BD_9D43_4837_9DCC_A1DD9832F875__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIButton.h"
|
||||
|
||||
#define SCROLL_VSCROLL FALSE
|
||||
#define SCROLL_HSCROLL TRUE
|
||||
|
||||
class CGUIScroll
|
||||
{
|
||||
public:
|
||||
BOOL m_bShow;
|
||||
BOOL m_bScrollKind;
|
||||
POINT m_ptPosition;
|
||||
RECT m_rcEdge;
|
||||
CGUIButton *m_lpBarButton;
|
||||
CGUIButton *m_lpUpArrowButton;
|
||||
CGUIButton *m_lpDownArrowButton;
|
||||
long m_lMax;
|
||||
long m_lMin;
|
||||
long *m_lValue;
|
||||
long m_lNowPos;
|
||||
|
||||
long lMove;
|
||||
BOOL bScroll;
|
||||
|
||||
CGUIScroll();
|
||||
~CGUIScroll();
|
||||
|
||||
void SetEdge(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
|
||||
{
|
||||
m_rcEdge.left = x1; m_rcEdge.top = y1; m_rcEdge.right = x2; m_rcEdge.bottom = y2;
|
||||
}
|
||||
void SetMove(unsigned short wMoveX, unsigned short wMoveY)
|
||||
{
|
||||
m_lpBarButton->SetMove(wMoveX, wMoveY);
|
||||
if(m_lpUpArrowButton) m_lpUpArrowButton->SetMove(wMoveX, wMoveY);
|
||||
if(m_lpDownArrowButton) m_lpDownArrowButton->SetMove(wMoveX, wMoveY);
|
||||
}
|
||||
void SetScrollKind(BOOL bScrollKind) { m_bScrollKind = bScrollKind; }
|
||||
void SetRange(long lMin, long lMax) { m_lMin = lMin; m_lMax = lMax; }
|
||||
void SetPosition(unsigned short wPosX, unsigned short wPosY) { m_ptPosition.x = wPosX; m_ptPosition.y = wPosY; }
|
||||
void Update(void);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice, unsigned char cAlpha = 0xFF);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUISCROLL_H__C81725BD_9D43_4837_9DCC_A1DD9832F875__INCLUDED_)
|
||||
850
GameTools/NeoRylClient/GUITextEdit.cpp
Normal file
850
GameTools/NeoRylClient/GUITextEdit.cpp
Normal file
@@ -0,0 +1,850 @@
|
||||
// GUITextEdit.cpp: implementation of the CGUITextEdit class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "CharacterControl.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include <string.h>
|
||||
#include "BaseGraphicsLayer.h"
|
||||
#include <imm.h>
|
||||
|
||||
CGUITextEdit g_TextEdit;
|
||||
WNDPROC OldEditProc;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUITextEdit::CGUITextEdit()
|
||||
{
|
||||
m_lpText = NULL;
|
||||
m_hEditBox = NULL;
|
||||
m_lCarretPosition = 0;
|
||||
m_dwStartChat = 0;
|
||||
m_dwStartParty = 0;
|
||||
m_dwStartGuild = 0;
|
||||
m_dwStartStall = 0;
|
||||
m_dwEditMode = EDITMODE_NONE;
|
||||
m_dwChatMode = CHATMODE_CHAT;
|
||||
}
|
||||
|
||||
CGUITextEdit::~CGUITextEdit()
|
||||
{
|
||||
deque<Message *>::iterator it;
|
||||
for(it = m_deqChatMessage.begin(); it != m_deqChatMessage.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_deqChatMessage.clear();
|
||||
|
||||
for(it = m_deqPartyMessage.begin(); it != m_deqPartyMessage.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_deqPartyMessage.clear();
|
||||
|
||||
for(it = m_deqGuildMessage.begin(); it != m_deqGuildMessage.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_deqGuildMessage.clear();
|
||||
|
||||
for(it = m_deqStallMessage.begin(); it != m_deqStallMessage.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_deqStallMessage.clear();
|
||||
|
||||
if(m_hEditBox)
|
||||
{
|
||||
SetWindowLong(m_hEditBox, GWL_WNDPROC, (long)OldEditProc);
|
||||
DestroyWindow(m_hEditBox);
|
||||
m_hEditBox = NULL;
|
||||
}
|
||||
if(m_lpText) { m_lpText->Release(); m_lpText = NULL; }
|
||||
}
|
||||
|
||||
unsigned long CGUITextEdit::GetStringLength(const char *strString)
|
||||
{
|
||||
unsigned long i, len = strlen(strString), countx = 0;
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strString[i] & 0x80) { countx += m_dwTextSize[128]; i++; } else { countx += m_dwTextSize[strString[i]]; }
|
||||
}
|
||||
|
||||
return countx;
|
||||
}
|
||||
|
||||
LRESULT APIENTRY EditProc(HWND hWnd, unsigned int uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if(uMsg == WM_GETDLGCODE)
|
||||
return DLGC_WANTALLKEYS;
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
switch(wParam)
|
||||
{
|
||||
case VK_RETURN:
|
||||
if(g_TextEdit.m_dwEditMode == EDITMODE_CHAT)
|
||||
{
|
||||
::SetFocus(g_ClientMain.m_hWnd);
|
||||
} else if(g_TextEdit.m_dwEditMode == EDITMODE_CURPASS)
|
||||
{
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_NEWPASS;
|
||||
g_TextEdit.InitMessage();
|
||||
} else if(g_TextEdit.m_dwEditMode == EDITMODE_NEWPASS)
|
||||
{
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CURPASS;
|
||||
g_TextEdit.InitMessage();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CHAR:
|
||||
switch(wParam)
|
||||
{
|
||||
case VK_RETURN:
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return CallWindowProc(OldEditProc, hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
void CGUITextEdit::Create(HWND hWnd, LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_dwTextSize[0] = 0; m_dwTextSize[1] = 6; m_dwTextSize[2] = 6; m_dwTextSize[3] = 6;
|
||||
m_dwTextSize[4] = 0; m_dwTextSize[5] = 0; m_dwTextSize[6] = 0; m_dwTextSize[7] = 0;
|
||||
m_dwTextSize[8] = 0; m_dwTextSize[9] = 0; m_dwTextSize[10] = 0; m_dwTextSize[11] = 0;
|
||||
m_dwTextSize[12] = 0; m_dwTextSize[13] = 0; m_dwTextSize[14] = 0; m_dwTextSize[15] = 0;
|
||||
m_dwTextSize[16] = 0; m_dwTextSize[17] = 0; m_dwTextSize[18] = 0; m_dwTextSize[19] = 0;
|
||||
m_dwTextSize[20] = 0; m_dwTextSize[21] = 0; m_dwTextSize[22] = 0; m_dwTextSize[23] = 0;
|
||||
m_dwTextSize[24] = 0; m_dwTextSize[25] = 0; m_dwTextSize[26] = 0; m_dwTextSize[27] = 0;
|
||||
m_dwTextSize[28] = 0; m_dwTextSize[29] = 0; m_dwTextSize[30] = 0; m_dwTextSize[31] = 0;
|
||||
|
||||
m_dwTextSize[32] = 4; m_dwTextSize[33] = 4; m_dwTextSize[34] = 4; m_dwTextSize[35] = 6;
|
||||
m_dwTextSize[36] = 6; m_dwTextSize[37] = 10; m_dwTextSize[38] = 8; m_dwTextSize[39] = 4;
|
||||
m_dwTextSize[40] = 5; m_dwTextSize[41] = 5; m_dwTextSize[42] = 6; m_dwTextSize[43] = 6;
|
||||
m_dwTextSize[44] = 4; m_dwTextSize[45] = 6; m_dwTextSize[46] = 4; m_dwTextSize[47] = 6;
|
||||
m_dwTextSize[48] = 6; m_dwTextSize[49] = 6; m_dwTextSize[50] = 6; m_dwTextSize[51] = 6;
|
||||
m_dwTextSize[52] = 6; m_dwTextSize[53] = 6; m_dwTextSize[54] = 6; m_dwTextSize[55] = 6;
|
||||
m_dwTextSize[56] = 6; m_dwTextSize[57] = 6; m_dwTextSize[58] = 4; m_dwTextSize[59] = 4;
|
||||
m_dwTextSize[60] = 8; m_dwTextSize[61] = 6; m_dwTextSize[62] = 8; m_dwTextSize[63] = 6;
|
||||
m_dwTextSize[64] = 12; m_dwTextSize[65] = 8; m_dwTextSize[66] = 8; m_dwTextSize[67] = 9;
|
||||
m_dwTextSize[68] = 8; m_dwTextSize[69] = 8; m_dwTextSize[70] = 7; m_dwTextSize[71] = 9;
|
||||
m_dwTextSize[72] = 8; m_dwTextSize[73] = 3; m_dwTextSize[74] = 4; m_dwTextSize[75] = 8;
|
||||
m_dwTextSize[76] = 7; m_dwTextSize[77] = 11; m_dwTextSize[78] = 9; m_dwTextSize[79] = 9;
|
||||
m_dwTextSize[80] = 8; m_dwTextSize[81] = 9; m_dwTextSize[82] = 8; m_dwTextSize[83] = 8;
|
||||
m_dwTextSize[84] = 8; m_dwTextSize[85] = 8; m_dwTextSize[86] = 8; m_dwTextSize[87] = 10;
|
||||
m_dwTextSize[88] = 8; m_dwTextSize[89] = 8; m_dwTextSize[90] = 8; m_dwTextSize[91] = 6;
|
||||
m_dwTextSize[92] = 11; m_dwTextSize[93] = 6; m_dwTextSize[94] = 6; m_dwTextSize[95] = 6;
|
||||
m_dwTextSize[96] = 4; m_dwTextSize[97] = 7; m_dwTextSize[98] = 7; m_dwTextSize[99] = 7;
|
||||
m_dwTextSize[100] = 7; m_dwTextSize[101] = 7; m_dwTextSize[102] = 3; m_dwTextSize[103] = 7;
|
||||
m_dwTextSize[104] = 7; m_dwTextSize[105] = 3; m_dwTextSize[106] = 3; m_dwTextSize[107] = 6;
|
||||
m_dwTextSize[108] = 3; m_dwTextSize[109] = 11; m_dwTextSize[110] = 7; m_dwTextSize[111] = 7;
|
||||
m_dwTextSize[112] = 7; m_dwTextSize[113] = 7; m_dwTextSize[114] = 4; m_dwTextSize[115] = 7;
|
||||
m_dwTextSize[116] = 3; m_dwTextSize[117] = 7; m_dwTextSize[118] = 6; m_dwTextSize[119] = 10;
|
||||
m_dwTextSize[120] = 7; m_dwTextSize[121] = 7; m_dwTextSize[122] = 7; m_dwTextSize[123] = 6;
|
||||
m_dwTextSize[124] = 6; m_dwTextSize[125] = 6; m_dwTextSize[126] = 9; m_dwTextSize[127] = 6;
|
||||
m_dwTextSize[128] = 12;
|
||||
|
||||
HFONT hFont;
|
||||
hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
|
||||
GetObject(hFont, sizeof(LOGFONT), (void*)&m_LogFont);
|
||||
strcpy(m_LogFont.lfFaceName, "돋음");
|
||||
D3DXCreateFontIndirect(BaseGraphicsLayer::GetDevice(), &m_LogFont, &m_lpText);
|
||||
|
||||
m_hEditBox = CreateWindow(TEXT("edit"), NULL, WS_CHILD | ES_LEFT | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
|
||||
0, 0, 0, 0, hWnd, (HMENU)1, g_ClientMain.m_hInstance, NULL);
|
||||
OldEditProc = (WNDPROC)SetWindowLong(m_hEditBox, GWL_WNDPROC, (long)EditProc);
|
||||
}
|
||||
|
||||
void CGUITextEdit::SetEditLength(WPARAM wParam)
|
||||
{
|
||||
m_dwLimitLength = (unsigned long)wParam;
|
||||
PostMessage(m_hEditBox, EM_LIMITTEXT, wParam, 0);
|
||||
}
|
||||
|
||||
void CGUITextEdit::InitMessage(void)
|
||||
{
|
||||
m_lCarretPosition = 0;
|
||||
strcpy(m_strMessage, "");
|
||||
::SetWindowText(m_hEditBox, "");
|
||||
HIMC hImc = ImmGetContext(m_hEditBox);
|
||||
ImmSetCompositionString(hImc, SCS_SETSTR, "", 0, "", 0);
|
||||
ImmReleaseContext(m_hEditBox, hImc);
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddNormalChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand)
|
||||
{
|
||||
bool bAdd = false;
|
||||
int i;//, j;
|
||||
unsigned long dwColor = GetChatColor(dwCommand);
|
||||
|
||||
if(dwSender != g_ClientMain.m_dwMyChrID)
|
||||
{
|
||||
CCreature *lpCreature = g_CharacterData.GetCreature(dwSender);
|
||||
if(lpCreature)
|
||||
{
|
||||
strcpy(lpCreature->m_strChatMessage, strMessage);
|
||||
lpCreature->m_fChatTimer = 8000.0f;
|
||||
}
|
||||
}
|
||||
|
||||
int len = strlen(strMessage), count = 0, countx = 0, start = 0;
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strMessage[i] & 0x80)
|
||||
{
|
||||
countx += m_dwTextSize[128];
|
||||
count += 2;
|
||||
i++;
|
||||
if(countx >= 471) // 483 - 12 하나의 최고 폭
|
||||
{
|
||||
if(m_deqChatMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqChatMessage.begin());
|
||||
m_deqChatMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqChatMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqChatMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartChat = m_deqChatMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
countx += m_dwTextSize[strMessage[i]];
|
||||
count++;
|
||||
if(countx >= 475) // 483 - 8 하나의 최고 폭
|
||||
{
|
||||
if(m_deqChatMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqChatMessage.begin());
|
||||
m_deqChatMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqChatMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqChatMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartChat = m_deqChatMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(start <= len)
|
||||
{
|
||||
if(m_deqChatMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqChatMessage.begin());
|
||||
m_deqChatMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqChatMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqChatMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartChat = m_deqChatMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddPartyChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand)
|
||||
{
|
||||
int i, len = strlen(strMessage), count = 0, countx = 0, start = 0;
|
||||
unsigned long dwColor = GetChatColor(dwCommand);
|
||||
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strMessage[i] & 0x80)
|
||||
{
|
||||
countx += m_dwTextSize[128];
|
||||
count += 2;
|
||||
i++;
|
||||
if(countx >= 471) // 483 - 12 하나의 최고 폭
|
||||
{
|
||||
if(m_deqPartyMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqPartyMessage.begin());
|
||||
m_deqPartyMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqPartyMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqPartyMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartParty = m_deqPartyMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
countx += m_dwTextSize[strMessage[i]];
|
||||
count++;
|
||||
if(countx >= 475) // 483 - 8 하나의 최고 폭
|
||||
{
|
||||
if(m_deqPartyMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqPartyMessage.begin());
|
||||
m_deqPartyMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqPartyMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqPartyMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartParty = m_deqPartyMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(start <= len)
|
||||
{
|
||||
if(m_deqPartyMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqPartyMessage.begin());
|
||||
m_deqPartyMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqPartyMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqPartyMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartParty = m_deqPartyMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddGuildChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand)
|
||||
{
|
||||
int i, len = strlen(strMessage), count = 0, countx = 0, start = 0;
|
||||
unsigned long dwColor = GetChatColor(dwCommand);
|
||||
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strMessage[i] & 0x80)
|
||||
{
|
||||
countx += m_dwTextSize[128];
|
||||
count += 2;
|
||||
i++;
|
||||
if(countx >= 471) // 483 - 12 하나의 최고 폭
|
||||
{
|
||||
if(m_deqGuildMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqGuildMessage.begin());
|
||||
m_deqGuildMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqGuildMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqGuildMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartGuild = m_deqGuildMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
countx += m_dwTextSize[strMessage[i]];
|
||||
count++;
|
||||
if(countx >= 475) // 483 - 8 하나의 최고 폭
|
||||
{
|
||||
if(m_deqGuildMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqGuildMessage.begin());
|
||||
m_deqGuildMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqGuildMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqGuildMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartGuild = m_deqGuildMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(start <= len)
|
||||
{
|
||||
if(m_deqGuildMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqGuildMessage.begin());
|
||||
m_deqGuildMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqGuildMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqGuildMessage.size() > MAX_DRAWCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartGuild = m_deqGuildMessage.size() - MAX_DRAWCHAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddStallChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand)
|
||||
{
|
||||
bool bAdd = false;
|
||||
int i;//, j;
|
||||
unsigned long dwColor = GetChatColor(dwCommand);
|
||||
|
||||
int len = strlen(strMessage), count = 0, countx = 0, start = 0;
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strMessage[i] & 0x80)
|
||||
{
|
||||
countx += m_dwTextSize[128];
|
||||
count += 2;
|
||||
i++;
|
||||
if(countx >= 179) // 191 - 12 하나의 최고 폭
|
||||
{
|
||||
if(m_deqStallMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqStallMessage.begin());
|
||||
m_deqStallMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqStallMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqStallMessage.size() > MAX_DRAWSTALLCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartStall = m_deqStallMessage.size() - MAX_DRAWSTALLCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
countx += m_dwTextSize[strMessage[i]];
|
||||
count++;
|
||||
if(countx >= 179) // 191 - 8 하나의 최고 폭
|
||||
{
|
||||
if(m_deqStallMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqStallMessage.begin());
|
||||
m_deqStallMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqStallMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqStallMessage.size() > MAX_DRAWSTALLCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartStall = m_deqStallMessage.size() - MAX_DRAWSTALLCHAT;
|
||||
}
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(start <= len)
|
||||
{
|
||||
if(m_deqStallMessage.size() >= MAX_CHATMESSAGE)
|
||||
{
|
||||
delete (*m_deqStallMessage.begin());
|
||||
m_deqStallMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = dwCommand;
|
||||
lpMessage->fTimer = 8000.0f;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqStallMessage.push_back(lpMessage);
|
||||
|
||||
if(m_deqStallMessage.size() > MAX_DRAWSTALLCHAT)
|
||||
{
|
||||
// m_ScrollList[m_nChatScrollID].m_nNowPos = 79;
|
||||
m_dwStartStall = m_deqStallMessage.size() - MAX_DRAWSTALLCHAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITextEdit::DeleteStallMessage(void)
|
||||
{
|
||||
deque<Message *>::iterator it;
|
||||
for(it = m_deqStallMessage.begin(); it != m_deqStallMessage.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_deqStallMessage.clear();
|
||||
|
||||
m_dwStartStall = 0;
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand)
|
||||
{
|
||||
switch(m_dwChatMode)
|
||||
{
|
||||
case CHATMODE_CHAT:
|
||||
AddNormalChatMessage(strMessage, dwSender, dwCommand);
|
||||
break;
|
||||
|
||||
case CHATMODE_PARTY:
|
||||
AddPartyChatMessage(strMessage, dwSender, dwCommand);
|
||||
break;
|
||||
|
||||
case CHATMODE_GUILD:
|
||||
AddGuildChatMessage(strMessage, dwSender, dwCommand);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long CGUITextEdit::GetChatColor(unsigned long dwCommand)
|
||||
{
|
||||
switch(dwCommand)
|
||||
{
|
||||
case 1: // 파티 채팅
|
||||
return D3DCOLOR_RGBA(141, 180, 244, 255);
|
||||
|
||||
case 3:
|
||||
return D3DCOLOR_RGBA(255, 0, 255, 255);
|
||||
|
||||
case 7: // 외치기
|
||||
return D3DCOLOR_RGBA(53, 218, 193, 255);
|
||||
|
||||
case 10: // 귓속말
|
||||
return D3DCOLOR_RGBA(255, 128, 239, 255);
|
||||
|
||||
case 128:
|
||||
return D3DCOLOR_RGBA(100, 255, 100, 255);
|
||||
|
||||
case 129:
|
||||
return D3DCOLOR_RGBA(255, 0, 0, 255);
|
||||
|
||||
case 130: // NPC 대화
|
||||
return D3DCOLOR_RGBA(252, 238, 92, 255);
|
||||
|
||||
case 131:
|
||||
return D3DCOLOR_RGBA(255, 120, 0, 255);
|
||||
|
||||
default:
|
||||
return D3DCOLOR_RGBA(255, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITextEdit::AddNotice(char *strMessage, unsigned short wCmd)
|
||||
{
|
||||
int i, len = strlen(strMessage), count = 0, countx = 0, start = 0;
|
||||
unsigned long dwColor;
|
||||
|
||||
switch(wCmd)
|
||||
{
|
||||
case 0:
|
||||
dwColor = D3DCOLOR_RGBA(255, 0, 255, 255);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
dwColor = D3DCOLOR_RGBA(135, 74, 173, 255);
|
||||
break;
|
||||
}
|
||||
|
||||
for(i = 0; i < len; i++)
|
||||
{
|
||||
if(strMessage[i] & 0x80)
|
||||
{
|
||||
countx += m_dwTextSize[128];
|
||||
count += 2;
|
||||
i++;
|
||||
if(countx >= 471) // 483 - 12 하나의 최고 폭
|
||||
{
|
||||
if(m_deqNoticeMessage.size() >= 3)
|
||||
{
|
||||
delete (*m_deqNoticeMessage.begin());
|
||||
m_deqNoticeMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = 255;
|
||||
lpMessage->fTimer = 10000;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqNoticeMessage.push_back(lpMessage);
|
||||
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
countx += m_dwTextSize[strMessage[i]];
|
||||
count++;
|
||||
if(countx >= 475) // 483 - 8 하나의 최고 폭
|
||||
{
|
||||
if(m_deqNoticeMessage.size() >= 3)
|
||||
{
|
||||
delete (*m_deqNoticeMessage.begin());
|
||||
m_deqNoticeMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = 255;
|
||||
lpMessage->fTimer = 10000;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqNoticeMessage.push_back(lpMessage);
|
||||
|
||||
countx = count = 0;
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(start <= len)
|
||||
{
|
||||
if(m_deqNoticeMessage.size() >= 3)
|
||||
{
|
||||
delete (*m_deqNoticeMessage.begin());
|
||||
m_deqNoticeMessage.pop_front();
|
||||
}
|
||||
|
||||
Message *lpMessage;
|
||||
lpMessage = new Message;
|
||||
memcpy(lpMessage->strMessage, &strMessage[start], count);
|
||||
lpMessage->strMessage[count] = '\0';
|
||||
lpMessage->dwCommand = 255;
|
||||
lpMessage->fTimer = 10000;
|
||||
lpMessage->dwColor = dwColor;
|
||||
m_deqNoticeMessage.push_back(lpMessage);
|
||||
}
|
||||
}
|
||||
|
||||
char *CGUITextEdit::MakePrintGold(unsigned long dwGold)
|
||||
{
|
||||
static char strGold[16];
|
||||
char strTemp[16];
|
||||
sprintf(strTemp, "%u", dwGold);
|
||||
ZeroMemory(strGold, sizeof(strGold));
|
||||
unsigned long dwLen = strlen(strTemp);
|
||||
unsigned long dwTemp1 = dwLen / 3;
|
||||
unsigned long dwTemp2 = dwLen % 3;
|
||||
if(!dwTemp2 && dwTemp1) dwTemp1--;
|
||||
unsigned long dwCount = 0, dwDotCount = 0;
|
||||
for(unsigned long i = dwLen + dwTemp1; i > 0; i--)
|
||||
{
|
||||
dwDotCount++;
|
||||
if((dwDotCount % 4) == 0)
|
||||
{
|
||||
dwDotCount = 0;
|
||||
strGold[i - 1] = ',';
|
||||
} else
|
||||
{
|
||||
strGold[i - 1] = strTemp[dwLen - dwCount - 1];
|
||||
dwCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return strGold;
|
||||
}
|
||||
|
||||
char *CGUITextEdit::MakeWordBreak(const char *strString, unsigned long dwWidth)
|
||||
{
|
||||
static char strWordBreak[2048];
|
||||
WCHAR strWideString[2048];
|
||||
int nBufferSize = 2048;
|
||||
int nWideStringLen;
|
||||
unsigned long i;
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, strString, strlen(strString) + 1, strWideString, nBufferSize);
|
||||
nWideStringLen = wcslen(strWideString);
|
||||
|
||||
unsigned long dwStringWidth = 0;
|
||||
// unsigned long dwStartPos = 0;
|
||||
unsigned long dwSrcPos = 0;
|
||||
unsigned long dwDstPos = 0;
|
||||
|
||||
WCHAR strWideBreak[256];
|
||||
char strBreak[256];
|
||||
|
||||
strcpy(strWordBreak, "");
|
||||
|
||||
for(i = 0; i < nWideStringLen; i++)
|
||||
{
|
||||
if(strWideString[i] == 0x005c && strWideString[i + 1] == 0x005c)
|
||||
{
|
||||
ZeroMemory(strWideBreak, sizeof(strWideBreak));
|
||||
wcsncpy(strWideBreak, &strWideString[dwSrcPos], i - dwSrcPos);
|
||||
|
||||
if(strWideString[i] < 128)
|
||||
dwStringWidth = m_dwTextSize[strWideString[i]];
|
||||
else
|
||||
dwStringWidth = m_dwTextSize[128];
|
||||
|
||||
i += 2;
|
||||
dwSrcPos = i;
|
||||
WideCharToMultiByte(CP_ACP, 0, strWideBreak, wcslen(strWideBreak) + 1, strBreak, 256, NULL, NULL);
|
||||
|
||||
strcpy(&strWordBreak[dwDstPos], strBreak);
|
||||
dwDstPos = strlen(strWordBreak);
|
||||
strWordBreak[dwDstPos] = '\\'; dwDstPos++;
|
||||
|
||||
continue;
|
||||
} else if(strWideString[i] < 128)
|
||||
{
|
||||
dwStringWidth += m_dwTextSize[strWideString[i]];
|
||||
} else
|
||||
{
|
||||
dwStringWidth += m_dwTextSize[128];
|
||||
}
|
||||
|
||||
if(dwStringWidth > dwWidth)
|
||||
{
|
||||
i--;
|
||||
ZeroMemory(strWideBreak, sizeof(strWideBreak));
|
||||
if(strWideString[i] == ' ')
|
||||
{
|
||||
i--;
|
||||
wcsncpy(strWideBreak, &strWideString[dwSrcPos], i - dwSrcPos + 1);
|
||||
i += 2;
|
||||
|
||||
if(strWideString[i] < 128)
|
||||
dwStringWidth = m_dwTextSize[strWideString[i]];
|
||||
else
|
||||
dwStringWidth = m_dwTextSize[128];
|
||||
} else
|
||||
{
|
||||
wcsncpy(strWideBreak, &strWideString[dwSrcPos], i - dwSrcPos + 1);
|
||||
i++;
|
||||
|
||||
if(strWideString[i] < 128)
|
||||
dwStringWidth = m_dwTextSize[strWideString[i]];
|
||||
else
|
||||
dwStringWidth = m_dwTextSize[128];
|
||||
}
|
||||
|
||||
dwSrcPos = i;
|
||||
WideCharToMultiByte(CP_ACP, 0, strWideBreak, wcslen(strWideBreak) + 1, strBreak, 256, NULL, NULL);
|
||||
|
||||
strcpy(&strWordBreak[dwDstPos], strBreak);
|
||||
dwDstPos = strlen(strWordBreak);
|
||||
strWordBreak[dwDstPos] = '\\'; dwDstPos++;
|
||||
}
|
||||
}
|
||||
|
||||
if(dwSrcPos < nWideStringLen)
|
||||
{
|
||||
ZeroMemory(strWideBreak, sizeof(strWideBreak));
|
||||
if(strWideString[dwSrcPos] == ' ')
|
||||
{
|
||||
dwSrcPos++;
|
||||
wcsncpy(strWideBreak, &strWideString[dwSrcPos], nWideStringLen - dwSrcPos + 1);
|
||||
} else
|
||||
{
|
||||
wcsncpy(strWideBreak, &strWideString[dwSrcPos], nWideStringLen - dwSrcPos + 1);
|
||||
}
|
||||
|
||||
WideCharToMultiByte(CP_ACP, 0, strWideBreak, wcslen(strWideBreak) + 1, strBreak, 256, NULL, NULL);
|
||||
|
||||
strcpy(&strWordBreak[dwDstPos], strBreak);
|
||||
}
|
||||
|
||||
return strWordBreak;
|
||||
}
|
||||
118
GameTools/NeoRylClient/GUITextEdit.h
Normal file
118
GameTools/NeoRylClient/GUITextEdit.h
Normal file
@@ -0,0 +1,118 @@
|
||||
// GUITextEdit.h: interface for the CGUITextEdit class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUITEXTEDIT_H__5B84E354_3FE6_43BF_BAA4_9C5AF226EB9F__INCLUDED_)
|
||||
#define AFX_GUITEXTEDIT_H__5B84E354_3FE6_43BF_BAA4_9C5AF226EB9F__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <d3d8.h>
|
||||
#include <d3dx8.h>
|
||||
#include <deque>
|
||||
|
||||
#define MAX_CHATMESSAGE 100
|
||||
#define MAX_DRAWCHAT 5
|
||||
#define MAX_DRAWSTALLCHAT 10
|
||||
|
||||
#define EDITMODE_NONE 0
|
||||
#define EDITMODE_CREATECHAR 1
|
||||
#define EDITMODE_CHAT 2
|
||||
#define EDITMODE_NUMBER 3
|
||||
#define EDITMODE_WHISPER 4
|
||||
#define EDITMODE_DEPOSITPASS 5
|
||||
#define EDITMODE_CURPASS 6
|
||||
#define EDITMODE_NEWPASS 7
|
||||
#define EDITMODE_STALL 8
|
||||
|
||||
#define CHATMODE_CHAT 0
|
||||
#define CHATMODE_PARTY 1
|
||||
#define CHATMODE_GUILD 3
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUITextEdit
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwTextSize[129];
|
||||
char m_strMessage[MAX_PATH];
|
||||
unsigned long m_dwLimitLength;
|
||||
long m_lCarretPosition;
|
||||
LOGFONT m_LogFont;
|
||||
HWND m_hEditBox;
|
||||
|
||||
public:
|
||||
char * MakeWordBreak(const char *strString, unsigned long dwWidth);
|
||||
char * MakePrintGold(unsigned long dwGold);
|
||||
typedef struct Message
|
||||
{
|
||||
unsigned long dwCommand;
|
||||
float fTimer;
|
||||
char strMessage[MAX_PATH];
|
||||
unsigned long dwColor;
|
||||
} Message;
|
||||
|
||||
void AddNotice(char *strMessage, unsigned short wCmd);
|
||||
unsigned long GetChatColor(unsigned long dwCommand);
|
||||
deque<Message *> m_deqChatMessage;
|
||||
deque<Message *> m_deqPartyMessage;
|
||||
deque<Message *> m_deqGuildMessage;
|
||||
deque<Message *> m_deqNoticeMessage;
|
||||
deque<Message *> m_deqStallMessage;
|
||||
|
||||
unsigned long m_dwChatMode;
|
||||
unsigned long m_dwStartChat;
|
||||
unsigned long m_dwStartParty;
|
||||
unsigned long m_dwStartGuild;
|
||||
unsigned long m_dwStartStall;
|
||||
LPD3DXFONT m_lpText;
|
||||
unsigned long m_dwEditMode;
|
||||
|
||||
CGUITextEdit();
|
||||
~CGUITextEdit();
|
||||
|
||||
void DeleteStallMessage(void);
|
||||
void Create(HWND hWnd, LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void AddNormalChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand);
|
||||
void AddPartyChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand);
|
||||
void AddGuildChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand);
|
||||
void AddStallChatMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand);
|
||||
void AddMessage(char *strMessage, unsigned long dwSender, unsigned long dwCommand);
|
||||
unsigned long GetStringLength(const char *strString);
|
||||
void SetEditLength(WPARAM wParam);
|
||||
void InitMessage(void);
|
||||
void SetWindowText(void)
|
||||
{
|
||||
char strMessage[256];
|
||||
int length = ::GetWindowTextLength(m_hEditBox);
|
||||
if(length)
|
||||
{
|
||||
if(length < 255)
|
||||
{
|
||||
::GetWindowText(m_hEditBox, strMessage, 256);
|
||||
strcpy(m_strMessage, strMessage);
|
||||
} else
|
||||
{
|
||||
::SetWindowText(m_hEditBox, NULL);
|
||||
strcpy(m_strMessage, "");
|
||||
}
|
||||
} else
|
||||
strcpy(m_strMessage, "");
|
||||
//::GetWindowText(m_hEditBox, m_strMessage, MAX_PATH);
|
||||
}
|
||||
void SetWindowText(char *strString) { ::SetWindowText(m_hEditBox, strString); }
|
||||
char *GetMessage(void) { return m_strMessage; }
|
||||
void SetFocus(void) { ::SetFocus(m_hEditBox); }
|
||||
HWND GetHwnd(void) { return m_hEditBox; }
|
||||
BOOL IsFocus(void) { if(GetFocus() == m_hEditBox) return TRUE; else return FALSE; }
|
||||
void DrawText(const char *pString, RECT *pRect, unsigned long Format, D3DCOLOR Color)
|
||||
{
|
||||
m_lpText->DrawTextA(pString, -1, pRect, Format, Color);
|
||||
}
|
||||
};
|
||||
|
||||
extern CGUITextEdit g_TextEdit;
|
||||
|
||||
#endif // !defined(AFX_GUITEXTEDIT_H__5B84E354_3FE6_43BF_BAA4_9C5AF226EB9F__INCLUDED_)
|
||||
20
GameTools/NeoRylClient/GUITooltip.cpp
Normal file
20
GameTools/NeoRylClient/GUITooltip.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// GUITooltip.cpp: implementation of the CGUITooltip class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "GUITooltip.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUITooltip::CGUITooltip()
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
m_dwMaxLength = 0;
|
||||
m_dwAlign = DT_CENTER;
|
||||
}
|
||||
|
||||
CGUITooltip::~CGUITooltip()
|
||||
{
|
||||
}
|
||||
42
GameTools/NeoRylClient/GUITooltip.h
Normal file
42
GameTools/NeoRylClient/GUITooltip.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// GUITooltip.h: interface for the CGUITooltip class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUITOOLTIP_H__269F8F44_BF9E_401E_BFC8_8237A2BFE60B__INCLUDED_)
|
||||
#define AFX_GUITOOLTIP_H__269F8F44_BF9E_401E_BFC8_8237A2BFE60B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <windows.h>
|
||||
#include <d3d8.h>
|
||||
|
||||
class CGUITooltip
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwMaxLength;
|
||||
|
||||
public:
|
||||
BOOL m_bShow;
|
||||
RECT m_rcEdge;
|
||||
unsigned long m_dwAlign;
|
||||
|
||||
CGUITooltip();
|
||||
virtual ~CGUITooltip();
|
||||
|
||||
void SetRect(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
|
||||
{
|
||||
m_rcEdge.left = x1; m_rcEdge.top = y1; m_rcEdge.right = x2; m_rcEdge.bottom = y2;
|
||||
}
|
||||
void SetAlign(unsigned long dwAlign)
|
||||
{
|
||||
m_dwAlign = dwAlign;
|
||||
}
|
||||
|
||||
virtual BOOL GetIsTooltip(void) = 0;
|
||||
virtual void DestroyTooltip(void) = 0;
|
||||
virtual void Render(LPDIRECT3DDEVICE8 lpD3DDevice) = 0;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUITOOLTIP_H__269F8F44_BF9E_401E_BFC8_8237A2BFE60B__INCLUDED_)
|
||||
90
GameTools/NeoRylClient/GUITooltipButton.cpp
Normal file
90
GameTools/NeoRylClient/GUITooltipButton.cpp
Normal file
@@ -0,0 +1,90 @@
|
||||
// GUITooltipButton.cpp: implementation of the CGUITooltipButton class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITooltipButton.h"
|
||||
#include <string.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUITooltipButton::CGUITooltipButton()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CGUITooltipButton::~CGUITooltipButton()
|
||||
{
|
||||
DestroyTooltip();
|
||||
}
|
||||
|
||||
void CGUITooltipButton::InitTooltip(const char *strTooltip)
|
||||
{
|
||||
char seps[] = "\\";
|
||||
char *token;
|
||||
char strTemp[MAX_PATH * 4];
|
||||
char *strTempTooltip;
|
||||
|
||||
DestroyTooltip();
|
||||
|
||||
if(!strcmp(strTooltip, "")) { m_bShow = FALSE; return; }
|
||||
|
||||
strcpy(strTemp, strTooltip);
|
||||
token = strtok(strTemp, seps);
|
||||
|
||||
m_dwMaxLength = 0;
|
||||
unsigned long dwLength;
|
||||
for(;;)
|
||||
{
|
||||
if(!token) break;
|
||||
|
||||
strTempTooltip = new char[strlen(token) + 1];
|
||||
memcpy(strTempTooltip, token, strlen(token));
|
||||
strTempTooltip[strlen(token)] = '\0';
|
||||
dwLength = g_TextEdit.GetStringLength(strTempTooltip) + 4;
|
||||
if(dwLength >= m_dwMaxLength) m_dwMaxLength = dwLength;
|
||||
m_lstTooltip.push_back(strTempTooltip);
|
||||
token = strtok(NULL, seps);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGUITooltipButton::GetIsTooltip(void)
|
||||
{
|
||||
if(m_lstTooltip.empty())
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CGUITooltipButton::DestroyTooltip(void)
|
||||
{
|
||||
vector<char *>::iterator it;
|
||||
|
||||
for(it = m_lstTooltip.begin(); it != m_lstTooltip.end(); it++)
|
||||
{
|
||||
if((*it)) { delete (*it); (*it) = NULL; }
|
||||
}
|
||||
|
||||
m_lstTooltip.clear();
|
||||
}
|
||||
|
||||
void CGUITooltipButton::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
unsigned short SizeX = ptMousePos->x + 7;
|
||||
unsigned short SizeY = ptMousePos->y + 11;
|
||||
if(SizeX + m_dwMaxLength + 6 > BaseGraphicsLayer::m_lScreenSx) { SizeX -= (SizeX + m_dwMaxLength + 6) - BaseGraphicsLayer::m_lScreenSx; }
|
||||
if(SizeY + m_lstTooltip.size() * 18 + 6 > BaseGraphicsLayer::m_lScreenSy) { SizeY -= (SizeY + m_lstTooltip.size() * 18 + 6) - BaseGraphicsLayer::m_lScreenSy; }
|
||||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + m_dwMaxLength + 6, SizeY + m_lstTooltip.size() * 18 + 6, 0x00000000, 0x99);
|
||||
|
||||
RECT rcRect;
|
||||
for(long i = 0; i < m_lstTooltip.size(); i++)
|
||||
{
|
||||
::SetRect(&rcRect, SizeX + 3, SizeY + i * 18 + 3, SizeX + m_dwMaxLength, SizeY + i * 18 + 18 + 3);
|
||||
g_TextEdit.DrawText(m_lstTooltip[i], &rcRect, m_dwAlign | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
32
GameTools/NeoRylClient/GUITooltipButton.h
Normal file
32
GameTools/NeoRylClient/GUITooltipButton.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// GUITooltipButton.h: interface for the CGUITooltipButton class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUITOOLTIPBUTTON_H__F5EDCEA4_DBCE_459E_BD5D_09BDF373993F__INCLUDED_)
|
||||
#define AFX_GUITOOLTIPBUTTON_H__F5EDCEA4_DBCE_459E_BD5D_09BDF373993F__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUITooltip.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUITooltipButton : public CGUITooltip
|
||||
{
|
||||
protected:
|
||||
vector<char *> m_lstTooltip;
|
||||
|
||||
public:
|
||||
CGUITooltipButton();
|
||||
~CGUITooltipButton();
|
||||
|
||||
void InitTooltip(const char *strTooltip);
|
||||
BOOL GetIsTooltip(void);
|
||||
void DestroyTooltip(void);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUITOOLTIPBUTTON_H__F5EDCEA4_DBCE_459E_BD5D_09BDF373993F__INCLUDED_)
|
||||
1695
GameTools/NeoRylClient/GUITooltipItem.cpp
Normal file
1695
GameTools/NeoRylClient/GUITooltipItem.cpp
Normal file
File diff suppressed because it is too large
Load Diff
42
GameTools/NeoRylClient/GUITooltipItem.h
Normal file
42
GameTools/NeoRylClient/GUITooltipItem.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// GUITooltipItem.h: interface for the CGUITooltipItem class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUITOOLTIPITEM_H__A1D87897_CA5C_4253_B84C_8164BA57605C__INCLUDED_)
|
||||
#define AFX_GUITOOLTIPITEM_H__A1D87897_CA5C_4253_B84C_8164BA57605C__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "ItemInstance.h"
|
||||
#include "GUITooltip.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUITooltipItem : public CGUITooltip
|
||||
{
|
||||
protected:
|
||||
CItemInstance *m_lpItem;
|
||||
|
||||
public:
|
||||
void RenderEtc(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void GetBookTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine);
|
||||
void GetEtcTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine);
|
||||
void GetEquipTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine);
|
||||
void GetSkillTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine);
|
||||
void RenderSkill(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
CGUITooltipItem();
|
||||
~CGUITooltipItem();
|
||||
|
||||
void SetItem(CItemInstance *lpItem) { m_lpItem = lpItem; }
|
||||
void RenderEquip(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void RenderBook(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
|
||||
BOOL GetIsTooltip(void);
|
||||
void DestroyTooltip(void);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUITOOLTIPITEM_H__A1D87897_CA5C_4253_B84C_8164BA57605C__INCLUDED_)
|
||||
80
GameTools/NeoRylClient/GUITooltipManager.cpp
Normal file
80
GameTools/NeoRylClient/GUITooltipManager.cpp
Normal file
@@ -0,0 +1,80 @@
|
||||
// GUITooltipManager.cpp: implementation of the CGUITooltipManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "resource.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITooltipManager.h"
|
||||
|
||||
CGUITooltipManager g_TooltipManager;
|
||||
CGUITooltip *CGUITooltipManager::m_ttRenderTarget = NULL;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUITooltipManager::CGUITooltipManager()
|
||||
{
|
||||
m_ttRenderTarget = NULL;
|
||||
}
|
||||
|
||||
CGUITooltipManager::~CGUITooltipManager()
|
||||
{
|
||||
DestroyAllTooltip();
|
||||
}
|
||||
|
||||
BOOL CGUITooltipManager::AddTooltip(CGUITooltip *pTooltip)
|
||||
{
|
||||
m_lstTooltip.push_back(pTooltip);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CGUITooltipManager::DestroyAllTooltip()
|
||||
{
|
||||
vector<CGUITooltip *>::iterator it;
|
||||
CGUITooltip *lpTooltip;
|
||||
for(it = m_lstTooltip.begin(); it != m_lstTooltip.end();)
|
||||
{
|
||||
lpTooltip = (*it);
|
||||
it = m_lstTooltip.erase(it);
|
||||
delete lpTooltip;
|
||||
lpTooltip = NULL;
|
||||
}
|
||||
|
||||
m_lstTooltip.clear();
|
||||
}
|
||||
|
||||
void CGUITooltipManager::Update(long lMoveX, long lMoveY)
|
||||
{
|
||||
vector<CGUITooltip *>::iterator it;
|
||||
CGUITooltip *pTooltip;
|
||||
|
||||
for(it = m_lstTooltip.begin(); it != m_lstTooltip.end(); it++)
|
||||
{
|
||||
pTooltip = *it;
|
||||
|
||||
if(pTooltip->m_bShow)
|
||||
{
|
||||
if(g_DeviceInput.InRect(pTooltip->m_rcEdge.left + lMoveX, pTooltip->m_rcEdge.top + lMoveY,
|
||||
pTooltip->m_rcEdge.right + lMoveX - 1, pTooltip->m_rcEdge.bottom + lMoveY - 1))
|
||||
{
|
||||
m_ttRenderTarget = pTooltip;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGUITooltipManager::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_ttRenderTarget && m_ttRenderTarget->m_bShow)
|
||||
{
|
||||
// g_DeviceInput.ShowCursor(FALSE);
|
||||
m_ttRenderTarget->Render(lpD3DDevice);
|
||||
} else
|
||||
{
|
||||
// g_DeviceInput.ShowCursor(TRUE);
|
||||
}
|
||||
}
|
||||
33
GameTools/NeoRylClient/GUITooltipManager.h
Normal file
33
GameTools/NeoRylClient/GUITooltipManager.h
Normal file
@@ -0,0 +1,33 @@
|
||||
// GUITooltipManager.h: interface for the CGUITooltipManager class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUITOOLTIPMANAGER_H__3806D783_4DEC_4B10_8E79_64E6133EBC3B__INCLUDED_)
|
||||
#define AFX_GUITOOLTIPMANAGER_H__3806D783_4DEC_4B10_8E79_64E6133EBC3B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUITooltip.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CGUITooltipManager
|
||||
{
|
||||
public:
|
||||
vector<CGUITooltip *> m_lstTooltip;
|
||||
static CGUITooltip *m_ttRenderTarget;
|
||||
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void Update(long lMoveX = 0, long lMoveY = 0);
|
||||
void DestroyAllTooltip(void);
|
||||
BOOL AddTooltip(CGUITooltip *pTooltip);
|
||||
CGUITooltipManager();
|
||||
~CGUITooltipManager();
|
||||
};
|
||||
|
||||
extern CGUITooltipManager g_TooltipManager;
|
||||
|
||||
#endif // !defined(AFX_GUITOOLTIPMANAGER_H__3806D783_4DEC_4B10_8E79_64E6133EBC3B__INCLUDED_)
|
||||
82
GameTools/NeoRylClient/GUIWindow.cpp
Normal file
82
GameTools/NeoRylClient/GUIWindow.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
// GUIWindow.cpp: implementation of the CGUIWindow class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "WinInput.h"
|
||||
#include "GUIWindow.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CGUIWindow::CGUIWindow()
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
m_bWindowMoving = FALSE;
|
||||
m_dwWindowKind = WINDOW_FLOAT;
|
||||
m_cAlpha = 0xFF;
|
||||
}
|
||||
|
||||
CGUIWindow::~CGUIWindow()
|
||||
{
|
||||
m_TooltipManager.DestroyAllTooltip();
|
||||
m_ButtonManager.DestroyAllButton();
|
||||
|
||||
{
|
||||
vector<CGUIScroll *>::iterator it;
|
||||
for(it = m_lstScroll.begin(); it != m_lstScroll.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstScroll.clear();
|
||||
}
|
||||
|
||||
{
|
||||
vector<CSprite *>::iterator it;
|
||||
for(it = m_lstSprite.begin(); it != m_lstSprite.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstSprite.clear();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CGUIWindow::WindowMoving(POINT &ptMousePos)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcMoveEdge) && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
m_ptMove.x = ptMousePos.x - m_rcMoveEdge.left;
|
||||
m_ptMove.y = ptMousePos.y - m_rcMoveEdge.top;
|
||||
|
||||
m_bWindowMoving = TRUE;
|
||||
|
||||
m_cAlpha = 100;
|
||||
}
|
||||
|
||||
if((g_DeviceInput.InRect(m_rcMoveEdge) && g_DeviceInput.GetIsLeftMouseUp()) || !g_DeviceInput.GetIsFocus())
|
||||
{
|
||||
m_bWindowMoving = FALSE;
|
||||
|
||||
m_cAlpha = 0xFF;
|
||||
}
|
||||
|
||||
if(m_bWindowMoving)
|
||||
{
|
||||
m_ptWindowMovePos.x = ptMousePos.x - m_ptMove.x;
|
||||
m_ptWindowMovePos.y = ptMousePos.y - m_ptMove.y;
|
||||
|
||||
m_rcWindowSize.right = m_ptWindowMovePos.x + (m_rcWindowSize.right - m_rcWindowSize.left);
|
||||
m_rcWindowSize.bottom = m_ptWindowMovePos.y + (m_rcWindowSize.bottom - m_rcWindowSize.top);
|
||||
m_rcWindowSize.left = m_ptWindowMovePos.x;
|
||||
m_rcWindowSize.top = m_ptWindowMovePos.y;
|
||||
|
||||
m_rcMoveEdge.right = m_ptWindowMovePos.x + (m_rcMoveEdge.right - m_rcMoveEdge.left);
|
||||
m_rcMoveEdge.bottom = m_ptWindowMovePos.y + (m_rcMoveEdge.bottom - m_rcMoveEdge.top);
|
||||
m_rcMoveEdge.left = m_ptWindowMovePos.x;
|
||||
m_rcMoveEdge.top = m_ptWindowMovePos.y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
68
GameTools/NeoRylClient/GUIWindow.h
Normal file
68
GameTools/NeoRylClient/GUIWindow.h
Normal file
@@ -0,0 +1,68 @@
|
||||
// GUIWindow.h: interface for the CGUIWindow class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_GUIWINDOW_H__FBEDCE5C_5D7D_438F_B55B_112096006F1A__INCLUDED_)
|
||||
#define AFX_GUIWINDOW_H__FBEDCE5C_5D7D_438F_B55B_112096006F1A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <windows.h>
|
||||
#include <vector>
|
||||
#include "Sprite.h"
|
||||
#include "GUITooltipManager.h"
|
||||
#include "GUIButtonManager.h"
|
||||
#include "GUIScroll.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define WINDOW_FIX 0
|
||||
#define WINDOW_FLOAT 1
|
||||
|
||||
class CGUIWindow
|
||||
{
|
||||
protected:
|
||||
vector<CSprite *> m_lstSprite;
|
||||
vector<CGUIScroll *> m_lstScroll;
|
||||
CGUITooltipManager m_TooltipManager;
|
||||
CGUIButtonManager m_ButtonManager;
|
||||
|
||||
public:
|
||||
unsigned long m_dwWindowKind;
|
||||
RECT m_rcMoveEdge;
|
||||
RECT m_rcWindowSize;
|
||||
unsigned char m_cAlpha;
|
||||
BOOL m_bShow;
|
||||
POINT m_ptMove;
|
||||
POINT m_ptWindowMovePos;
|
||||
BOOL m_bWindowMoving;
|
||||
|
||||
CGUIWindow();
|
||||
virtual ~CGUIWindow();
|
||||
|
||||
void SetAlpha(unsigned char cAlpha) { m_cAlpha = cAlpha; }
|
||||
void SetWindowPos(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
|
||||
{
|
||||
m_rcWindowSize.left = x1; m_rcWindowSize.top = y1; m_rcWindowSize.right = x2; m_rcWindowSize.bottom = y2;
|
||||
}
|
||||
void SetMoveEdge(unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2)
|
||||
{
|
||||
m_rcMoveEdge.left = x1; m_rcMoveEdge.top = y1; m_rcMoveEdge.right = x2; m_rcMoveEdge.bottom = y2;
|
||||
}
|
||||
BOOL WindowMoving(POINT &ptMousePos);
|
||||
|
||||
CGUIButton *GetButton(unsigned long dwIndex)
|
||||
{
|
||||
return m_ButtonManager.m_lstButton[dwIndex];
|
||||
}
|
||||
|
||||
virtual BOOL Init(unsigned short x, unsigned short y) = 0;
|
||||
virtual void InitValue(void) = 0;
|
||||
virtual BOOL Update(BOOL &bClick, BOOL &bEdge) = 0;
|
||||
virtual void ShowWindow(BOOL bShow) = 0;
|
||||
virtual void Render(LPDIRECT3DDEVICE8 lpD3DDevice) = 0;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_GUIWINDOW_H__FBEDCE5C_5D7D_438F_B55B_112096006F1A__INCLUDED_)
|
||||
127
GameTools/NeoRylClient/HTTPClient.cpp
Normal file
127
GameTools/NeoRylClient/HTTPClient.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
// HTTPClient.cpp: implementation of the HTTPClient class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#include "stdafx.h"
|
||||
#include "HTTPClient.h"
|
||||
|
||||
DWORD WINAPI RecvProc(LPVOID lpParameter) {
|
||||
HTTPClient *c=(HTTPClient*)lpParameter;
|
||||
|
||||
int returncode=recv(c->HTTPsocket,c->buffer,MAX_RECEIVABLE,0);
|
||||
if (returncode<0) {
|
||||
closesocket(c->HTTPsocket);
|
||||
c->result=HTTP_ERROR;
|
||||
strcpy(c->buffer,"Could not receive server response");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
c->result=HTTP_OK;
|
||||
closesocket(c->HTTPsocket);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
HTTPClient::HTTPClient() {
|
||||
hostent=NULL;
|
||||
ready=FALSE;
|
||||
HTTPsocket=-1;
|
||||
|
||||
if (WSAStartup(MAKEWORD(1,1),&WSAData)!=0) {
|
||||
char szError[1024];
|
||||
wsprintf(szError,TEXT("WSAStartup failed. Error: %d"),WSAGetLastError());
|
||||
MessageBox (NULL, szError, TEXT("Error"), MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
ready=TRUE;
|
||||
}
|
||||
|
||||
HTTPClient::~HTTPClient() {
|
||||
if (hostent!=NULL) delete hostent;
|
||||
if (ready==TRUE) WSACleanup();
|
||||
}
|
||||
|
||||
void HTTPClient::Request(char *host, char *url) {
|
||||
if (result==HTTP_WAITING) Cancel();
|
||||
|
||||
if (hostent!=NULL) delete hostent;
|
||||
if (ready==FALSE) {
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Winsock did not start up correctly");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strlen(url)>MAX_URL_LENGTH || strlen(host)>MAX_URL_LENGTH) {
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Host or URL string is too long.");
|
||||
return;
|
||||
}
|
||||
|
||||
hostent=gethostbyname(host);
|
||||
if (hostent==NULL) {
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Host was not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
char *temp=(char *)inet_ntoa(*((struct in_addr *)hostent->h_addr));
|
||||
int IPInteger=inet_addr(temp);
|
||||
|
||||
HTTPsocket=socket(AF_INET,SOCK_STREAM,0);
|
||||
if (HTTPsocket<0) {
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Could not create HTTP socket");
|
||||
return;
|
||||
}
|
||||
|
||||
server_addr.sin_family=AF_INET;
|
||||
server_addr.sin_port=htons(80);
|
||||
server_addr.sin_addr.s_addr=IPInteger;
|
||||
ZeroMemory(&server_addr.sin_zero,8);
|
||||
|
||||
int addrlen = sizeof(struct sockaddr);
|
||||
int returncode=connect(HTTPsocket,(struct sockaddr*)&server_addr,sizeof(struct sockaddr));
|
||||
if (returncode<0) {
|
||||
closesocket(HTTPsocket);
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Could not connect to server");
|
||||
return;
|
||||
}
|
||||
|
||||
buffer[0]=0;
|
||||
strcat(buffer,"GET ");
|
||||
strcat(buffer,url);
|
||||
strcat(buffer," HTTP/1.0");
|
||||
strcat(buffer,"\015\012\000"); // CRLF
|
||||
strcat(buffer,"User-Agent:CustomClient/1.0");
|
||||
strcat(buffer,"\015\012\000"); // CRLF
|
||||
strcat(buffer,"\015\012\000"); // CRFL
|
||||
|
||||
result=HTTP_WAITING;
|
||||
|
||||
int bytes_sent=send(HTTPsocket,buffer,strlen(buffer),0);
|
||||
if (bytes_sent<0) {
|
||||
closesocket(HTTPsocket);
|
||||
result=HTTP_ERROR;
|
||||
strcpy(buffer,"Could not send URL request");
|
||||
return;
|
||||
}
|
||||
|
||||
basetime=GetTickCount();
|
||||
RecvThread=CreateThread(NULL,NULL,RecvProc,this,0,&ThreadID);
|
||||
}
|
||||
|
||||
void HTTPClient::Cancel() {
|
||||
result=HTTP_CANCEL;
|
||||
TerminateThread(RecvThread,0);
|
||||
}
|
||||
|
||||
BOOL HTTPClient::Wait(int time) {
|
||||
if ((long)GetTickCount()>(basetime+time)) result=HTTP_TIMEOUT;
|
||||
if (result!=HTTP_WAITING) return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
60
GameTools/NeoRylClient/HTTPClient.h
Normal file
60
GameTools/NeoRylClient/HTTPClient.h
Normal file
@@ -0,0 +1,60 @@
|
||||
// HTTPClient.h: interface for the HTTPClient class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HTTPCLIENT_H__2A78F088_AB6C_4971_BF0F_F9DC0C5B80AD__INCLUDED_)
|
||||
#define AFX_HTTPCLIENT_H__2A78F088_AB6C_4971_BF0F_F9DC0C5B80AD__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <winsock2.h>
|
||||
|
||||
#define MAX_RECEIVABLE 80000
|
||||
#define MAX_URL_LENGTH 256
|
||||
|
||||
#define HTTP 0
|
||||
|
||||
typedef struct {
|
||||
int protocol;
|
||||
int port;
|
||||
|
||||
char host[MAX_URL_LENGTH];
|
||||
char url[MAX_URL_LENGTH];
|
||||
} CONNECTSTRUCT, *LPCONNECTSTRUCT;
|
||||
|
||||
#define HTTP_WAITING 0
|
||||
#define HTTP_OK 1
|
||||
#define HTTP_ERROR 2
|
||||
#define HTTP_CANCEL 3
|
||||
#define HTTP_TIMEOUT 4
|
||||
#define MAX_RECEIVABLE 80000
|
||||
|
||||
class HTTPClient {
|
||||
public:
|
||||
void Request(char *host, char *url);
|
||||
HTTPClient();
|
||||
virtual ~HTTPClient();
|
||||
|
||||
WSADATA WSAData;
|
||||
|
||||
struct sockaddr_in server_addr;
|
||||
struct hostent *hostent;
|
||||
//CONNECTSTRUCT connect;
|
||||
|
||||
BOOL ready;
|
||||
int HTTPsocket;
|
||||
HANDLE RecvThread;
|
||||
DWORD ThreadID;
|
||||
long basetime;
|
||||
|
||||
public:
|
||||
BOOL Wait(int time);
|
||||
void Cancel(void);
|
||||
|
||||
int result;
|
||||
char buffer[MAX_RECEIVABLE+1];
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HTTPCLIENT_H__2A78F088_AB6C_4971_BF0F_F9DC0C5B80AD__INCLUDED_)
|
||||
202
GameTools/NeoRylClient/HumanChannel.cpp
Normal file
202
GameTools/NeoRylClient/HumanChannel.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
// HumanChannel.cpp: implementation of the CHumanChannel class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "HumanChannel.h"
|
||||
#include "GUITextEdit.h"
|
||||
|
||||
#include "GUIMessageBox.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanChannel::CHumanChannel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanChannel::~CHumanChannel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanChannel::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[41]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y, 0, 0, 117, 256, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(193, 210, 117, 132, 198, 165, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(193, 210, 117, 0, 198, 33, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(193, 210, 117, 66, 198, 99, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[560]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(279, 210, 117, 165, 198, 198, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(279, 210, 117, 33, 198, 66, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(279, 210, 117, 99, 198, 132, g_ClientMain.m_lpInterface->m_lstTexture[42]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[561]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 373; m_rcWindowSize.bottom = y + 256;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 373; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChannel::InitValue(void)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanChannel::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
unsigned long i;
|
||||
for(i = 0; i < m_cChannelNum; i++)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 20,
|
||||
m_rcWindowSize.top + 70 + i * 16, m_rcWindowSize.left + 352,
|
||||
m_rcWindowSize.top + 70 + 16 + i * 16) && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
m_dwSelectChannel = i;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK) // µé¾î°¡±â
|
||||
{
|
||||
if(m_aryChannel[m_dwSelectChannel])
|
||||
{
|
||||
g_ClientMain.m_dwClientMode = CLIENT_ZONEMOVE;
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_ZONEMOVE;
|
||||
if(g_ClientMain.m_bTestServerVersion)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->ServerZone(g_ClientMain.m_dwNextZone, 0);
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_dwNextZone == 2 || g_ClientMain.m_dwNextZone == 4 ||
|
||||
g_ClientMain.m_dwNextZone == 5 || g_ClientMain.m_dwNextZone == 6)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->ServerZone(g_ClientMain.m_dwNextZone, 0);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->ServerZone(g_ClientMain.m_dwNextZone, m_dwSelectChannel);
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[562]);
|
||||
}
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK) // Ãë¼Ò
|
||||
{
|
||||
ShowWindow(FALSE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChannel::ShowWindow(BOOL bShow)
|
||||
{
|
||||
if(bShow)
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
} else
|
||||
{
|
||||
m_bShow = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanChannel::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
//22, 70
|
||||
unsigned long i;
|
||||
RECT rcRect;
|
||||
char strText[MAX_PATH];
|
||||
for(i = 0; i < m_cChannelNum; i++)
|
||||
{
|
||||
sprintf(strText, g_StringTable.m_strString[563], i + 1);
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 22, m_rcWindowSize.top + 70 + i * 16, m_rcWindowSize.left + 140, m_rcWindowSize.top + 70 + 16 + i * 16);
|
||||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
|
||||
sprintf(strText, "%d%%", m_aryChannel[i]);
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 185, m_rcWindowSize.top + 70 + i * 16, m_rcWindowSize.left + 241, m_rcWindowSize.top + 70 + 16 + i * 16);
|
||||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_RIGHT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
|
||||
if(m_aryChannel[i]) strcpy(strText, "Open"); else strcpy(strText, "Close");
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 303, m_rcWindowSize.top + 70 + i * 16, m_rcWindowSize.left + 354, m_rcWindowSize.top + 70 + 16 + i * 16);
|
||||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_lpCommonInterface)
|
||||
{
|
||||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, m_rcWindowSize.left + 20,
|
||||
m_rcWindowSize.top + 70 + m_dwSelectChannel * 16, m_rcWindowSize.left + 352,
|
||||
m_rcWindowSize.top + 70 + 16 + m_dwSelectChannel * 16, 0xFFFFFFFF, 0x80);
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanChannel::SetChannel(unsigned char cChannelNum, unsigned short *lpChannel)
|
||||
{
|
||||
m_cChannelNum = cChannelNum;
|
||||
|
||||
if(g_ClientMain.m_dwChannelID < m_cChannelNum)
|
||||
{
|
||||
m_dwSelectChannel = g_ClientMain.m_dwChannelID;
|
||||
} else
|
||||
{
|
||||
m_dwSelectChannel = 0;
|
||||
}
|
||||
|
||||
for(unsigned long i = 0; i < m_cChannelNum; i++)
|
||||
{
|
||||
m_aryChannel[i] = lpChannel[i];
|
||||
}
|
||||
}
|
||||
31
GameTools/NeoRylClient/HumanChannel.h
Normal file
31
GameTools/NeoRylClient/HumanChannel.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// HumanChannel.h: interface for the CHumanChannel class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHANNEL_H__CBDD4C57_53EA_47F2_A984_28D764AF7418__INCLUDED_)
|
||||
#define AFX_HUMANCHANNEL_H__CBDD4C57_53EA_47F2_A984_28D764AF7418__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanChannel : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
unsigned long m_dwSelectChannel;
|
||||
unsigned short m_aryChannel[100];
|
||||
unsigned char m_cChannelNum;
|
||||
void SetChannel(unsigned char cChannelNum, unsigned short *lpChannel);
|
||||
CHumanChannel();
|
||||
virtual ~CHumanChannel();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHANNEL_H__CBDD4C57_53EA_47F2_A984_28D764AF7418__INCLUDED_)
|
||||
1102
GameTools/NeoRylClient/HumanChatWindow.cpp
Normal file
1102
GameTools/NeoRylClient/HumanChatWindow.cpp
Normal file
File diff suppressed because it is too large
Load Diff
27
GameTools/NeoRylClient/HumanChatWindow.h
Normal file
27
GameTools/NeoRylClient/HumanChatWindow.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanChatWindow.h: interface for the CHumanChatWindow class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHATWINDOW_H__E9F234CE_DAB3_44FA_8737_A2B556381A78__INCLUDED_)
|
||||
#define AFX_HUMANCHATWINDOW_H__E9F234CE_DAB3_44FA_8737_A2B556381A78__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanChatWindow : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanChatWindow();
|
||||
~CHumanChatWindow();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void) { }
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHATWINDOW_H__E9F234CE_DAB3_44FA_8737_A2B556381A78__INCLUDED_)
|
||||
1009
GameTools/NeoRylClient/HumanChrCreateLeft.cpp
Normal file
1009
GameTools/NeoRylClient/HumanChrCreateLeft.cpp
Normal file
File diff suppressed because it is too large
Load Diff
132
GameTools/NeoRylClient/HumanChrCreateLeft.h
Normal file
132
GameTools/NeoRylClient/HumanChrCreateLeft.h
Normal file
@@ -0,0 +1,132 @@
|
||||
// HumanChrCreateLeft.h: interface for the CHumanChrCreateLeft class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__INCLUDED_)
|
||||
#define AFX_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
static const unsigned short ALLOW_HAN_NUM = 39;
|
||||
static unsigned short AllowHans[ALLOW_HAN_NUM] =
|
||||
{
|
||||
'갉', '갊', '걺', '괆', '녠',
|
||||
'닒', '롼', '뢸', '룀', '룁',
|
||||
'룅', '뤠', '륄', '륌', '륏',
|
||||
'륑', '륩', '륫', '릊', '릍',
|
||||
'멂', '몲', '뭬', '뮴', '밗',
|
||||
'뱝', '뾔', '쓿', '줴', '쥣',
|
||||
'짢', '췽', '퀭', '푤', '푭',
|
||||
'풩', '핥', '홅', '흖'
|
||||
};
|
||||
|
||||
static const unsigned short ALLOW_LETTER_NUM = 2;
|
||||
static char AllowLetters[ALLOW_LETTER_NUM] =
|
||||
{
|
||||
'-', '_'
|
||||
};
|
||||
|
||||
class CHumanChrCreate : public CGUIWindow
|
||||
{
|
||||
protected:
|
||||
unsigned short m_wClass;
|
||||
unsigned long m_dwStr;
|
||||
unsigned long m_dwDex;
|
||||
unsigned long m_dwCon;
|
||||
unsigned long m_dwInt;
|
||||
unsigned long m_dwWis;
|
||||
unsigned long m_dwIP;
|
||||
char m_strName[16];
|
||||
unsigned long m_dwEndTimer;
|
||||
unsigned long m_dwSex;
|
||||
unsigned long m_dwHair;
|
||||
unsigned long m_dwFace;
|
||||
unsigned long m_dwShirt;
|
||||
|
||||
inline bool CheckCharCreateName(char *Name_In)
|
||||
{
|
||||
const unsigned short MIN_CHAR_NAME = 4;
|
||||
const unsigned short MAX_CHAR_NAME = 15;
|
||||
|
||||
if(Name_In == NULL)
|
||||
return false;
|
||||
|
||||
// 길이 제한
|
||||
size_t Len = strlen(Name_In);
|
||||
if(Len < MIN_CHAR_NAME || Len > MAX_CHAR_NAME)
|
||||
return false;
|
||||
|
||||
LPBYTE CheckName = (LPBYTE)Name_In;
|
||||
|
||||
// 제한 문자 검사
|
||||
int ACount = 0;
|
||||
for(unsigned short LCount = 0; LCount < Len; LCount++)
|
||||
{
|
||||
if((CheckName[LCount] & 0x80) == 0x80)
|
||||
{
|
||||
// 2Byte 문자 체크
|
||||
if(CheckName[LCount + 1] == NULL)
|
||||
return false;
|
||||
|
||||
// 허용 범위 체크 (한글)
|
||||
if(CheckName[LCount] < 0xB0 || CheckName[LCount] > 0xC9)
|
||||
return false;
|
||||
|
||||
if(CheckName[LCount + 1] < 0xA1 || CheckName[LCount + 1] > 0xFE)
|
||||
return false;
|
||||
|
||||
// 한글 부분 불 허용
|
||||
for(ACount = 0; ACount < ALLOW_HAN_NUM; ACount++)
|
||||
{
|
||||
if(MAKEWORD(CheckName[LCount + 1], CheckName[LCount]) == AllowHans[ACount])
|
||||
break;
|
||||
}
|
||||
|
||||
if(ACount != ALLOW_HAN_NUM)
|
||||
return false;
|
||||
|
||||
LCount += 1;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 영문자 허용
|
||||
if((CheckName[LCount] >= 'A' && CheckName[LCount] <= 'Z') || (CheckName[LCount] >= 'a' && CheckName[LCount] <= 'z'))
|
||||
continue;
|
||||
|
||||
// 숫자 허용
|
||||
if(CheckName[LCount] >= '0' && CheckName[LCount] <= '9')
|
||||
continue;
|
||||
|
||||
// 특수 기호 부분 허용
|
||||
for(ACount = 0; ACount < ALLOW_LETTER_NUM; ACount++)
|
||||
{
|
||||
if(CheckName[LCount] == AllowLetters[ACount])
|
||||
break;
|
||||
}
|
||||
|
||||
if(ACount == ALLOW_LETTER_NUM)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
void CreateCancel(void);
|
||||
CHumanChrCreate();
|
||||
~CHumanChrCreate();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHRCREATELEFT_H__BAAE8B73_C563_4F0D_8E7D_45FAF1B50D38__INCLUDED_)
|
||||
33
GameTools/NeoRylClient/HumanChrCreateRight.cpp
Normal file
33
GameTools/NeoRylClient/HumanChrCreateRight.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
// HumanChrCreateRight.cpp: implementation of the CHumanChrCreateRight class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "HumanChrCreateRight.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanChrCreateRight::CHumanChrCreateRight()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanChrCreateRight::~CHumanChrCreateRight()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanChrCreateRight::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanChrCreateRight::Update(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChrCreateRight::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
}
|
||||
25
GameTools/NeoRylClient/HumanChrCreateRight.h
Normal file
25
GameTools/NeoRylClient/HumanChrCreateRight.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// HumanChrCreateRight.h: interface for the CHumanChrCreateRight class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHRCREATERIGHT_H__19BEC395_C3C8_4D3D_A7B1_1EFD01779A99__INCLUDED_)
|
||||
#define AFX_HUMANCHRCREATERIGHT_H__19BEC395_C3C8_4D3D_A7B1_1EFD01779A99__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanChrCreateRight : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanChrCreateRight();
|
||||
~CHumanChrCreateRight();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
BOOL Update(void);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHRCREATERIGHT_H__19BEC395_C3C8_4D3D_A7B1_1EFD01779A99__INCLUDED_)
|
||||
220
GameTools/NeoRylClient/HumanChrSelect1.cpp
Normal file
220
GameTools/NeoRylClient/HumanChrSelect1.cpp
Normal file
@@ -0,0 +1,220 @@
|
||||
// HumanChrSelect1.cpp: implementation of the CHumanChrSelect1 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "FrameTimer.h"
|
||||
#include "HumanChrSelect1.h"
|
||||
#include "WinInput.h"
|
||||
#include "HumanGUI.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanChrSelect1::CHumanChrSelect1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanChrSelect1::~CHumanChrSelect1()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanChrSelect1::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 499, 0, 0, 128, 101, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(128, 521, 206, 102, 233, 146, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(14, 14, 0, 102, 206, 182, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(153, 135, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(533, 67, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(449, 321, 0, 182, 130, 216, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(33, 526, 144, 0, 256, 34, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(33, 526, 144, 34, 256, 68, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(33, 526, 144, 68, 256, 102, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x; m_rcWindowSize.bottom = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x; m_rcMoveEdge.bottom = y;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChrSelect1::InitValue(void)
|
||||
{
|
||||
m_dwOverChrID = 0xFFFFFFFF;
|
||||
m_dwEndTimer = 0xFFFFFFFF;
|
||||
g_ClientMain.m_bSelectChar = FALSE;
|
||||
}
|
||||
|
||||
BOOL CHumanChrSelect1::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
m_dwOverChrID = g_ClientMain.GetScreenPosChr(*ptMousePos, 10000, 0); // TARGET_SELECTCHAR = 10000
|
||||
|
||||
BOOL bIsExist = FALSE;
|
||||
m_dwOverChr = 0xFFFFFFFF;
|
||||
if(m_dwOverChrID != 0xFFFFFFFF)
|
||||
{
|
||||
for(long i = 0; i < 3; i++)
|
||||
{
|
||||
if(m_dwOverChrID == g_CharacterData.m_lstCharData[i]->m_dwChrID)
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[i].UID) bIsExist = TRUE;
|
||||
m_dwOverChr = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!bIsExist) m_dwOverChrID = 0xFFFFFFFF;
|
||||
|
||||
if(m_dwEndTimer != 0xFFFFFFFF)
|
||||
{
|
||||
if(g_ClientMain.m_bSelectChar) return TRUE;
|
||||
|
||||
if(CFrameTimer::GetUpdateTimer(m_dwEndTimer) >= 1.0f)
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID)
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITSTART;
|
||||
else
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITCREATE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDBClick())
|
||||
{
|
||||
if(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID)
|
||||
{
|
||||
g_ClientMain.m_Network.CharSelect(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwOverChr != 0xFFFFFFFF && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
char strCameraPath[MAX_PATH];
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
g_ClientMain.m_dwSelectChr = m_dwOverChr;
|
||||
|
||||
switch(m_dwOverChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzi.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzi.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzi.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
SendMessage(g_ClientMain.m_hWnd, WM_DESTROY, 0, 0);
|
||||
g_ClientMain.m_dwClientMode = CLIENT_END;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChrSelect1::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF) return;
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
for(long i = 0; i < 3; i++)
|
||||
{
|
||||
if(!g_ClientMain.m_scLoginChar[i].UID)
|
||||
{
|
||||
m_lstSprite[3 + i]->Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_dwOverChrID != 0xFFFFFFFF)
|
||||
{
|
||||
m_lstSprite[2]->Render(lpD3DDevice, m_cAlpha);
|
||||
RECT rcRect;
|
||||
char Temp[MAX_PATH];
|
||||
SetRect(&rcRect, 105, 23, 206, 36);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_scLoginChar[m_dwOverChr].Name, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
sprintf(Temp, "%d", g_ClientMain.m_scLoginChar[m_dwOverChr].Level);
|
||||
SetRect(&rcRect, 105, 39, 206, 52);
|
||||
g_TextEdit.DrawText(Temp, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
sprintf(Temp, "%d", g_ClientMain.m_scLoginChar[m_dwOverChr].Merits);
|
||||
SetRect(&rcRect, 105, 55, 206, 68);
|
||||
g_TextEdit.DrawText(Temp, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
SetRect(&rcRect, 105, 71, 206, 84);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_lpCommonInterface->GetClassName(g_ClientMain.m_scLoginChar[m_dwOverChr].Class),
|
||||
&rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
32
GameTools/NeoRylClient/HumanChrSelect1.h
Normal file
32
GameTools/NeoRylClient/HumanChrSelect1.h
Normal file
@@ -0,0 +1,32 @@
|
||||
// HumanChrSelect1.h: interface for the CHumanChrSelect1 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHRSELECT1_H__95CC7176_F5C7_4DBC_868D_7C30BBA2B6C7__INCLUDED_)
|
||||
#define AFX_HUMANCHRSELECT1_H__95CC7176_F5C7_4DBC_868D_7C30BBA2B6C7__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanChrSelect1 : public CGUIWindow
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwOverChrID;
|
||||
unsigned long m_dwOverChr;
|
||||
unsigned long m_dwEndTimer;
|
||||
|
||||
public:
|
||||
CHumanChrSelect1();
|
||||
~CHumanChrSelect1();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHRSELECT1_H__95CC7176_F5C7_4DBC_868D_7C30BBA2B6C7__INCLUDED_)
|
||||
269
GameTools/NeoRylClient/HumanChrSelect2.cpp
Normal file
269
GameTools/NeoRylClient/HumanChrSelect2.cpp
Normal file
@@ -0,0 +1,269 @@
|
||||
// HumanChrSelect2.cpp: implementation of the CHumanChrSelect2 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanGUI.h"
|
||||
#include "HumanChrSelect2.h"
|
||||
#include "FrameTimer.h"
|
||||
#include "GUIMessageBoxManager.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanChrSelect2::CHumanChrSelect2()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanChrSelect2::~CHumanChrSelect2()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHumanChrSelect2::InitValue(void)
|
||||
{
|
||||
m_dwChrDeleteResult = 0;
|
||||
m_dwEndTimer = 0xFFFFFFFF;
|
||||
g_ClientMain.m_bDeleteChar = FALSE;
|
||||
}
|
||||
|
||||
BOOL CHumanChrSelect2::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 457, 0, 0, 234, 143, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(617, 462, 73, 0, 256, 143, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(61, 479, 0, 143, 163, 177, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(61, 479, 0, 177, 163, 211, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(61, 479, 0, 211, 163, 245, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(31, 527, 144, 154, 256, 188, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(31, 527, 144, 188, 256, 222, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(31, 527, 144, 222, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_NORMAL;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(624, 526, 0, 154, 144, 188, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(624, 526, 0, 188, 144, 222, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(624, 526, 0, 222, 144, 256, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x; m_rcWindowSize.bottom = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x; m_rcMoveEdge.bottom = y;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanChrSelect2::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
g_MessageBoxManager.Update();
|
||||
|
||||
if(g_ClientMain.m_bSelectChar) return TRUE;
|
||||
|
||||
if(m_dwEndTimer != 0xFFFFFFFF)
|
||||
{
|
||||
if(CFrameTimer::GetUpdateTimer(m_dwEndTimer) >= 1.0f)
|
||||
{
|
||||
g_ClientMain.m_dwClientState = CHRSELECT_INITSELECT;
|
||||
g_MessageBoxManager.DestroyList();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(m_dwChrDeleteResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_bDeleteChar = TRUE;
|
||||
g_ClientMain.m_Network.SendDeleteChar(g_ClientMain.m_dwSelectChr, g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[120]);
|
||||
lpMessage->SetTimer(100000);
|
||||
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_dwChrDeleteResult & MB_NO || m_dwChrDeleteResult & MB_EXIT)
|
||||
{
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_Network.GetState() != NS_NOWAITING)
|
||||
return TRUE;
|
||||
|
||||
if(g_ClientMain.m_bDeleteChar)
|
||||
{
|
||||
if(g_ClientMain.m_Network.GetState() == NS_NOWAITING)
|
||||
{
|
||||
if(!g_ClientMain.m_Network.GetError())
|
||||
{
|
||||
for(int cCash=0;cCash<g_CharacterData.m_ChrCashList.num;cCash++)
|
||||
{
|
||||
if(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel==g_CharacterData.m_ChrCashList[cCash].m_lpChrModel)
|
||||
{
|
||||
g_ClientMain.m_lpSceneManager->DeleteCharacter(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel);
|
||||
g_CharacterData.m_ChrCashList[cCash].m_lpChrModel = g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel = g_ClientMain.m_lpSceneManager->AddCharacter("PC_MAN.GCMDS", "FACE01", "HAIR01");
|
||||
|
||||
for(int j = 0; j < 15; j++)
|
||||
{
|
||||
strcpy(g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_strShape[j], "");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetPosition(g_ClientMain.m_vecCharSelectPos[g_ClientMain.m_dwSelectChr]);
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetDirection(0.0f);
|
||||
// g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->m_lpChrModel->SetMotion("WAIT");
|
||||
g_CharacterData.m_lstCharData[g_ClientMain.m_dwSelectChr]->InitWeapon(0);
|
||||
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
char strCameraPath[MAX_PATH];
|
||||
switch(g_ClientMain.m_dwSelectChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_bDeleteChar = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK) // Áö¿ì±â
|
||||
{
|
||||
CGUIMessageBox *lpMessage;
|
||||
lpMessage = new CGUIMessageBox;
|
||||
lpMessage->Create(g_StringTable.m_strString[121], MB_EXIT | MB_YES | MB_NO);
|
||||
lpMessage->SetResult(&m_dwChrDeleteResult);
|
||||
m_dwChrDeleteResult = 0;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK) // Ãë¼Ò
|
||||
{
|
||||
char strCameraPath[MAX_PATH];
|
||||
|
||||
m_dwEndTimer = CFrameTimer::Regist(1.0f);
|
||||
|
||||
switch(g_ClientMain.m_dwSelectChr)
|
||||
{
|
||||
case 0:
|
||||
sprintf(strCameraPath, "%s\\1stCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
sprintf(strCameraPath, "%s\\2ndCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sprintf(strCameraPath, "%s\\3rdCSzo.zca", g_ClientMain.m_strClientPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->Load(strCameraPath);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(1000.0f);
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->StartPlay();
|
||||
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
|
||||
break;
|
||||
}
|
||||
|
||||
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_CLICK) // µé¾î°¡±â
|
||||
{
|
||||
g_ClientMain.m_Network.CharSelect(g_ClientMain.m_scLoginChar[g_ClientMain.m_dwSelectChr].UID);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanChrSelect2::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_dwEndTimer != 0xFFFFFFFF) return;
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
g_MessageBoxManager.Render(lpD3DDevice);
|
||||
}
|
||||
31
GameTools/NeoRylClient/HumanChrSelect2.h
Normal file
31
GameTools/NeoRylClient/HumanChrSelect2.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// HumanChrSelect2.h: interface for the CHumanChrSelect2 class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANCHRSELECT2_H__12B2E013_49C2_4540_9BC2_E1952E76EE77__INCLUDED_)
|
||||
#define AFX_HUMANCHRSELECT2_H__12B2E013_49C2_4540_9BC2_E1952E76EE77__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanChrSelect2 : public CGUIWindow
|
||||
{
|
||||
protected:
|
||||
unsigned long m_dwEndTimer;
|
||||
unsigned long m_dwChrDeleteResult;
|
||||
|
||||
public:
|
||||
CHumanChrSelect2();
|
||||
~CHumanChrSelect2();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANCHRSELECT2_H__12B2E013_49C2_4540_9BC2_E1952E76EE77__INCLUDED_)
|
||||
811
GameTools/NeoRylClient/HumanExchange.cpp
Normal file
811
GameTools/NeoRylClient/HumanExchange.cpp
Normal file
@@ -0,0 +1,811 @@
|
||||
// HumanExchange.cpp: implementation of the CHumanExchange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "HumanExchange.h"
|
||||
#include "GUIMessageBox.h"
|
||||
#include "GUITooltipItem.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "GUIMessageBox.h"
|
||||
#include "GUIMessageBoxManager.h"
|
||||
|
||||
#include "Item\ItemMgr.h"
|
||||
#include "Item\ItemFactory.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanExchange::CHumanExchange()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanExchange::~CHumanExchange()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanExchange::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 252, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 222, y, 0, 0, 222, 252, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 0 : 상대방 확인
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(35, 215, 114, 130, 182, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(35, 215, 182, 130, 250, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[125]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 1 : 상대방 취소
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(120, 215, 114, 104, 182, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(120, 215, 182, 104, 250, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[126]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 2: 확인
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(35 + 222, 215, 114, 130, 182, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(35 + 222, 215, 182, 130, 250, 156, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[125]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 3 : 취소
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(120 + 222, 215, 114, 104, 182, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(120 + 222, 215, 182, 104, 250, 130, g_ClientMain.m_lpInterface->m_lstTexture[12]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[126]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 4 : 돈 버튼
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(180 + 222, 185, 180, 185, 208, 205, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(180 + 222, 185, 85, 153, 113, 173, g_ClientMain.m_lpInterface->m_lstTexture[11]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 5 : 상대편 락
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_CHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(192, 32, 222, 0, 248, 26, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(192, 32, 222, 26, 248, 52, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(192, 32, 222, 52, 248, 78, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[129]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
// 6 : 락
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_CHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(192 + 222, 32, 222, 0, 248, 26, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->m_lpOnMouseButton = new CSprite;
|
||||
lpButton->m_lpOnMouseButton->Create(192 + 222, 32, 222, 26, 248, 52, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(192 + 222, 32, 222, 52, 248, 78, g_ClientMain.m_lpInterface->m_lstTexture[39]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[129]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
InitValue();
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 444; m_rcWindowSize.bottom = y + 252;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 444; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanExchange::InitValue(void)
|
||||
{
|
||||
m_dwSplitResult = 0;
|
||||
m_dwSplitValue = 0;
|
||||
m_lpSplitItem = NULL;
|
||||
m_bSingleWindow = FALSE;
|
||||
m_dwExchangeGoldResult = 0;
|
||||
m_dwExchangeGoldValue = 0;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[1]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[2]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[3]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_NONE;
|
||||
}
|
||||
|
||||
BOOL CHumanExchange::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
// 손에 물건을 들고 있을때 취소와 돈 놓기 버튼을 누르지 못한다.
|
||||
if(!g_ClientMain.m_lpPickItem && !m_bSingleWindow)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[3]->Update();
|
||||
m_ButtonManager.m_lstButton[4]->Update();
|
||||
}
|
||||
|
||||
// 확인이 눌러지면 락이 활동을 못한다.
|
||||
if(!m_bSingleWindow && !g_ClientMain.m_lpPickItem &&
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_NONE &&
|
||||
g_DeviceInput.InRect(192 + 222 + m_rcWindowSize.left, 32 + m_rcWindowSize.top, 192 + 222 + 26 + m_rcWindowSize.left, 32 + 26 + m_rcWindowSize.top) &&
|
||||
g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
unsigned short wCmd;
|
||||
if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_NONE)
|
||||
{
|
||||
wCmd = ClientSocket::ExchangeCmd_Lock;
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, wCmd);
|
||||
} else
|
||||
{
|
||||
wCmd = ClientSocket::ExchangeCmd_UnLock;
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, wCmd);
|
||||
}
|
||||
}
|
||||
|
||||
m_TooltipManager.Update();
|
||||
|
||||
// 나누기
|
||||
if(m_dwSplitResult & MB_YES)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
|
||||
if(m_dwSplitValue)
|
||||
{
|
||||
if(m_dwSplitValue >= m_lpSplitItem->GetNowDurability())
|
||||
{
|
||||
g_ClientMain.SetPickItem(m_lpSplitItem, FALSE);
|
||||
g_ClientMain.m_csStatus.DeleteExchangeItem(m_lpSplitItem);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_lpPickItem = new CItemInstance;
|
||||
g_ClientMain.m_lpPickItem->m_lpItemBase = Item::CItemFactory::GetInstance().CreateItem(m_lpSplitItem->GetProtoTypeID());
|
||||
g_ClientMain.m_lpPickItem->SetPos(m_lpSplitItem->m_lpItemBase->GetPos().m_cIndex);
|
||||
g_ClientMain.m_lpPickItem->SetNowDurability(m_dwSplitValue);
|
||||
|
||||
g_ClientMain.m_lpPickItem->SetItemPos(ClientSocket::ItemPos_Exchange);
|
||||
g_ClientMain.m_lpPickItem->m_dwItemUID = m_lpSplitItem->m_dwItemUID;
|
||||
g_ClientMain.m_lpPickItem->m_lpSprite = new CSprite;
|
||||
g_ClientMain.m_lpPickItem->m_lpSprite->Create(0, 0, g_ClientMain.m_lpPickItem->GetItemInfo().m_SpriteData.m_nSpriteMinX,
|
||||
g_ClientMain.m_lpPickItem->GetItemInfo().m_SpriteData.m_nSpriteMinY,
|
||||
g_ClientMain.m_lpPickItem->GetItemInfo().m_SpriteData.m_nSpriteMaxX,
|
||||
g_ClientMain.m_lpPickItem->GetItemInfo().m_SpriteData.m_nSpriteMaxY, NULL);
|
||||
g_ClientMain.m_lpPickItem->m_lpTooltip = new CGUITooltipItem;
|
||||
((CGUITooltipItem *)g_ClientMain.m_lpPickItem->m_lpTooltip)->SetItem(g_ClientMain.m_lpPickItem);
|
||||
|
||||
unsigned long dwDurability = m_lpSplitItem->GetNowDurability() - m_dwSplitValue;
|
||||
m_lpSplitItem->SetNowDurability(dwDurability);
|
||||
}
|
||||
}
|
||||
|
||||
m_dwSplitResult = 0;
|
||||
m_dwSplitValue = 0;
|
||||
m_lpSplitItem = NULL;
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_ClientMain.SetFocus();
|
||||
|
||||
return TRUE;
|
||||
} else if(m_dwSplitResult & MB_NO || m_dwSplitResult & MB_EXIT)
|
||||
{
|
||||
m_dwSplitResult = 0;
|
||||
m_dwSplitValue = 0;
|
||||
m_lpSplitItem = NULL;
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_ClientMain.SetFocus();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 돈 올리기
|
||||
if(m_dwExchangeGoldResult & MB_YES)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_csStatus.m_Info.Gold <= m_dwExchangeGoldValue)
|
||||
{
|
||||
m_dwExchangeGoldValue = g_ClientMain.m_csStatus.m_Info.Gold;
|
||||
}
|
||||
|
||||
__int64 ddGold = (__int64)m_dwExchangeGoldValue - (__int64)g_ClientMain.m_csStatus.m_dwExchangeGold;
|
||||
if(ddGold > 0)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_TAKEGOLD;
|
||||
g_ClientMain.m_Network.m_pSocket->CharTakeGold(g_ClientMain.m_dwMyChrID, ClientSocket::ItemPos_Inven, ClientSocket::ItemPos_Exchange, (unsigned long)ddGold);
|
||||
} else if(ddGold < 0)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_TAKEGOLD;
|
||||
g_ClientMain.m_Network.m_pSocket->CharTakeGold(g_ClientMain.m_dwMyChrID, ClientSocket::ItemPos_Exchange, ClientSocket::ItemPos_Inven, (unsigned long)-ddGold);
|
||||
}
|
||||
|
||||
m_dwExchangeGoldResult = 0;
|
||||
m_dwExchangeGoldValue = 0;
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_ClientMain.SetFocus();
|
||||
|
||||
return TRUE;
|
||||
} else if(m_dwExchangeGoldResult & MB_NO || m_dwExchangeGoldResult & MB_EXIT)
|
||||
{
|
||||
m_dwExchangeGoldResult = 0;
|
||||
m_dwExchangeGoldValue = 0;
|
||||
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
|
||||
g_ClientMain.SetFocus();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 교환창 아이템 선택
|
||||
if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_NONE)
|
||||
{
|
||||
if(SelectItem())
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// 확인 버튼 누르기
|
||||
if(!m_bSingleWindow && !g_ClientMain.m_lpPickItem &&
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD && m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD &&
|
||||
g_DeviceInput.InRect(35 + 222 + m_rcWindowSize.left, 215 + m_rcWindowSize.top, 35 + 222 + 68 + m_rcWindowSize.left, 215 + 26 + m_rcWindowSize.top) &&
|
||||
g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
unsigned short wCmd;
|
||||
if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_NONE)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD)
|
||||
wCmd = ClientSocket::ExchangeCmd_Exchange;
|
||||
else
|
||||
wCmd = ClientSocket::ExchangeCmd_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
wCmd = ClientSocket::ExchangeCmd_Cancel;
|
||||
}
|
||||
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, wCmd);
|
||||
}
|
||||
|
||||
// 취소 버튼 누르기
|
||||
if(m_ButtonManager.m_lstButton[3]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
unsigned short wCmd;
|
||||
if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
wCmd = ClientSocket::ExchangeCmd_Cancel;
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, wCmd);
|
||||
}
|
||||
else if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_NONE)
|
||||
{
|
||||
wCmd = ClientSocket::ExchangeCmd_Quit;
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, wCmd);
|
||||
}
|
||||
}
|
||||
|
||||
// 돈 버튼 누르기
|
||||
if(m_ButtonManager.m_lstButton[4]->m_nState == BUTTON_CLICK &&
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_NONE &&
|
||||
g_ClientMain.m_dwKindCursor == CURSOR_NORMAL && !g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[128], MB_NUMBER | MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwExchangeGoldResult);
|
||||
lpMessageBox->SetValue(&m_dwExchangeGoldValue);
|
||||
g_TextEdit.SetFocus();
|
||||
|
||||
m_dwExchangeGoldResult = 0;
|
||||
m_dwExchangeGoldValue = 0;
|
||||
}
|
||||
|
||||
unsigned long dwInvenX = (ptMousePos->x - (m_rcWindowSize.left + 230)) / 26;
|
||||
unsigned long dwInvenY = (ptMousePos->y - (m_rcWindowSize.top + 72)) / 26;
|
||||
|
||||
__int64 ddItem;
|
||||
|
||||
if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_NONE)
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() && g_ClientMain.m_lpPickItem && g_ClientMain.m_lpPickItem->GetItemPos() != ClientSocket::ItemPos_QSlot)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 230, m_rcWindowSize.top + 72, m_rcWindowSize.left + 437, m_rcWindowSize.top + 175)) // 교환창
|
||||
{
|
||||
if((ddItem = g_ClientMain.m_csStatus.IsCheckItem(g_ClientMain.m_lpPickItem, 3, dwInvenX, dwInvenY)) != ITEM_FAILED)
|
||||
{
|
||||
Item::ItemPos pItemIndex;
|
||||
pItemIndex.SetPos(dwInvenX, dwInvenY, 0);
|
||||
pItemIndex.m_cPos = ClientSocket::ItemPos_Exchange;
|
||||
|
||||
if(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos() == pItemIndex)
|
||||
{
|
||||
CItemInstance *lpExistItem = g_ClientMain.m_csStatus.GetExchangeItem(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos());
|
||||
|
||||
if(lpExistItem)
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack())
|
||||
{
|
||||
unsigned dwDurability = lpExistItem->GetNowDurability() + g_ClientMain.m_lpPickItem->GetNowDurability();
|
||||
lpExistItem->SetNowDurability(dwDurability);
|
||||
delete g_ClientMain.m_lpPickItem;
|
||||
g_ClientMain.SetPickItem(NULL);
|
||||
}
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_csStatus.AddExchangeItem(g_ClientMain.m_lpPickItem);
|
||||
g_ClientMain.SetPickItem(NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(ddItem == ITEM_EMPTY)
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack())
|
||||
{
|
||||
CItemInstance *lpExistItem = NULL;
|
||||
switch(g_ClientMain.m_lpPickItem->GetItemPos())
|
||||
{
|
||||
case ClientSocket::ItemPos_Inven:
|
||||
lpExistItem = g_ClientMain.m_csStatus.GetInventoryItem(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos());
|
||||
break;
|
||||
|
||||
case ClientSocket::ItemPos_Exchange:
|
||||
lpExistItem = g_ClientMain.m_csStatus.GetExchangeItem(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos());
|
||||
break;
|
||||
}
|
||||
|
||||
if(lpExistItem && lpExistItem->GetProtoTypeID() == g_ClientMain.m_lpPickItem->GetProtoTypeID())
|
||||
{
|
||||
// 기존의 자리에 아이템이 남아있으면 아이템이 나눠진걸로 생각, 아이템을 스택한다.
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
g_ClientMain.m_Network.SendSplitItem(g_ClientMain.m_lpPickItem, &pItemIndex, g_ClientMain.m_lpPickItem->GetNowDurability());
|
||||
} else
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
g_ClientMain.m_Network.SendTakeItem(g_ClientMain.m_lpPickItem, &pItemIndex, g_ClientMain.m_lpPickItem->GetNowDurability());
|
||||
}
|
||||
} else
|
||||
{
|
||||
// 아이템 이동
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
g_ClientMain.m_Network.SendTakeItem(g_ClientMain.m_lpPickItem, &pItemIndex, 1);
|
||||
}
|
||||
} else
|
||||
{
|
||||
CItemInstance *lpExistItem = g_ClientMain.m_csStatus.GetExchangeItem(ddItem);
|
||||
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack() && lpExistItem &&
|
||||
(dwInvenX == lpExistItem->m_lpItemBase->GetPos().GetXIndex() &&
|
||||
dwInvenY == lpExistItem->m_lpItemBase->GetPos().GetYIndex()) &&
|
||||
lpExistItem->GetProtoTypeID() == g_ClientMain.m_lpPickItem->GetProtoTypeID() &&
|
||||
lpExistItem->GetNowDurability() < lpExistItem->GetMaxDurability())
|
||||
{
|
||||
// 아이템을 스택한다.
|
||||
unsigned char cNum;
|
||||
if(lpExistItem->GetMaxDurability() - lpExistItem->GetNowDurability() < g_ClientMain.m_lpPickItem->GetNowDurability())
|
||||
{
|
||||
cNum = lpExistItem->GetMaxDurability() - lpExistItem->GetNowDurability();
|
||||
} else
|
||||
{
|
||||
cNum = g_ClientMain.m_lpPickItem->GetNowDurability();
|
||||
}
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
g_ClientMain.m_Network.SendTakeItem(g_ClientMain.m_lpPickItem, &pItemIndex, cNum);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 인벤토리 리스트에서 아이템을 찾는다.(완료)
|
||||
// 스왑하기
|
||||
CItemInstance *lpInvenItem = NULL;
|
||||
|
||||
if(g_ClientMain.m_lpPickItem->GetIsEnableStack() && g_ClientMain.m_lpPickItem->GetItemPos() != ClientSocket::ItemPos_Temp)
|
||||
lpInvenItem = g_ClientMain.m_csStatus.GetExchangeItem(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos());
|
||||
|
||||
if(!lpInvenItem)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_HOLD ||
|
||||
m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_UnLock);
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
g_ClientMain.m_Network.SendSwapItem(g_ClientMain.m_lpPickItem, &pItemIndex, lpExistItem);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanExchange::ShowWindow(BOOL bShow)
|
||||
{
|
||||
if(bShow)
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[6]->ShowButton(TRUE);
|
||||
|
||||
m_bSingleWindow = FALSE;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[1]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[2]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[3]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_NONE;
|
||||
} else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(FALSE);
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[1]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[2]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[3]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_NONE;
|
||||
|
||||
if(g_ClientMain.m_csStatus.m_lstExchange.size() || g_ClientMain.m_csStatus.m_dwExchangeGold || g_ClientMain.m_Network.m_nsNetworkState != NS_NOWAITING || g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_bShow = FALSE;
|
||||
m_bSingleWindow = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanExchange::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
RECT rcRect;
|
||||
|
||||
if(!m_bSingleWindow)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
CCreature *lpCreature = g_CharacterData.GetCreature(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID);
|
||||
if(lpCreature)
|
||||
{
|
||||
SetRect(&rcRect, 48 + m_rcWindowSize.left, 42 + m_rcWindowSize.top, 175 + m_rcWindowSize.left, 57 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(lpCreature->m_strName, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
SetRect(&rcRect, 51 + m_rcWindowSize.left, 188 + m_rcWindowSize.top, 178 + m_rcWindowSize.left, 203 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(g_TextEdit.MakePrintGold(g_ClientMain.m_csStatus.m_dwExchange2Gold), &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
SetRect(&rcRect, 48 + 222 + m_rcWindowSize.left, 42 + m_rcWindowSize.top, 175 + 222 + m_rcWindowSize.left, 57 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_csStatus.m_Info.Name, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
|
||||
SetRect(&rcRect, 51 + 222 + m_rcWindowSize.left, 188 + m_rcWindowSize.top, 178 + 222 + m_rcWindowSize.left, 203 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(g_TextEdit.MakePrintGold(g_ClientMain.m_csStatus.m_dwExchangeGold), &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
__int64 ddItem;
|
||||
|
||||
list<CItemInstance *>::iterator it;
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange.begin(); it != g_ClientMain.m_csStatus.m_lstExchange.end(); it++)
|
||||
{
|
||||
(*it)->Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
if(!m_bSingleWindow)
|
||||
{
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange2.begin(); it != g_ClientMain.m_csStatus.m_lstExchange2.end(); it++)
|
||||
{
|
||||
(*it)->Render(lpD3DDevice);
|
||||
}
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_lpPickItem && g_MessageBoxManager.m_lstMessageBox.empty())
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 230, m_rcWindowSize.top + 72, m_rcWindowSize.left + 437, m_rcWindowSize.top + 175)) // 인벤
|
||||
{
|
||||
Item::ItemPos pItemIndex;
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
pItemIndex.SetPos((ptMousePos->x - (m_rcWindowSize.left + 230)) / 26, (ptMousePos->y - (m_rcWindowSize.top + 72)) / 26, 0);
|
||||
|
||||
if((ddItem = g_ClientMain.m_csStatus.IsCheckItem(g_ClientMain.m_lpPickItem, 3, pItemIndex.GetXIndex(), pItemIndex.GetYIndex())) != ITEM_FAILED)
|
||||
{
|
||||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice,
|
||||
m_rcWindowSize.left + 230 + pItemIndex.GetXIndex() * 26,
|
||||
m_rcWindowSize.top + 72 + pItemIndex.GetYIndex() * 26,
|
||||
m_rcWindowSize.left + 230 + g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cXSize * 26 + pItemIndex.GetXIndex() * 26,
|
||||
m_rcWindowSize.top + 72 + g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cYSize * 26 + pItemIndex.GetYIndex() * 26,
|
||||
0xFF0000FF, 0x80);
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cXSize + pItemIndex.GetXIndex() < 8 &&
|
||||
g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cYSize + pItemIndex.GetYIndex() < 4)
|
||||
{
|
||||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice,
|
||||
m_rcWindowSize.left + 230 + pItemIndex.GetXIndex() * 26,
|
||||
m_rcWindowSize.top + 72 + pItemIndex.GetYIndex() * 26,
|
||||
m_rcWindowSize.left + 230 + g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cXSize * 26 + pItemIndex.GetXIndex() * 26,
|
||||
m_rcWindowSize.top + 72 + g_ClientMain.m_lpPickItem->GetItemInfo().m_DetailData.m_cYSize * 26 + pItemIndex.GetYIndex() * 26,
|
||||
0xFFFF0000, 0x80);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
BOOL CHumanExchange::SelectItem()
|
||||
{
|
||||
BOOL bPickItem = FALSE;
|
||||
const Item::ItemInfo *lpItemInfo;
|
||||
|
||||
list<CItemInstance *>::iterator it;
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange2.begin(); it != g_ClientMain.m_csStatus.m_lstExchange2.end(); it++)
|
||||
{
|
||||
lpItemInfo = &(*it)->GetItemInfo();
|
||||
|
||||
(*it)->m_wPutX = m_rcWindowSize.left + 8 + 26 * (*it)->m_lpItemBase->GetPos().GetXIndex() + (((lpItemInfo->m_DetailData.m_cXSize * 26 - 1) - (*it)->m_lpSprite->GetSizeX()) / 2);
|
||||
(*it)->m_wPutY = m_rcWindowSize.top + 72 + 26 * (*it)->m_lpItemBase->GetPos().GetYIndex() + (((lpItemInfo->m_DetailData.m_cYSize * 26 - 1) - (*it)->m_lpSprite->GetSizeY()) / 2);
|
||||
}
|
||||
|
||||
///// 인벤 아이템 업데이트 및 선택
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange.begin(); it != g_ClientMain.m_csStatus.m_lstExchange.end();)
|
||||
{
|
||||
lpItemInfo = &(*it)->GetItemInfo();
|
||||
|
||||
(*it)->m_wPutX = m_rcWindowSize.left + 230 + 26 * (*it)->m_lpItemBase->GetPos().GetXIndex() + (((lpItemInfo->m_DetailData.m_cXSize * 26 - 1) - (*it)->m_lpSprite->GetSizeX()) / 2);
|
||||
(*it)->m_wPutY = m_rcWindowSize.top + 72 + 26 * (*it)->m_lpItemBase->GetPos().GetYIndex() + (((lpItemInfo->m_DetailData.m_cYSize * 26 - 1) - (*it)->m_lpSprite->GetSizeY()) / 2);
|
||||
if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_NONE && g_ClientMain.m_dwKindCursor == CURSOR_NORMAL && !g_ClientMain.m_lpPickItem && g_DeviceInput.GetIsLeftMouseDown() && (*it)->IsOverMouse())
|
||||
{
|
||||
/* if((*it)->GetIsEnableStack() && g_DeviceInput.KeyHold(VK_SHIFT) && (*it)->m_lpItemBase->m_nNowDurability > 1)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_HOLD || m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Cancel);
|
||||
}
|
||||
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[127], MB_NUMBER | MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwSplitResult);
|
||||
lpMessageBox->SetValue(&m_dwSplitValue);
|
||||
g_TextEdit.SetFocus();
|
||||
|
||||
m_lpSplitItem = (*it);
|
||||
m_dwSplitResult = 0;
|
||||
m_dwSplitValue = 0;
|
||||
|
||||
it++;
|
||||
} else*/
|
||||
{
|
||||
g_ClientMain.SetPickItem((*it));
|
||||
g_ClientMain.m_csStatus.CheckExchangeField(0, g_ClientMain.m_lpPickItem);
|
||||
it = g_ClientMain.m_csStatus.m_lstExchange.erase(it);
|
||||
|
||||
bPickItem = TRUE;
|
||||
}
|
||||
} else
|
||||
{
|
||||
it++;
|
||||
}
|
||||
}
|
||||
|
||||
if(bPickItem)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void CHumanExchange::ExchangeAccept(unsigned long dwChrID)
|
||||
{
|
||||
if(dwChrID == g_ClientMain.m_dwMyChrID)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[2]->m_nState = BUTTON_HOLD;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_HOLD;
|
||||
|
||||
if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_HOLD)
|
||||
{
|
||||
g_ClientMain.m_Network.SendExchangeCmd(g_ClientMain.m_lpInterface->m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Exchange);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanExchange::ExchangeCancel(unsigned long dwChrID)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_NONE;
|
||||
m_ButtonManager.m_lstButton[2]->m_nState = BUTTON_NONE;
|
||||
}
|
||||
|
||||
void CHumanExchange::ExchangeQuit()
|
||||
{
|
||||
m_bSingleWindow = TRUE;
|
||||
|
||||
list<CItemInstance *>::iterator it;
|
||||
CItemInstance *lpItem;
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange2.begin(); it != g_ClientMain.m_csStatus.m_lstExchange2.end();)
|
||||
{
|
||||
lpItem = (*it);
|
||||
g_ClientMain.m_csStatus.CheckExchangeField(0, lpItem, FALSE);
|
||||
it = g_ClientMain.m_csStatus.m_lstExchange2.erase(it);
|
||||
delete lpItem;
|
||||
}
|
||||
g_ClientMain.m_csStatus.m_lstExchange2.clear();
|
||||
g_ClientMain.m_csStatus.m_Info.Gold += g_ClientMain.m_csStatus.m_dwExchangeGold;
|
||||
g_ClientMain.m_csStatus.m_dwExchangeGold = 0;
|
||||
g_ClientMain.m_csStatus.m_dwExchange2Gold = 0;
|
||||
|
||||
ShowWindow(FALSE);
|
||||
}
|
||||
|
||||
void CHumanExchange::ProcessExchange()
|
||||
{
|
||||
m_bSingleWindow = TRUE;
|
||||
g_ClientMain.m_csStatus.m_Info.Gold += g_ClientMain.m_csStatus.m_dwExchange2Gold;
|
||||
|
||||
list<CItemInstance *>::iterator it;
|
||||
CItemInstance *lpItem;
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange.begin(); it != g_ClientMain.m_csStatus.m_lstExchange.end();)
|
||||
{
|
||||
lpItem = (*it);
|
||||
g_ClientMain.m_csStatus.CheckExchangeField(0, lpItem);
|
||||
it = g_ClientMain.m_csStatus.m_lstExchange.erase(it);
|
||||
delete lpItem;
|
||||
}
|
||||
g_ClientMain.m_csStatus.m_lstExchange.clear();
|
||||
g_ClientMain.m_csStatus.m_dwExchangeGold = 0;
|
||||
|
||||
for(it = g_ClientMain.m_csStatus.m_lstExchange2.begin(); it != g_ClientMain.m_csStatus.m_lstExchange2.end();)
|
||||
{
|
||||
lpItem = (*it);
|
||||
g_ClientMain.m_csStatus.CheckExchangeField(0, lpItem, FALSE);
|
||||
g_ClientMain.m_csStatus.AddExchangeItem(lpItem);
|
||||
it = g_ClientMain.m_csStatus.m_lstExchange2.erase(it);
|
||||
}
|
||||
g_ClientMain.m_csStatus.m_lstExchange2.clear();
|
||||
g_ClientMain.m_csStatus.m_dwExchange2Gold = 0;
|
||||
|
||||
ShowWindow(FALSE);
|
||||
}
|
||||
|
||||
void CHumanExchange::InitPos(CItemInstance *lpItem)
|
||||
{
|
||||
const Item::ItemInfo *lpItemInfo = &lpItem->GetItemInfo();
|
||||
|
||||
lpItem->m_wPutX = m_rcWindowSize.left + 8 + 26 * lpItem->m_lpItemBase->GetPos().GetXIndex() + (((lpItemInfo->m_DetailData.m_cXSize * 26 - 1) - lpItem->m_lpSprite->GetSizeX()) / 2);
|
||||
lpItem->m_wPutY = m_rcWindowSize.top + 72 + 26 * lpItem->m_lpItemBase->GetPos().GetYIndex() + (((lpItemInfo->m_DetailData.m_cYSize * 26 - 1) - lpItem->m_lpSprite->GetSizeY()) / 2);
|
||||
}
|
||||
|
||||
void CHumanExchange::ExchangeLock(unsigned long dwChrID)
|
||||
{
|
||||
if(dwChrID == g_ClientMain.m_dwMyChrID)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_HOLD;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_HOLD;
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanExchange::ExchangeUnLock(unsigned long dwChrID)
|
||||
{
|
||||
if(dwChrID == g_ClientMain.m_dwMyChrID)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[6]->m_nState = BUTTON_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[5]->m_nState = BUTTON_NONE;
|
||||
}
|
||||
}
|
||||
42
GameTools/NeoRylClient/HumanExchange.h
Normal file
42
GameTools/NeoRylClient/HumanExchange.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// HumanExchange.h: interface for the CHumanExchange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANEXCHANGE_H__48C6072B_12C2_470C_84D5_3B8AAB0DBCEE__INCLUDED_)
|
||||
#define AFX_HUMANEXCHANGE_H__48C6072B_12C2_470C_84D5_3B8AAB0DBCEE__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanExchange : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
void ExchangeUnLock(unsigned long dwChrID);
|
||||
void ExchangeLock(unsigned long dwChrID);
|
||||
void InitPos(CItemInstance *lpItem);
|
||||
void ProcessExchange(void);
|
||||
void ExchangeQuit(void);
|
||||
void ExchangeCancel(unsigned long dwChrID);
|
||||
void ExchangeAccept(unsigned long dwChrID);
|
||||
CItemInstance *m_lpSplitItem;
|
||||
unsigned long m_dwSplitResult;
|
||||
unsigned long m_dwSplitValue;
|
||||
unsigned long m_dwExchangeGoldResult;
|
||||
unsigned long m_dwExchangeGoldValue;
|
||||
|
||||
BOOL m_bSingleWindow;
|
||||
BOOL SelectItem();
|
||||
CHumanExchange();
|
||||
virtual ~CHumanExchange();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANEXCHANGE_H__48C6072B_12C2_470C_84D5_3B8AAB0DBCEE__INCLUDED_)
|
||||
3657
GameTools/NeoRylClient/HumanGUI.cpp
Normal file
3657
GameTools/NeoRylClient/HumanGUI.cpp
Normal file
File diff suppressed because it is too large
Load Diff
52
GameTools/NeoRylClient/HumanGUI.h
Normal file
52
GameTools/NeoRylClient/HumanGUI.h
Normal file
@@ -0,0 +1,52 @@
|
||||
// HumanGUI.h: interface for the CHumanGUI class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANGUI_H__26B7EC09_31E0_4A87_A5D1_03AB1B6CF39A__INCLUDED_)
|
||||
#define AFX_HUMANGUI_H__26B7EC09_31E0_4A87_A5D1_03AB1B6CF39A__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "BaseGUI.h"
|
||||
|
||||
class CHumanGUI : public CBaseGUI
|
||||
{
|
||||
public:
|
||||
// unsigned long m_dwEnterGameStep;
|
||||
|
||||
unsigned long m_nPreSelectItem;
|
||||
CEffScript *m_pCastingEffect;
|
||||
CHumanGUI();
|
||||
virtual ~CHumanGUI();
|
||||
|
||||
BOOL InitChrSelect(void);
|
||||
void UpdateChrSelect(void);
|
||||
void RenderChrSelect(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
BOOL InitGame(void);
|
||||
void UpdateGame(void);
|
||||
void RenderGame(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
void InitTrade(unsigned long dwKindMarket, unsigned long dwNPCID);
|
||||
BOOL GetIsTrade(void);
|
||||
void InitClassChange(unsigned long dwNPCID);
|
||||
void ProcessExchangeCmd(unsigned long dwSenderID, unsigned short wCmd);
|
||||
void InitPos(CItemInstance *lpItem);
|
||||
BOOL GetIsExchange(void);
|
||||
// BOOL StartSkill(void);
|
||||
BOOL InitPopup(unsigned long dwKindPopup, unsigned long dwUID, unsigned long dwKindPos);
|
||||
void InitSkillUnLock(unsigned long dwNPCID);
|
||||
void InitChannel(unsigned char cChannelNum, unsigned short *lpChannel);
|
||||
void InitRespawn(unsigned char cZoneNum);
|
||||
BOOL GetIsRespawn(void);
|
||||
void DestroyRespawn(void);
|
||||
BOOL GetEnableChat(void);
|
||||
void InitDeposit(void);
|
||||
void ShowWindow(unsigned long dwWindowNum);
|
||||
BOOL GetBusy(void);
|
||||
BOOL GetIsBlackMarket(void);
|
||||
void InitStreetStall(unsigned long dwChrID, char *lpstrStreetName);
|
||||
void InitQuest(unsigned long dwChrID, unsigned long dwQuestID);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANGUI_H__26B7EC09_31E0_4A87_A5D1_03AB1B6CF39A__INCLUDED_)
|
||||
1607
GameTools/NeoRylClient/HumanInven.cpp
Normal file
1607
GameTools/NeoRylClient/HumanInven.cpp
Normal file
File diff suppressed because it is too large
Load Diff
39
GameTools/NeoRylClient/HumanInven.h
Normal file
39
GameTools/NeoRylClient/HumanInven.h
Normal file
@@ -0,0 +1,39 @@
|
||||
// HumanInven.h: interface for the CHumanInven class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANINVEN_H__B093BE41_55B8_414D_B14E_23B4770AB81B__INCLUDED_)
|
||||
#define AFX_HUMANINVEN_H__B093BE41_55B8_414D_B14E_23B4770AB81B__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
#include "ItemInstance.h" // Added by ClassView
|
||||
|
||||
class CHumanInven : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
BOOL UsePotion(CItemInstance *lpItem);
|
||||
BOOL SelectItem();
|
||||
BOOL UseSkillBook(CItemInstance *lpItem);
|
||||
CItemInstance *m_lpRepairItem;
|
||||
CItemInstance *m_lpSplitItem;
|
||||
unsigned long m_dwRepairResult;
|
||||
unsigned long m_dwSplitResult;
|
||||
unsigned long m_dwSplitValue;
|
||||
unsigned long m_dwBodyInven;
|
||||
unsigned long m_dwBackInven;
|
||||
|
||||
CHumanInven();
|
||||
~CHumanInven();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANINVEN_H__B093BE41_55B8_414D_B14E_23B4770AB81B__INCLUDED_)
|
||||
328
GameTools/NeoRylClient/HumanJobChange.cpp
Normal file
328
GameTools/NeoRylClient/HumanJobChange.cpp
Normal file
@@ -0,0 +1,328 @@
|
||||
// HumanJobChange.cpp: implementation of the CHumanJobChange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "HumanJobChange.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUIMessageBox.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanJobChange::CHumanJobChange()
|
||||
{
|
||||
}
|
||||
|
||||
CHumanJobChange::~CHumanJobChange()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanJobChange::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[35]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y, 0, 0, 78, 256, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 256, 160, g_ClientMain.m_lpInterface->m_lstTexture[37]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y + 256, 0, 0, 78, 160, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[175]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[176]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 52, 201, 72, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 52, 201, 72, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[177]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 78, 201, 98, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 78, 201, 98, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[178]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 104, 201, 124, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 104, 201, 124, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[179]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 130, 201, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 130, 201, 150, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[180]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 156, 201, 176, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 156, 201, 176, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[181]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 182, 201, 202, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 182, 201, 202, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[182]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(281, 355, 221, 126, 234, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(281, 355, 234, 126, 247, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[183]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(299, 355, 221, 138, 234, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(299, 355, 234, 138, 247, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[184]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 334; m_rcWindowSize.bottom = y + 416;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 334; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanJobChange::InitValue(void)
|
||||
{
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[i]->ShowButton(FALSE);
|
||||
}
|
||||
|
||||
switch(g_ClientMain.m_csStatus.m_Info.Class)
|
||||
{
|
||||
case 1:
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
m_ButtonManager.m_lstButton[4]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[5]->ShowButton(TRUE);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
m_ButtonManager.m_lstButton[6]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[7]->ShowButton(TRUE);
|
||||
break;
|
||||
}
|
||||
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
}
|
||||
|
||||
BOOL CHumanJobChange::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
unsigned long dwMousePosX = ptMousePos->x - (m_rcWindowSize.left + 18);
|
||||
unsigned long dwMousePosY = ptMousePos->y - (m_rcWindowSize.top + 286);
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_dwChangeResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_UPGRADECLASS;
|
||||
g_ClientMain.m_Network.m_pSocket->CharClassUpgrade(g_ClientMain.m_dwMyChrID, m_wClassChange);
|
||||
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
ShowWindow(FALSE);
|
||||
return TRUE;
|
||||
} else if(m_dwChangeResult & MB_NO || m_dwChangeResult & MB_EXIT)
|
||||
{
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
char strText[MAX_PATH];
|
||||
CGUIMessageBox *lpMessageBox = new CGUIMessageBox;
|
||||
sprintf(strText, g_StringTable.m_strString[185], g_ClientMain.m_lpCommonInterface->GetClassName(5 + i));
|
||||
lpMessageBox->Create(strText, MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwChangeResult);
|
||||
m_dwChangeResult = 0;
|
||||
m_wClassChange = 5 + i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanJobChange::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[i]->ShowButton(bShow);
|
||||
}
|
||||
|
||||
if(bShow == FALSE)
|
||||
{
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanJobChange::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
|
||||
RECT rect;
|
||||
for(int i = 0; i < m_lstMessage.size(); i++)
|
||||
{
|
||||
rect.left = m_rcWindowSize.left + 14;
|
||||
rect.top = m_rcWindowSize.top + 20 + i * 16;
|
||||
rect.right = rect.left + 304;
|
||||
rect.bottom = rect.top + 16;
|
||||
|
||||
g_TextEdit.DrawText(m_lstMessage[i]->strMessage, &rect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanJobChange::SetText(const char *strMessage)
|
||||
{
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
|
||||
char *strMessageTemp, *token, seps[] = "\\n";
|
||||
strMessageTemp = new char[strlen(strMessage) + 100];
|
||||
strcpy(strMessageTemp, strMessage);
|
||||
token = strtok(strMessageTemp, seps);
|
||||
|
||||
while(token != NULL)
|
||||
{
|
||||
lpMessage = new Message;
|
||||
strcpy(lpMessage->strMessage, token);
|
||||
m_lstMessage.push_back(lpMessage);
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
}
|
||||
|
||||
delete[] strMessageTemp;
|
||||
}
|
||||
41
GameTools/NeoRylClient/HumanJobChange.h
Normal file
41
GameTools/NeoRylClient/HumanJobChange.h
Normal file
@@ -0,0 +1,41 @@
|
||||
// HumanJobChange.h: interface for the CHumanJobChange class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANJOBCHANGE_H__FDCA6C54_B33A_4432_8433_5E54A8212ED3__INCLUDED_)
|
||||
#define AFX_HUMANJOBCHANGE_H__FDCA6C54_B33A_4432_8433_5E54A8212ED3__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CHumanJobChange : public CGUIWindow
|
||||
{
|
||||
typedef struct Message
|
||||
{
|
||||
char strMessage[MAX_PATH];
|
||||
} Message, *LPMessage;
|
||||
|
||||
public:
|
||||
void SetText(const char *strMessage);
|
||||
vector<LPMessage> m_lstMessage;
|
||||
|
||||
unsigned long m_dwChangeResult;
|
||||
unsigned short m_wClassChange;
|
||||
|
||||
CHumanJobChange();
|
||||
~CHumanJobChange();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANJOBCHANGE_H__FDCA6C54_B33A_4432_8433_5E54A8212ED3__INCLUDED_)
|
||||
229
GameTools/NeoRylClient/HumanMiniStates.cpp
Normal file
229
GameTools/NeoRylClient/HumanMiniStates.cpp
Normal file
@@ -0,0 +1,229 @@
|
||||
// HumanMiniStates.cpp: implementation of the CHumanMiniStates class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "HumanMiniStates.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanMiniStates::CHumanMiniStates()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanMiniStates::~CHumanMiniStates()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanMiniStates::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 150, 120, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(7, 51, 154, 2, 254, 11, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(7, 71, 154, 14, 254, 23, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(7, 91, 4, 123, 141, 126, g_ClientMain.m_lpInterface->m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUITooltipButton *lpTooltip;
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[190]);
|
||||
lpTooltip->SetRect(6, 7, 93, 23);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[191]);
|
||||
lpTooltip->SetRect(6, 27, 93, 43);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[192]);
|
||||
lpTooltip->SetRect(118, 27, 144, 43);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[193]);
|
||||
lpTooltip->SetRect(7, 51, 107, 60);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[194]);
|
||||
lpTooltip->SetRect(7, 71, 107, 80);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[195]);
|
||||
lpTooltip->SetRect(7, 91, 144, 94);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[196]);
|
||||
lpTooltip->SetRect(35, 99, 71,115);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[197]);
|
||||
lpTooltip->SetRect(108, 99, 144, 115);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 150; m_rcWindowSize.bottom = y + 120;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 150; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanMiniStates::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
if(m_dwWindowKind == WINDOW_FLOAT)
|
||||
{
|
||||
if(WindowMoving(*ptMousePos))
|
||||
{
|
||||
m_lstSprite[0]->SetPosition(m_ptWindowMovePos.x, m_ptWindowMovePos.y);
|
||||
}
|
||||
}
|
||||
|
||||
char strString[MAX_PATH];
|
||||
|
||||
sprintf(strString, "%d / %d", g_ClientMain.m_csStatus.m_Info.HP, g_ClientMain.m_csStatus.m_MaxHP + g_ClientMain.m_csStatus.m_lAddMaxHP);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[3])->InitTooltip(strString);
|
||||
m_lstSprite[1]->SetRate((float)g_ClientMain.m_csStatus.m_Info.HP / (float)(g_ClientMain.m_csStatus.m_MaxHP + g_ClientMain.m_csStatus.m_lAddMaxHP));
|
||||
|
||||
sprintf(strString, "%d / %d", g_ClientMain.m_csStatus.m_Info.MP, g_ClientMain.m_csStatus.m_MaxMP + g_ClientMain.m_csStatus.m_lAddMaxMP);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[4])->InitTooltip(strString);
|
||||
m_lstSprite[2]->SetRate((float)g_ClientMain.m_csStatus.m_Info.MP / (float)(g_ClientMain.m_csStatus.m_MaxMP + g_ClientMain.m_csStatus.m_lAddMaxMP));
|
||||
|
||||
unsigned long dwExp, dwExpMax;
|
||||
char strExp[2], strExpMax[2];
|
||||
if(1000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000;
|
||||
strcpy(strExp, "K");
|
||||
} else if(1000000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000000;
|
||||
strcpy(strExp, "M");
|
||||
} else if(1000000000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000000000;
|
||||
strcpy(strExp, "T");
|
||||
} else
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp;
|
||||
strcpy(strExp, "");
|
||||
}
|
||||
if(1000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000;
|
||||
strcpy(strExpMax, "K");
|
||||
} else if(1000000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000000;
|
||||
strcpy(strExpMax, "M");
|
||||
} else if(1000000000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000000000;
|
||||
strcpy(strExpMax, "T");
|
||||
} else
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax;
|
||||
strcpy(strExpMax, "");
|
||||
}
|
||||
sprintf(strString, "%d%s / %d%s", dwExp, strExp, dwExpMax, strExpMax);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[5])->InitTooltip(strString);
|
||||
m_lstSprite[3]->SetRate((float)g_ClientMain.m_csStatus.m_Info.Exp / (float)g_ClientMain.m_csStatus.m_llExpMax);
|
||||
|
||||
m_TooltipManager.Update(m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanMiniStates::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
RECT rcRect;
|
||||
char strString[MAX_PATH];
|
||||
SetRect(&rcRect, 6 + m_rcWindowSize.left, 7 + m_rcWindowSize.top, 93 + m_rcWindowSize.left, 23 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_csStatus.m_Info.Name, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
SetRect(&rcRect, 6 + m_rcWindowSize.left, 27 + m_rcWindowSize.top, 93 + m_rcWindowSize.left, 43 + m_rcWindowSize.top);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_lpCommonInterface->GetClassName(g_ClientMain.m_csStatus.m_Info.Class), &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
SetRect(&rcRect, 118 + m_rcWindowSize.left, 29 + m_rcWindowSize.top, 144 + m_rcWindowSize.left, 43 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Info.Level);
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
SetRect(&rcRect, 112 + m_rcWindowSize.left, 49 + m_rcWindowSize.top, 144 + m_rcWindowSize.left, 63 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Info.HP);
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
SetRect(&rcRect, 112 + m_rcWindowSize.left, 69 + m_rcWindowSize.top, 144 + m_rcWindowSize.left, 83 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Info.MP);
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
SetRect(&rcRect, 35 + m_rcWindowSize.left, 101 + m_rcWindowSize.top, 71 + m_rcWindowSize.left, 115 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_lMinDamage + (g_ClientMain.m_csStatus.m_lMaxDamage - g_ClientMain.m_csStatus.m_lMinDamage) / 2);
|
||||
long m_lDamage = g_ClientMain.m_csStatus.m_lMinDamage + (g_ClientMain.m_csStatus.m_lMaxDamage - g_ClientMain.m_csStatus.m_lMinDamage) / 2;
|
||||
long m_lRealDamage = g_ClientMain.m_csStatus.m_lRealMinDamage + (g_ClientMain.m_csStatus.m_lRealMaxDamage - g_ClientMain.m_csStatus.m_lRealMinDamage) / 2;
|
||||
if(m_lDamage < m_lRealDamage)
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 0, 0, m_cAlpha));
|
||||
} else if(m_lDamage > m_lRealDamage)
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(0, 255, 0, m_cAlpha));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
}
|
||||
|
||||
SetRect(&rcRect, 108 + m_rcWindowSize.left, 101 + m_rcWindowSize.top, 144 + m_rcWindowSize.left, 115 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_lDefensePower);
|
||||
if(g_ClientMain.m_csStatus.m_lDefensePower < g_ClientMain.m_csStatus.m_lRealDefensePower)
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 0, 0, m_cAlpha));
|
||||
} else if(g_ClientMain.m_csStatus.m_lDefensePower > g_ClientMain.m_csStatus.m_lRealDefensePower)
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(0, 255, 0, m_cAlpha));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
}
|
||||
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha, m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
m_lstSprite[2]->Render(lpD3DDevice, m_cAlpha, m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
m_lstSprite[3]->Render(lpD3DDevice, m_cAlpha, m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
}
|
||||
27
GameTools/NeoRylClient/HumanMiniStates.h
Normal file
27
GameTools/NeoRylClient/HumanMiniStates.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanMiniStates.h: interface for the CHumanMiniStates class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANMINISTATES_H__04FE88AD_4ED0_4FDD_A102_07BC664F05A8__INCLUDED_)
|
||||
#define AFX_HUMANMINISTATES_H__04FE88AD_4ED0_4FDD_A102_07BC664F05A8__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanMiniStates : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanMiniStates();
|
||||
~CHumanMiniStates();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void) { }
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANMINISTATES_H__04FE88AD_4ED0_4FDD_A102_07BC664F05A8__INCLUDED_)
|
||||
872
GameTools/NeoRylClient/HumanMinimap.cpp
Normal file
872
GameTools/NeoRylClient/HumanMinimap.cpp
Normal file
@@ -0,0 +1,872 @@
|
||||
// HumanMinimap.cpp: implementation of the CHumanMinimap class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "HumanMinimap.h"
|
||||
|
||||
#include "Creature\NPC\NPCList.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanMinimap::CHumanMinimap()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanMinimap::~CHumanMinimap()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanMinimap::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 123, 0, 206, 104, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 83, y, 105, 0, 121, 104, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 38, y + 102, 40, 156, 78, 183, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 221, 104, 238, 171, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 자신 표시 : 4
|
||||
lpSprite->Create(43 - 5, 43 - 7, 188, 136, 199, 152, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // PC 표시 : 5
|
||||
lpSprite->Create(0, 0, 132, 156, 139, 163, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // NPC 표시 : 6
|
||||
lpSprite->Create(0, 0, 121, 156, 128, 163, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // MONSTER 표시 : 7
|
||||
lpSprite->Create(0, 0, 143, 156, 150, 163, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 파티원 표시 : 8
|
||||
lpSprite->Create(0, 0, 154, 156, 161, 163, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 퀘스트 표시 : 9
|
||||
lpSprite->Create(0, 0, 121, 135, 139, 152, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 퀘스트 표시 : 10
|
||||
lpSprite->Create(0, 0, 143, 135, 161, 152, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 퀘스트 표시 : 11
|
||||
lpSprite->Create(0, 0, 165, 135, 183, 152, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 듀얼 상대 표시 : 12
|
||||
lpSprite->Create(0, 0, 165, 156, 172, 163, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기상인 : 13
|
||||
lpSprite->Create(0, 0, 121, 165, 133, 177, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어구상인 : 14
|
||||
lpSprite->Create(0, 0, 133, 165, 145, 177, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 잡화상인 : 15
|
||||
lpSprite->Create(0, 0, 145, 165, 157, 177, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 트레이너 : 16
|
||||
lpSprite->Create(0, 0, 157, 165, 169, 177, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 순간이동술사 : 17
|
||||
lpSprite->Create(0, 0, 169, 165, 181, 177, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 대장장이 : 18
|
||||
lpSprite->Create(0, 0, 158, 120, 170, 132, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 창고 : 19
|
||||
lpSprite->Create(0, 0, 170, 120, 182, 132, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 아카데미 : 20
|
||||
lpSprite->Create(0, 0, 182, 120, 194, 132, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 무기암시장 : 21
|
||||
lpSprite->Create(0, 0, 194, 120, 206, 132, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 방어구암시장 : 22
|
||||
lpSprite->Create(0, 0, 206, 120, 218, 132, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 적 종족 표시 : 23
|
||||
lpSprite->Create(0, 0, 174, 157, 179, 162, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // 반전단체 : 24
|
||||
lpSprite->Create(0, 0, 206, 132, 218, 144, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(x + 84, y + 34, 105, 104, 118, 125, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(x + 84, y + 34, 118, 104, 131, 125, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[186]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(x + 1, y + 34, 131, 104, 144, 125, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(x + 1, y + 34, 144, 104, 157, 125, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[187]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(x + 83, y + 62, 157, 104, 173, 119, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(x + 83, y + 62, 173, 104, 189, 119, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[188]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(x + 83, y + 85, 189, 104, 205, 119, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(x + 83, y + 85, 205, 104, 221, 119, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[189]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 100; m_rcWindowSize.bottom = y + 104;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 100; m_rcMoveEdge.bottom = y + 104;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanMinimap::InitValue(void)
|
||||
{
|
||||
m_MiniMapSize = 256;
|
||||
m_bFullSize = TRUE;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
}
|
||||
|
||||
BOOL CHumanMinimap::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_bFullSize = FALSE;
|
||||
|
||||
m_rcWindowSize.right = m_rcWindowSize.left + 16;
|
||||
m_rcWindowSize.bottom = m_rcWindowSize.top + 66;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(FALSE);
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_bFullSize = TRUE;
|
||||
|
||||
m_rcWindowSize.right = m_rcWindowSize.left + 100;
|
||||
m_rcWindowSize.bottom = m_rcWindowSize.top + 104;
|
||||
|
||||
m_ButtonManager.m_lstButton[0]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[2]->ShowButton(TRUE);
|
||||
m_ButtonManager.m_lstButton[3]->ShowButton(TRUE);
|
||||
} else if(!g_TextEdit.IsFocus() && (m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_PRESS || g_DeviceInput.KeyHold(VK_ADD)))
|
||||
{
|
||||
m_MiniMapSize += 20;
|
||||
if(m_MiniMapSize > 512) m_MiniMapSize = 512;
|
||||
} else if(!g_TextEdit.IsFocus() && (m_ButtonManager.m_lstButton[3]->m_nState == BUTTON_PRESS || g_DeviceInput.KeyHold(VK_SUBTRACT)))
|
||||
{
|
||||
m_MiniMapSize -= 20;
|
||||
if(m_MiniMapSize < 128) m_MiniMapSize = 128;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanMinimap::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(!m_bFullSize)
|
||||
{
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int nChrPosX = (g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x / SECTORSIZE);
|
||||
int nChrPosZ = (g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z / SECTORSIZE);
|
||||
int nMoveX = ((g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x - (nChrPosX * SECTORSIZE)) / SECTORSIZE) * m_MiniMapSize;
|
||||
int nMoveZ = ((g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z - (nChrPosZ * SECTORSIZE)) / SECTORSIZE) * m_MiniMapSize;
|
||||
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 지도 텍스쳐 부르기
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
FILE *fp = NULL;
|
||||
|
||||
char strMiniMapFileName[MAX_PATH];
|
||||
|
||||
sprintf(strMiniMapFileName, "%d_%d", nChrPosX, nChrPosZ);
|
||||
|
||||
if(strstr(m_MiniMapTexture[4].m_strName, strMiniMapFileName) == NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[4].GetTexture())
|
||||
m_MiniMapTexture[4].Unload();
|
||||
|
||||
sprintf(strMiniMapFileName, "%s\\%d_%d_detail.dds", WIDETEXTUREPATH, nChrPosX, nChrPosZ);
|
||||
if((fp = fopen(strMiniMapFileName, "rb")) == NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName, "%s\\%d_%d.dds", WIDETEXTUREPATH, nChrPosX, nChrPosZ);
|
||||
fp = fopen(strMiniMapFileName, "rb");
|
||||
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName, "%d_%d.dds", nChrPosX, nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[4].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[4].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName, "%d_%d_detail.dds", nChrPosX, nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[4].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(strMiniMapFileName, "%d_%d", nChrPosX - 1, nChrPosZ + 1);
|
||||
if(strstr(m_MiniMapTexture[0].m_strName, strMiniMapFileName) == NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[0].GetTexture())
|
||||
m_MiniMapTexture[0].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ+1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if((fp)==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ+1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX-1,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[0].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[0].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX-1,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[0].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
sprintf(strMiniMapFileName,"%d_%d",nChrPosX,nChrPosZ+1);
|
||||
if(strstr(m_MiniMapTexture[1].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[1].GetTexture())
|
||||
m_MiniMapTexture[1].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX,nChrPosZ+1);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX,nChrPosZ+1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[1].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[1].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[1].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ+1);
|
||||
if(strstr(m_MiniMapTexture[2].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[2].GetTexture())
|
||||
m_MiniMapTexture[2].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ+1);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ+1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[2].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[2].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX+1,nChrPosZ+1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[2].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX-1,nChrPosZ);
|
||||
if(strstr(m_MiniMapTexture[3].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[3].GetTexture())
|
||||
m_MiniMapTexture[3].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX-1,nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[3].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[3].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX-1,nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[3].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ);
|
||||
if(strstr(m_MiniMapTexture[5].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[5].GetTexture())
|
||||
m_MiniMapTexture[5].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[5].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[5].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX+1,nChrPosZ);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[5].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX-1,nChrPosZ-1);
|
||||
if(strstr(m_MiniMapTexture[6].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[6].GetTexture())
|
||||
m_MiniMapTexture[6].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ-1);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX-1,nChrPosZ-1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX-1,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[6].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[6].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX-1,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[6].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX,nChrPosZ-1);
|
||||
if(strstr(m_MiniMapTexture[7].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[7].GetTexture())
|
||||
m_MiniMapTexture[7].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX,nChrPosZ-1);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX,nChrPosZ-1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[7].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[7].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[7].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ-1);
|
||||
if(strstr(m_MiniMapTexture[8].m_strName,strMiniMapFileName)==NULL)
|
||||
{
|
||||
if(m_MiniMapTexture[8].GetTexture())
|
||||
m_MiniMapTexture[8].Unload();
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d_detail.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ-1);
|
||||
if((fp=fopen(strMiniMapFileName,"rb"))==NULL)
|
||||
{
|
||||
sprintf(strMiniMapFileName,"%s\\%d_%d.dds",WIDETEXTUREPATH,nChrPosX+1,nChrPosZ-1);
|
||||
fp=fopen(strMiniMapFileName,"rb");
|
||||
if(fp)
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d.dds",nChrPosX+1,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[8].Load(strMiniMapFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
m_MiniMapTexture[8].Load("hig1.dds");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fclose(fp);
|
||||
sprintf(strMiniMapFileName,"%d_%d_detail.dds",nChrPosX+1,nChrPosZ-1);
|
||||
CTexture::SetPath(WIDETEXTUREPATH);
|
||||
m_MiniMapTexture[8].Load(strMiniMapFileName);
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TLVertex2 Vertex[4];
|
||||
Vertex[0].Diffuse.c = Vertex[1].Diffuse.c = Vertex[2].Diffuse.c = Vertex[3].Diffuse.c = 0xffffffff;
|
||||
Vertex[0].Specular.c = Vertex[1].Specular.c = Vertex[2].Specular.c = Vertex[3].Specular.c = 0;
|
||||
Vertex[0].w = Vertex[1].w = Vertex[2].w = Vertex[3].w = 0.1f;
|
||||
Vertex[0].v.z = Vertex[1].v.z = Vertex[2].v.z = Vertex[3].v.z = 0.1f;
|
||||
|
||||
float fCenterX = Vertex[0].v.x = Vertex[1].v.x = 0 - nMoveX + 43;
|
||||
Vertex[2].v.x = Vertex[3].v.x = m_MiniMapSize - nMoveX + 43;
|
||||
float fCenterZ = Vertex[0].v.y = Vertex[2].v.y = 0 + nMoveZ - m_MiniMapSize + 43;
|
||||
Vertex[1].v.y = Vertex[3].v.y = m_MiniMapSize + nMoveZ - m_MiniMapSize + 43;
|
||||
|
||||
Vertex[0].tu1 = Vertex[1].tu1 = 0.0f + 0.5f / (float)m_MiniMapSize;
|
||||
Vertex[2].tu1 = Vertex[3].tu1 = 1.0f - 0.5f / (float)m_MiniMapSize;
|
||||
|
||||
Vertex[0].tv1 = Vertex[2].tv1 = 1.0f - 0.5f / (float)m_MiniMapSize;
|
||||
Vertex[1].tv1 = Vertex[3].tv1 = 0.0f + 0.5f / (float)m_MiniMapSize;
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(0, g_ClientMain.m_lpInterface->m_lstTexture[27]->GetTexture());
|
||||
lpD3DDevice->SetTexture(1, m_MiniMapTexture[4].GetTexture());
|
||||
|
||||
lpD3DDevice->SetVertexShader(TLVERTEX2FVF);
|
||||
lpD3DDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 1);
|
||||
|
||||
lpD3DDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
lpD3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
|
||||
lpD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
|
||||
lpD3DDevice->SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
|
||||
|
||||
lpD3DDevice->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
|
||||
lpD3DDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
|
||||
|
||||
lpD3DDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG2);
|
||||
lpD3DDevice->SetTextureStageState( 1, D3DTSS_ALPHAARG2, D3DTA_CURRENT );
|
||||
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, Vertex, sizeof(TLVertex2));
|
||||
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_DIFFUSE);
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
|
||||
|
||||
//0
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX-m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ-m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1, m_MiniMapTexture[0].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, Vertex, sizeof(TLVertex2));
|
||||
//1
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX+m_MiniMapSize;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ-m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[1].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
//2
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX+m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX+m_MiniMapSize*2;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ-m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[2].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
//3
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX-m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ+m_MiniMapSize;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[3].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
//5
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX+m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX+m_MiniMapSize*2;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ+m_MiniMapSize;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[5].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
|
||||
//6
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX-m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ+m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ+m_MiniMapSize*2;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[6].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
|
||||
//7
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX+m_MiniMapSize;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ+m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ+m_MiniMapSize*2;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[7].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
|
||||
//8
|
||||
Vertex[0].v.x=Vertex[1].v.x=fCenterX+m_MiniMapSize;
|
||||
Vertex[2].v.x=Vertex[3].v.x=fCenterX+m_MiniMapSize*2;
|
||||
Vertex[0].v.y=Vertex[2].v.y=fCenterZ+m_MiniMapSize;
|
||||
Vertex[1].v.y=Vertex[3].v.y=fCenterZ+m_MiniMapSize*2;
|
||||
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
Vertex[i].tu = Vertex[i].v.x / (float)128;
|
||||
Vertex[i].tv = Vertex[i].v.y / (float)128;
|
||||
}
|
||||
lpD3DDevice->SetTexture(1,m_MiniMapTexture[8].GetTexture());
|
||||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,Vertex,sizeof(TLVertex2));
|
||||
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
|
||||
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
|
||||
lpD3DDevice->SetTexture(1, NULL);
|
||||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CenterX,CenterY;
|
||||
CenterX = 43;
|
||||
CenterY = 43;
|
||||
float PixelPerMeter = ((float)m_MiniMapSize/SECTORSIZE);
|
||||
|
||||
vector3 vecPos, vecSelfPos = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
|
||||
|
||||
RECT rcRect, rcMapSize;
|
||||
SetRect(&rcMapSize, m_rcWindowSize.left + 2, m_rcWindowSize.top + 1, m_rcWindowSize.left + 83, m_rcWindowSize.top + 85);
|
||||
|
||||
vecSelfPos.y = 0.0f;
|
||||
|
||||
/* for(int asd = 0; asd < 36; asd++)
|
||||
{
|
||||
m_SpriteList[m_BarEnemy].m_PutY = CenterY - 5 - 56 * cosf(FLOAT_DEG(asd * 10.0f));
|
||||
m_SpriteList[m_BarEnemy].m_PutX = CenterX - 5 + 56 * sinf(FLOAT_DEG(asd * 10.0f));
|
||||
RenderSprite(m_BarEnemy, lpD3DDevice);
|
||||
}*/
|
||||
|
||||
int nPosX, nPosY;
|
||||
for(i = 0; i < g_CharacterData.m_lstCharData.num; i++)
|
||||
{
|
||||
if(i == g_CharacterData.m_nFocusCharacter) continue;
|
||||
// if(g_CharacterData.m_lstCharData[i]->m_bUsed == FALSE) continue;
|
||||
|
||||
// if(g_CharacterData.m_lstCharData[i]->m_lpChrModel)
|
||||
{
|
||||
vecPos = g_CharacterData.m_lstCharData[i]->m_vecPos;
|
||||
vecPos.y = 0.0f;
|
||||
vecPos = vecPos - vecSelfPos;
|
||||
vecPos.x *= PixelPerMeter;
|
||||
vecPos.z *= PixelPerMeter;
|
||||
|
||||
nPosX = CenterX - 2 + vecPos.x;
|
||||
nPosY = CenterY - 2 - vecPos.z;
|
||||
|
||||
if(rcMapSize.left <= nPosX && nPosX <= rcMapSize.right && rcMapSize.top <= nPosY && nPosY <= rcMapSize.bottom)
|
||||
{
|
||||
switch(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID, TRUE))
|
||||
{
|
||||
case CT_NPC:
|
||||
{
|
||||
LPNPCNode lpNode = g_NPCList.GetNPCNode(g_CharacterData.m_lstCharData[i]->m_dwChrID);
|
||||
if(lpNode)
|
||||
{
|
||||
switch(lpNode->m_dwJob)
|
||||
{
|
||||
case POPUP_WEAPONMERCHANT:
|
||||
case POPUP_A_WEAPONMERCHANT:
|
||||
m_lstSprite[13]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_DARKWEAPONMERCHANT:
|
||||
case POPUP_A_DARKWEAPONMERCHANT:
|
||||
m_lstSprite[21]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_ARMOURMERCHANT:
|
||||
case POPUP_A_ARMOURMERCHANT:
|
||||
m_lstSprite[14]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_DARKARMOURMERCHANT:
|
||||
case POPUP_A_DARKARMOURMERCHANT:
|
||||
m_lstSprite[22]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_ETCMERCHANT:
|
||||
case POPUP_A_ETCMERCHANT:
|
||||
case POPUP_DARKETCMERCHANT:
|
||||
case POPUP_A_DARKETCMERCHANT:
|
||||
m_lstSprite[15]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_ADVENTURETRAINER:
|
||||
case POPUP_FIGHTERTRAINER:
|
||||
case POPUP_ROGUETRAINER:
|
||||
case POPUP_MAGETRAINER:
|
||||
case POPUP_ACOLYTETRAINER:
|
||||
case POPUP_A_BEGINNERTRAINER:
|
||||
case POPUP_A_COMBATANTTRAINER:
|
||||
case POPUP_A_OPPICATERTRAINER:
|
||||
m_lstSprite[16]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_TELEPORTER:
|
||||
case POPUP_A_TELEPORTER:
|
||||
m_lstSprite[17]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_CONTAINER:
|
||||
case POPUP_A_CONTAINER:
|
||||
m_lstSprite[19]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
case POPUP_PEACEGUILD:
|
||||
case POPUP_A_PEACEGUILD:
|
||||
m_lstSprite[24]->Render(lpD3DDevice, 0xFF, nPosX - 3, nPosY - 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
m_lstSprite[6]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CT_MONSTER:
|
||||
if(!g_CharacterData.m_lstCharData[i]->GetChantFlag(17))
|
||||
{
|
||||
if(g_CharacterData.GetIsDuelTarget(g_CharacterData.m_lstCharData[i]->m_dwChrID))
|
||||
m_lstSprite[12]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
else if(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID) == CT_PC)
|
||||
m_lstSprite[23]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
else
|
||||
m_lstSprite[7]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
}
|
||||
break;
|
||||
|
||||
case CT_PC:
|
||||
// 파티일때 파티로 뿌리기
|
||||
if(g_ClientMain.m_csStatus.CheckPartyMember(g_CharacterData.m_lstCharData[i]->m_dwChrID))
|
||||
m_lstSprite[8]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
else
|
||||
m_lstSprite[5]->Render(lpD3DDevice, 0xFF, nPosX, nPosY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_lstSprite[4]->Render(lpD3DDevice, g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_fDirection + FLOAT_PHI, 128);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
|
||||
char temp[50];
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 12, m_rcWindowSize.top + 88, m_rcWindowSize.left + 71, m_rcWindowSize.top + 99);
|
||||
// sprintf(temp, "%f, %f, %f, %f", (vecSelfPos.x / 100.0f), (vecSelfPos.y / 100.0f), (vecSelfPos.z / 100.0f), CCharacterData::m_CharDataSetList[0]->m_pChrmodel->GetDirection() + 3.14159f);
|
||||
sprintf(temp, "%d, %d", (long)(vecSelfPos.x / 100.0f), (long)(vecSelfPos.z / 100.0f));
|
||||
g_TextEdit.DrawText(temp, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
31
GameTools/NeoRylClient/HumanMinimap.h
Normal file
31
GameTools/NeoRylClient/HumanMinimap.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// HumanMinimap.h: interface for the CHumanMinimap class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANMINIMAP_H__CFF16F30_64EF_4F11_A8CB_FCAF748DDE98__INCLUDED_)
|
||||
#define AFX_HUMANMINIMAP_H__CFF16F30_64EF_4F11_A8CB_FCAF748DDE98__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanMinimap : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanMinimap();
|
||||
~CHumanMinimap();
|
||||
|
||||
CTexture m_MiniMapTexture[9];
|
||||
int m_MiniMapSize;
|
||||
BOOL m_bFullSize;
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANMINIMAP_H__CFF16F30_64EF_4F11_A8CB_FCAF748DDE98__INCLUDED_)
|
||||
142
GameTools/NeoRylClient/HumanQuest.cpp
Normal file
142
GameTools/NeoRylClient/HumanQuest.cpp
Normal file
@@ -0,0 +1,142 @@
|
||||
// HumanQuest.cpp: implementation of the CHumanQuest class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanQuest.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "GUITooltipItem.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanQuest::CHumanQuest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanQuest::~CHumanQuest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanQuest::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[50]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 222, 224, g_ClientMain.m_lpInterface->m_lstTexture[51]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 56, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[52]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 312, 0, 0, 222, 168, g_ClientMain.m_lpInterface->m_lstTexture[53]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 56, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[54]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 312, 0, 0, 222, 168, g_ClientMain.m_lpInterface->m_lstTexture[55]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 4, y + 26, 0, 54, 107, 84, g_ClientMain.m_lpInterface->m_lstTexture[56]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 4, y + 26, 0, 84, 107, 114, g_ClientMain.m_lpInterface->m_lstTexture[56]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 0, 0, 107, 54, g_ClientMain.m_lpInterface->m_lstTexture[56]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 222; m_rcWindowSize.bottom = y + 480;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 150; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuest::InitValue(void)
|
||||
{
|
||||
m_dwStartQuest = 0;
|
||||
m_dwStartDesc = 0;
|
||||
m_dwStartDone = 0;
|
||||
|
||||
m_dwQuestWindowMode = 0;
|
||||
}
|
||||
|
||||
BOOL CHumanQuest::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 4, m_rcWindowSize.top + 26, m_rcWindowSize.left + 58, m_rcWindowSize.top + 56))
|
||||
{
|
||||
m_dwQuestWindowMode = 0;
|
||||
} else if(g_DeviceInput.InRect(m_rcWindowSize.left + 58, m_rcWindowSize.top + 26, m_rcWindowSize.left + 111, m_rcWindowSize.top + 56))
|
||||
{
|
||||
m_dwQuestWindowMode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuest::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
}
|
||||
|
||||
void CHumanQuest::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
|
||||
switch(m_dwQuestWindowMode)
|
||||
{
|
||||
case 0:
|
||||
m_lstSprite[6]->Render(lpD3DDevice);
|
||||
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_lstSprite[7]->Render(lpD3DDevice);
|
||||
|
||||
m_lstSprite[4]->Render(lpD3DDevice);
|
||||
m_lstSprite[5]->Render(lpD3DDevice);
|
||||
break;
|
||||
}
|
||||
}
|
||||
33
GameTools/NeoRylClient/HumanQuest.h
Normal file
33
GameTools/NeoRylClient/HumanQuest.h
Normal file
@@ -0,0 +1,33 @@
|
||||
// HumanQuest.h: interface for the CHumanQuest class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANQUEST_H__7C63921C_B75A_4450_A5F7_0BCDBEDA5FAC__INCLUDED_)
|
||||
#define AFX_HUMANQUEST_H__7C63921C_B75A_4450_A5F7_0BCDBEDA5FAC__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanQuest : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanQuest();
|
||||
virtual ~CHumanQuest();
|
||||
|
||||
unsigned long m_dwStartQuest;
|
||||
unsigned long m_dwStartDesc;
|
||||
unsigned long m_dwStartDone;
|
||||
|
||||
unsigned long m_dwQuestWindowMode;
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANQUEST_H__7C63921C_B75A_4450_A5F7_0BCDBEDA5FAC__INCLUDED_)
|
||||
202
GameTools/NeoRylClient/HumanQuestDesc.cpp
Normal file
202
GameTools/NeoRylClient/HumanQuestDesc.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
// HumanQuestDesc.cpp: implementation of the CHumanQuestDesc class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "HumanQuestDesc.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanQuestDesc::CHumanQuestDesc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanQuestDesc::~CHumanQuestDesc()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanQuestDesc::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 256, 256, g_ClientMain.m_lpInterface->m_lstTexture[35]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y, 0, 0, 78, 256, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 256, 160, g_ClientMain.m_lpInterface->m_lstTexture[37]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y + 256, 0, 0, 78, 160, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(58, 379, 82, 0, 201, 20, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[175]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(198, 379, 82, 26, 201, 46, g_ClientMain.m_lpInterface->m_lstTexture[38]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[176]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(281, 355, 221, 126, 234, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(281, 355, 234, 126, 247, 138, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[183]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(299, 355, 221, 138, 234, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(299, 355, 234, 138, 247, 150, g_ClientMain.m_lpInterface->m_lstTexture[36]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[184]);
|
||||
lpButton->SetMove(x, y);
|
||||
lpButton->ShowButton(FALSE);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 334; m_rcWindowSize.bottom = y + 416;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 334; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuestDesc::InitValue(void)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanQuestDesc::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharStartQuest(g_ClientMain.m_dwMyChrID, m_dwChrID, m_dwQuestID);
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
ShowWindow(FALSE);
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuestDesc::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
|
||||
if(bShow == FALSE)
|
||||
{
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanQuestDesc::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
|
||||
RECT rect;
|
||||
for(int i = 0; i < m_lstMessage.size(); i++)
|
||||
{
|
||||
rect.left = m_rcWindowSize.left + 14;
|
||||
rect.top = m_rcWindowSize.top + 20 + i * 16;
|
||||
rect.right = rect.left + 304;
|
||||
rect.bottom = rect.top + 16;
|
||||
|
||||
g_TextEdit.DrawText(m_lstMessage[i]->strMessage, &rect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanQuestDesc::SetText(unsigned long dwChrID, unsigned long dwQuestID, const char *strMessage)
|
||||
{
|
||||
m_dwChrID = dwChrID;
|
||||
m_dwQuestID = dwQuestID;
|
||||
|
||||
vector<LPMessage>::iterator it;
|
||||
LPMessage lpMessage;
|
||||
for(it = m_lstMessage.begin(); it != m_lstMessage.end();)
|
||||
{
|
||||
lpMessage = (*it);
|
||||
it = m_lstMessage.erase(it);
|
||||
delete lpMessage;
|
||||
}
|
||||
m_lstMessage.clear();
|
||||
|
||||
char *strMessageTemp, *token, seps[] = "\\n";
|
||||
strMessageTemp = new char[strlen(strMessage) + 100];
|
||||
strcpy(strMessageTemp, strMessage);
|
||||
token = strtok(strMessageTemp, seps);
|
||||
|
||||
while(token != NULL)
|
||||
{
|
||||
lpMessage = new Message;
|
||||
strcpy(lpMessage->strMessage, token);
|
||||
m_lstMessage.push_back(lpMessage);
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
}
|
||||
|
||||
delete[] strMessageTemp;
|
||||
}
|
||||
37
GameTools/NeoRylClient/HumanQuestDesc.h
Normal file
37
GameTools/NeoRylClient/HumanQuestDesc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
// HumanQuestDesc.h: interface for the CHumanQuestDesc class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANQUESTDESC_H__09ACDA45_E357_4FF5_B47C_E1654C896421__INCLUDED_)
|
||||
#define AFX_HUMANQUESTDESC_H__09ACDA45_E357_4FF5_B47C_E1654C896421__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanQuestDesc : public CGUIWindow
|
||||
{
|
||||
typedef struct Message
|
||||
{
|
||||
char strMessage[MAX_PATH];
|
||||
} Message, *LPMessage;
|
||||
|
||||
public:
|
||||
void SetText(unsigned long dwChrID, unsigned long dwQuestID, const char *strMessage);
|
||||
vector<LPMessage> m_lstMessage;
|
||||
unsigned long m_dwChrID;
|
||||
unsigned long m_dwQuestID;
|
||||
|
||||
CHumanQuestDesc();
|
||||
~CHumanQuestDesc();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANQUESTDESC_H__09ACDA45_E357_4FF5_B47C_E1654C896421__INCLUDED_)
|
||||
409
GameTools/NeoRylClient/HumanQuick.cpp
Normal file
409
GameTools/NeoRylClient/HumanQuick.cpp
Normal file
@@ -0,0 +1,409 @@
|
||||
// HumanQuick.cpp: implementation of the CHumanQuick class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanQuick.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUITextEdit.h"
|
||||
|
||||
#include "Skill\SkillMgr.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanQuick::CHumanQuick()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanQuick::~CHumanQuick()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanQuick::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 40, 252, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 250, 82, 136, 120, 167, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLECHECK;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 38, 206, 0, 244, 21, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 38, 206, 21, 244, 42, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[198]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 250, 206, 42, 244, 64, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 250, 206, 65, 244, 87, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[199]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 40; m_rcWindowSize.bottom = y + 280;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 40; m_rcMoveEdge.bottom = y + 280;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuick::InitValue(void)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanQuick::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bStillCasting) return TRUE;
|
||||
|
||||
if(g_ClientMain.m_bSimpleMode)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(TRUE);
|
||||
m_lstSprite[1]->SetPosition(m_rcWindowSize.left, m_rcWindowSize.top + 272);
|
||||
} else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[1]->ShowButton(FALSE);
|
||||
m_lstSprite[1]->SetPosition(m_rcWindowSize.left, m_rcWindowSize.top + 250);
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('Z'))
|
||||
{
|
||||
g_ClientMain.m_dwStartQuickSlot = 0;
|
||||
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('X'))
|
||||
{
|
||||
g_ClientMain.m_dwStartQuickSlot = 5;
|
||||
}
|
||||
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 0, m_rcWindowSize.top + 38, m_rcWindowSize.left + 38, m_rcWindowSize.top + 59) && g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
if(g_ClientMain.m_dwStartQuickSlot)
|
||||
g_ClientMain.m_dwStartQuickSlot = 0;
|
||||
else
|
||||
g_ClientMain.m_dwStartQuickSlot = 5;
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_bSimpleMode = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->GetChantFlag(26))
|
||||
return TRUE;
|
||||
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left + 3, m_rcWindowSize.top + 3, m_rcWindowSize.left + 35, m_rcWindowSize.top + 35) && g_DeviceInput.GetIsLeftMouseDown() &&
|
||||
g_ClientMain.m_lpPickItem && g_ClientMain.m_lpPickItem->m_bSkill)
|
||||
{
|
||||
for(int i = 0; i < 10; i++)
|
||||
{
|
||||
if(!g_ClientMain.m_csStatus.m_lstQuickSlot[i])
|
||||
{
|
||||
if((g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos().m_cIndex == i) && (g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_QSlot))
|
||||
{
|
||||
// 바로 놓는다.
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[i] = g_ClientMain.m_lpPickItem;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[i]->SetItemPos(ClientSocket::ItemPos_QSlot);
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[i]->SetPos(i);
|
||||
g_ClientMain.SetPickItem(NULL);
|
||||
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[i]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[i]);
|
||||
} else
|
||||
{
|
||||
// 선택에 바로 담기
|
||||
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_QSlot, i, 0);
|
||||
}
|
||||
|
||||
/* g_ClientMain.m_csStatus.m_lstQuickSlot[i] = g_ClientMain.m_lpPickItem;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[i]->m_dwItemPos = ClientSocket::ItemPos_QSlot;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[i]->m_lpItemBase->m_ItemInfo.m_nItemIndex.m_cIndex = i;
|
||||
g_ClientMain.SetPickItem(NULL);
|
||||
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected = g_ClientMain.m_csStatus.m_lstQuickSlot[i];*/
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
if(g_DeviceInput.InRect(3, 162 + i * 38, 35, 162 + 32 + i * 38))
|
||||
{
|
||||
if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
if(!g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i])
|
||||
{ // 퀵슬롯에 아이템이 없을때
|
||||
if(g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
Item::ItemPos pItemIndex;
|
||||
pItemIndex.m_cIndex = g_ClientMain.m_dwStartQuickSlot + i;
|
||||
pItemIndex.m_cPos = ClientSocket::ItemPos_QSlot;
|
||||
|
||||
if(g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos() == pItemIndex)
|
||||
{ // 그냥 내려 놓는다.
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[pItemIndex.m_cIndex] = g_ClientMain.m_lpPickItem;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[pItemIndex.m_cIndex]->SetItemPos(ClientSocket::ItemPos_QSlot);
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[pItemIndex.m_cIndex]->SetPos(pItemIndex.m_cIndex);
|
||||
g_ClientMain.SetPickItem(NULL);
|
||||
} else if(g_ClientMain.m_lpPickItem->m_bSkill)
|
||||
{
|
||||
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_QSlot, pItemIndex.m_cIndex);
|
||||
} else if(g_ClientMain.m_lpPickItem->m_lpItemBase->IsSet(Item::DetailData::QUICKSLOT_IN))
|
||||
{
|
||||
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_QSlot, pItemIndex.m_cIndex);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
if(g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_QSlot)
|
||||
{
|
||||
// 스왑이 일어난다. but TakeItem으로 보낸다.
|
||||
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_QSlot, g_ClientMain.m_dwStartQuickSlot + i);
|
||||
|
||||
// g_ClientMain.m_Network.SendTakeItem(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_QSlot, &pItemIndex);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} else
|
||||
{
|
||||
g_ClientMain.SetPickItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]);
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i] == g_ClientMain.m_csStatus.m_lpQuickSelected)
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
}
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i] = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(g_DeviceInput.GetIsRightMouseDown())
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i])
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0] && (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('1')))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 0]);
|
||||
|
||||
return TRUE;
|
||||
} else if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1] && (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('2')))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 1]);
|
||||
|
||||
return TRUE;
|
||||
} else if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2] && (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('3')))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 2]);
|
||||
|
||||
return TRUE;
|
||||
} else if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3] && (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('4')))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 3]);
|
||||
|
||||
return TRUE;
|
||||
} else if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4] && (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('5')))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4]->m_bSkill)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4]->GetSkillType() == Skill::Type::CHANT &&
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4])
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(NULL);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(NULL);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SetChant(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4]);
|
||||
g_ClientMain.m_csStatus.SetActivateSkill(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4]);
|
||||
}
|
||||
}
|
||||
else
|
||||
UseItem(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + 4]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanQuick::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
|
||||
for(int i = 0; i < 5; i++)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i])
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_bSkill)
|
||||
{
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_wPutX = m_rcWindowSize.left + 3;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_wPutY = m_rcWindowSize.top + 62 + i * 38;
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_wPutX = m_rcWindowSize.left + 3 + 16 - g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_lpSprite->GetSizeX() / 2;
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_wPutY = m_rcWindowSize.top + 62 + i * 38 + 16 - g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->m_lpSprite->GetSizeY() / 2;
|
||||
}
|
||||
|
||||
g_ClientMain.m_csStatus.m_lstQuickSlot[g_ClientMain.m_dwStartQuickSlot + i]->Render(lpD3DDevice);
|
||||
}
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_csStatus.m_lpQuickSelected)
|
||||
{
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected->m_wPutX = m_rcWindowSize.left + 3;
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected->m_wPutY = m_rcWindowSize.top + 3;
|
||||
g_ClientMain.m_csStatus.m_lpQuickSelected->Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_dwStartQuickSlot)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_ON;
|
||||
} else
|
||||
{
|
||||
m_ButtonManager.m_lstButton[0]->m_nState = BUTTON_OFF;
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanQuick::UseItem(CItemInstance *lpItem)
|
||||
{
|
||||
if(g_ClientMain.m_lpInterface && g_ClientMain.m_lpInterface->GetIsTrade()) return;
|
||||
|
||||
switch(lpItem->GetItemType())
|
||||
{
|
||||
case Item::CItemType::POTION:
|
||||
if(g_ClientMain.m_csStatus.CheckUsePotion(lpItem))
|
||||
{
|
||||
CItemInstance *lpPotion = g_ClientMain.m_csStatus.GetInventoryItemfromID(lpItem->GetProtoTypeID());
|
||||
if(lpPotion)
|
||||
{
|
||||
// 포션을 사용
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_USEITEM;
|
||||
g_ClientMain.m_Network.m_pSocket->CharUseItem(g_ClientMain.m_dwMyChrID, g_ClientMain.m_dwMyChrID, &lpPotion->m_lpItemBase->GetPos());
|
||||
g_ClientMain.SetPotionCoolDown();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
28
GameTools/NeoRylClient/HumanQuick.h
Normal file
28
GameTools/NeoRylClient/HumanQuick.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// HumanQuick.h: interface for the CHumanQuick class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANQUICK_H__3F2B60DA_8E03_4CB6_8D47_873886B51EEC__INCLUDED_)
|
||||
#define AFX_HUMANQUICK_H__3F2B60DA_8E03_4CB6_8D47_873886B51EEC__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanQuick : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
void UseItem(CItemInstance *lpItem);
|
||||
CHumanQuick();
|
||||
virtual ~CHumanQuick();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANQUICK_H__3F2B60DA_8E03_4CB6_8D47_873886B51EEC__INCLUDED_)
|
||||
247
GameTools/NeoRylClient/HumanRespawn.cpp
Normal file
247
GameTools/NeoRylClient/HumanRespawn.cpp
Normal file
@@ -0,0 +1,247 @@
|
||||
// HumanRespawn.cpp: implementation of the CHumanRespawn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanRespawn.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanRespawn::CHumanRespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanRespawn::~CHumanRespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanRespawn::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanRespawn::InitValue(void)
|
||||
{
|
||||
m_cSelectZone = 0;
|
||||
|
||||
ZeroMemory(&m_aryHumanRespawn, sizeof(RespawnPoint) * 30);
|
||||
|
||||
m_aryHumanRespawn[3].m_dwSpawnNumber = 3;
|
||||
m_aryHumanRespawn[3].m_wPutX[0] = 12; m_aryHumanRespawn[3].m_wPutY[0] = 127;
|
||||
m_aryHumanRespawn[3].m_psPoint[0].fPointX = 868.65f;
|
||||
m_aryHumanRespawn[3].m_psPoint[0].fPointY = 57.28f;
|
||||
m_aryHumanRespawn[3].m_psPoint[0].fPointZ = 1397.06f;
|
||||
|
||||
m_aryHumanRespawn[3].m_wPutX[1] = 76; m_aryHumanRespawn[3].m_wPutY[1] = 37;
|
||||
m_aryHumanRespawn[3].m_psPoint[1].fPointX = 1217.44f;
|
||||
m_aryHumanRespawn[3].m_psPoint[1].fPointY = 48.62f;
|
||||
m_aryHumanRespawn[3].m_psPoint[1].fPointZ = 1827.82f;
|
||||
|
||||
m_aryHumanRespawn[3].m_wPutX[2] = 146; m_aryHumanRespawn[3].m_wPutY[2] = 74;
|
||||
m_aryHumanRespawn[3].m_psPoint[2].fPointX = 1526.42f;
|
||||
m_aryHumanRespawn[3].m_psPoint[2].fPointY = 33.20f;
|
||||
m_aryHumanRespawn[3].m_psPoint[2].fPointZ = 1685.55f;
|
||||
|
||||
m_aryHumanRespawn[6].m_dwSpawnNumber = 3;
|
||||
m_aryHumanRespawn[6].m_wPutX[0] = 12; m_aryHumanRespawn[6].m_wPutY[0] = 127;
|
||||
m_aryHumanRespawn[6].m_psPoint[0].fPointX = 868.65f;
|
||||
m_aryHumanRespawn[6].m_psPoint[0].fPointY = 57.28f;
|
||||
m_aryHumanRespawn[6].m_psPoint[0].fPointZ = 1397.06f;
|
||||
|
||||
m_aryHumanRespawn[6].m_wPutX[1] = 76; m_aryHumanRespawn[6].m_wPutY[1] = 37;
|
||||
m_aryHumanRespawn[6].m_psPoint[1].fPointX = 1217.44f;
|
||||
m_aryHumanRespawn[6].m_psPoint[1].fPointY = 48.62f;
|
||||
m_aryHumanRespawn[6].m_psPoint[1].fPointZ = 1827.82f;
|
||||
|
||||
m_aryHumanRespawn[6].m_wPutX[2] = 146; m_aryHumanRespawn[6].m_wPutY[2] = 74;
|
||||
m_aryHumanRespawn[6].m_psPoint[2].fPointX = 1526.42f;
|
||||
m_aryHumanRespawn[6].m_psPoint[2].fPointY = 33.20f;
|
||||
m_aryHumanRespawn[6].m_psPoint[2].fPointZ = 1685.55f;
|
||||
|
||||
ZeroMemory(&m_aryAkhanRespawn, sizeof(RespawnPoint) * 30);
|
||||
|
||||
m_aryAkhanRespawn[3].m_dwSpawnNumber = 3;
|
||||
m_aryAkhanRespawn[3].m_wPutX[0] = 100; m_aryAkhanRespawn[3].m_wPutY[0] = 172;
|
||||
m_aryAkhanRespawn[3].m_psPoint[0].fPointX = 1310.52f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[0].fPointY = 28.53f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[0].fPointZ = 1168.81f;
|
||||
|
||||
m_aryAkhanRespawn[3].m_wPutX[1] = 163; m_aryAkhanRespawn[3].m_wPutY[1] = 209;
|
||||
m_aryAkhanRespawn[3].m_psPoint[1].fPointX = 1619.65f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[1].fPointY = 49.31f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[1].fPointZ = 998.32f;
|
||||
|
||||
m_aryAkhanRespawn[3].m_wPutX[2] = 229; m_aryAkhanRespawn[3].m_wPutY[2] = 113;
|
||||
m_aryAkhanRespawn[3].m_psPoint[2].fPointX = 1976.27f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[2].fPointY = 53.56f;
|
||||
m_aryAkhanRespawn[3].m_psPoint[2].fPointZ = 1464.75f;
|
||||
|
||||
m_aryAkhanRespawn[6].m_dwSpawnNumber = 3;
|
||||
m_aryAkhanRespawn[6].m_wPutX[0] = 100; m_aryAkhanRespawn[6].m_wPutY[0] = 172;
|
||||
m_aryAkhanRespawn[6].m_psPoint[0].fPointX = 1310.52f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[0].fPointY = 28.53f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[0].fPointZ = 1168.81f;
|
||||
|
||||
m_aryAkhanRespawn[6].m_wPutX[1] = 163; m_aryAkhanRespawn[6].m_wPutY[1] = 209;
|
||||
m_aryAkhanRespawn[6].m_psPoint[1].fPointX = 1619.65f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[1].fPointY = 49.31f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[1].fPointZ = 998.32f;
|
||||
|
||||
m_aryAkhanRespawn[6].m_wPutX[2] = 229; m_aryAkhanRespawn[6].m_wPutY[2] = 113;
|
||||
m_aryAkhanRespawn[6].m_psPoint[2].fPointX = 1976.27f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[2].fPointY = 53.56f;
|
||||
m_aryAkhanRespawn[6].m_psPoint[2].fPointZ = 1464.75f;
|
||||
}
|
||||
|
||||
BOOL CHumanRespawn::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(m_dwKind == NATION_HUMAN)
|
||||
{
|
||||
for(unsigned long i = 0; i < m_aryHumanRespawn[m_cSelectZone].m_dwSpawnNumber; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_RESPAWN;
|
||||
g_ClientMain.m_lpInterface->DestroyRespawn();
|
||||
g_ClientMain.m_Network.m_pSocket->CharRespawn(g_ClientMain.m_dwMyChrID, 1, m_aryHumanRespawn[m_cSelectZone].m_psPoint[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
for(unsigned long i = 0; i < m_aryAkhanRespawn[m_cSelectZone].m_dwSpawnNumber; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_RESPAWN;
|
||||
g_ClientMain.m_lpInterface->DestroyRespawn();
|
||||
g_ClientMain.m_Network.m_pSocket->CharRespawn(g_ClientMain.m_dwMyChrID, 1, m_aryAkhanRespawn[m_cSelectZone].m_psPoint[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanRespawn::ShowWindow(BOOL bShow)
|
||||
{
|
||||
m_bShow = bShow;
|
||||
|
||||
if(!bShow)
|
||||
{
|
||||
m_TooltipManager.DestroyAllTooltip();
|
||||
m_ButtonManager.DestroyAllButton();
|
||||
|
||||
{
|
||||
vector<CSprite *>::iterator it;
|
||||
for(it = m_lstSprite.begin(); it != m_lstSprite.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstSprite.clear();
|
||||
}
|
||||
|
||||
{
|
||||
vector<CTexture *>::iterator it;
|
||||
for(it = m_lstTexture.begin(); it != m_lstTexture.end(); it++)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
m_lstTexture.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanRespawn::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(m_lstSprite[0])
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanRespawn::SetRespawn(unsigned char cZoneNum, unsigned long dwKind)
|
||||
{
|
||||
m_cSelectZone = cZoneNum;
|
||||
m_dwKind = dwKind;
|
||||
|
||||
if(m_dwKind == NATION_HUMAN)
|
||||
{
|
||||
CGUIButton *lpButton;
|
||||
for(unsigned long i = 0; i < m_aryHumanRespawn[cZoneNum].m_dwSpawnNumber; i++)
|
||||
{
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(m_aryHumanRespawn[cZoneNum].m_wPutX[i], m_aryHumanRespawn[cZoneNum].m_wPutY[i], 199, 153, 212, 166, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(m_aryHumanRespawn[cZoneNum].m_wPutX[i], m_aryHumanRespawn[cZoneNum].m_wPutY[i], 199, 169, 212, 182, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetMove(m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
}
|
||||
} else
|
||||
{
|
||||
CGUIButton *lpButton;
|
||||
for(unsigned long i = 0; i < m_aryAkhanRespawn[cZoneNum].m_dwSpawnNumber; i++)
|
||||
{
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(m_aryAkhanRespawn[cZoneNum].m_wPutX[i], m_aryAkhanRespawn[cZoneNum].m_wPutY[i], 183, 153, 196, 166, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(m_aryAkhanRespawn[cZoneNum].m_wPutX[i], m_aryAkhanRespawn[cZoneNum].m_wPutY[i], 183, 169, 196, 182, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpButton->SetMove(m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
}
|
||||
}
|
||||
|
||||
CTexture::SetPath(INTERFACETEXTUREPATH);
|
||||
CTexture *lpTexture;
|
||||
lpTexture = new CTexture;
|
||||
lpTexture->Load("Spon_BG.dds");
|
||||
m_lstTexture.push_back(lpTexture);
|
||||
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(m_rcWindowSize.left, m_rcWindowSize.top, 0, 0, 256, 256, m_lstTexture[0]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
m_rcWindowSize.right = m_rcWindowSize.left + 256;
|
||||
m_rcWindowSize.bottom = m_rcWindowSize.top + 256;
|
||||
|
||||
m_rcMoveEdge.right = m_rcWindowSize.left + 256;
|
||||
m_rcMoveEdge.bottom = m_rcWindowSize.top + 20;
|
||||
}
|
||||
42
GameTools/NeoRylClient/HumanRespawn.h
Normal file
42
GameTools/NeoRylClient/HumanRespawn.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// HumanRespawn.h: interface for the CHumanRespawn class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANRESPAWN_H__D517D148_5F76_478D_84F4_3FCCCBCD1336__INCLUDED_)
|
||||
#define AFX_HUMANRESPAWN_H__D517D148_5F76_478D_84F4_3FCCCBCD1336__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanRespawn : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
typedef struct RespawnPoint
|
||||
{
|
||||
unsigned long m_dwSpawnNumber;
|
||||
unsigned short m_wPutX[10];
|
||||
unsigned short m_wPutY[10];
|
||||
POS m_psPoint[10];
|
||||
} RespawnPoint;
|
||||
|
||||
unsigned char m_cSelectZone;
|
||||
unsigned long m_dwKind;
|
||||
vector<CTexture *> m_lstTexture;
|
||||
RespawnPoint m_aryHumanRespawn[30];
|
||||
RespawnPoint m_aryAkhanRespawn[30];
|
||||
|
||||
void SetRespawn(unsigned char cZoneNum, unsigned long dwKind);
|
||||
CHumanRespawn();
|
||||
virtual ~CHumanRespawn();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow);
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANRESPAWN_H__D517D148_5F76_478D_84F4_3FCCCBCD1336__INCLUDED_)
|
||||
261
GameTools/NeoRylClient/HumanShortcut.cpp
Normal file
261
GameTools/NeoRylClient/HumanShortcut.cpp
Normal file
@@ -0,0 +1,261 @@
|
||||
// HumanShortcut.cpp: implementation of the CHumanShortcut class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "HumanShortcut.h"
|
||||
#include "GUITextEdit.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanShortcut::CHumanShortcut()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanShortcut::~CHumanShortcut()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanShortcut::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CGUIButton *lpButton;
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 0, 0, 0, 141, 20, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 0, 0, 136, 141, 156, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[200]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 20, 0, 20, 141, 40, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 20, 0, 156, 141, 176, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[201]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 40, 0, 40, 141, 60, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 40, 0, 176, 141, 196, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[202]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 60, 0, 60, 141, 80, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 60, 0, 196, 141, 216, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[203]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 80, 0, 80, 141, 100, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 80, 0, 216, 141, 236, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[204]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(0, 100, 0, 100, 70, 120, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(0, 100, 0, 236, 70, 256, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[205]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(70, 100, 70, 100, 141, 120, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(70, 100, 70, 236, 141, 256, g_ClientMain.m_lpInterface->m_lstTexture[3]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[206]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 141; m_rcWindowSize.bottom = y + 120;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 141; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanShortcut::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
if(m_dwWindowKind == WINDOW_FLOAT)
|
||||
{
|
||||
if(WindowMoving(*ptMousePos))
|
||||
{
|
||||
m_ButtonManager.SetMove(m_ptWindowMovePos.x, m_ptWindowMovePos.y);
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
if(!g_ClientMain.m_lpInterface->GetIsExchange())
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[0]->m_nState == BUTTON_CLICK) // Àκ¥Å丮
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(!g_ClientMain.m_lpInterface->m_lstWindow[5]->m_bShow);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
} else if(m_ButtonManager.m_lstButton[1]->m_nState == BUTTON_CLICK) // ½ºÅ×ÀÌÅͽº
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = !g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
} else if(m_ButtonManager.m_lstButton[2]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(!g_ClientMain.m_lpInterface->m_lstWindow[4]->m_bShow);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
} else if(m_ButtonManager.m_lstButton[3]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = !g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
} else if(m_ButtonManager.m_lstButton[4]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
// g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(!g_ClientMain.m_lpInterface->m_lstWindow[22]->m_bShow);
|
||||
} else if(m_ButtonManager.m_lstButton[5]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
|
||||
g_ClientMain.m_lpInterface->m_bShowHelp = TRUE;
|
||||
g_ClientMain.m_lpCommonInterface->InitHelp();
|
||||
} else if(m_ButtonManager.m_lstButton[6]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[3]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[4]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[5]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[6]->m_bShow = FALSE;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow = !g_ClientMain.m_lpInterface->m_lstWindow[7]->m_bShow;
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[8]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[13]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[14]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[16]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[17]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[19]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[20]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[21]->ShowWindow(FALSE);
|
||||
g_ClientMain.m_lpInterface->m_lstWindow[22]->ShowWindow(FALSE);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanShortcut::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_ButtonManager.Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
27
GameTools/NeoRylClient/HumanShortcut.h
Normal file
27
GameTools/NeoRylClient/HumanShortcut.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanShortcut.h: interface for the CHumanShortcut class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANSHORTCUT_H__949323D1_21A4_48D1_8E93_0E9BF578AF79__INCLUDED_)
|
||||
#define AFX_HUMANSHORTCUT_H__949323D1_21A4_48D1_8E93_0E9BF578AF79__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanShortcut : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanShortcut();
|
||||
~CHumanShortcut();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void) { }
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANSHORTCUT_H__949323D1_21A4_48D1_8E93_0E9BF578AF79__INCLUDED_)
|
||||
988
GameTools/NeoRylClient/HumanSimpleChat.cpp
Normal file
988
GameTools/NeoRylClient/HumanSimpleChat.cpp
Normal file
@@ -0,0 +1,988 @@
|
||||
// HumanSimpleChat.cpp: implementation of the CHumanSimpleChat class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "WinInput.h"
|
||||
#include "HumanSimpleChat.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "FrameTimer.h"
|
||||
|
||||
#include "StringFilter.h"
|
||||
|
||||
#include "GUIMessageBox.h"
|
||||
#include "BaseGraphicsLayer.h"
|
||||
|
||||
#include "Creature\Monster\MonsterMgr.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanSimpleChat::CHumanSimpleChat()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanSimpleChat::~CHumanSimpleChat()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleChat::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 80, 0, 81, 256, 100, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x + 256, y + 80, 0, 201, 250, 220, g_ClientMain.m_lpInterface->m_lstTexture[1]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIScroll *lpScroll;
|
||||
lpScroll = new CGUIScroll;
|
||||
lpScroll->m_lpBarButton = new CGUIButton;
|
||||
lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton->Create(491, 14, 170, 74, 182, 83, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(491, 14, 170, 74, 182, 83, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
|
||||
lpScroll->m_lpUpArrowButton = new CGUIButton;
|
||||
lpScroll->m_lpUpArrowButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpUpArrowButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpUpArrowButton->m_lpNormalButton->Create(491, 4, 170, 54, 182, 64, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton->Create(491, 4, 182, 54, 194, 64, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
|
||||
lpScroll->m_lpDownArrowButton = new CGUIButton;
|
||||
lpScroll->m_lpDownArrowButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpDownArrowButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpDownArrowButton->m_lpNormalButton->Create(491, 69, 170, 64, 182, 74, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton->Create(491, 69, 182, 64, 194, 74, g_ClientMain.m_lpInterface->m_lstTexture[2]);
|
||||
|
||||
lpScroll->m_lValue = (long *)&g_TextEdit.m_dwStartChat;
|
||||
lpScroll->SetMove(x, y);
|
||||
lpScroll->SetPosition(491, 14);
|
||||
lpScroll->SetEdge(0, 0, 10, 46);
|
||||
lpScroll->SetRange(0, 0);
|
||||
m_lstScroll.push_back(lpScroll);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 510; m_rcWindowSize.bottom = y + 120;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 510; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleChat::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_CHAT && g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
if(m_dwWindowKind == WINDOW_FLOAT)
|
||||
{
|
||||
if(WindowMoving(*ptMousePos))
|
||||
{
|
||||
m_ButtonManager.SetMove(m_ptWindowMovePos.x, m_ptWindowMovePos.y);
|
||||
|
||||
m_lstSprite[0]->SetPosition(m_ptWindowMovePos.x, m_ptWindowMovePos.y);
|
||||
m_lstSprite[1]->SetPosition(m_ptWindowMovePos.x + 256, m_ptWindowMovePos.y);
|
||||
|
||||
m_lstSprite[2]->SetPosition(m_ptWindowMovePos.x + 1, m_ptWindowMovePos.y + 101);
|
||||
m_lstSprite[3]->SetPosition(m_ptWindowMovePos.x + 1, m_ptWindowMovePos.y + 101);
|
||||
m_lstSprite[4]->SetPosition(m_ptWindowMovePos.x + 1, m_ptWindowMovePos.y + 101);
|
||||
|
||||
m_lstScroll[0]->SetMove(m_ptWindowMovePos.x, m_ptWindowMovePos.y);
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID) * 2.0f;
|
||||
|
||||
// unsigned long count = 0;
|
||||
deque<CGUITextEdit::Message *>::iterator it;
|
||||
for(it = g_TextEdit.m_deqChatMessage.begin(); it != g_TextEdit.m_deqChatMessage.end(); it++)
|
||||
{
|
||||
if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
(*it)->fTimer -= fUpdate;
|
||||
}
|
||||
/* if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
count++;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* if(count < 5)
|
||||
g_TextEdit.m_dwStartChat = 0;
|
||||
else
|
||||
g_TextEdit.m_dwStartChat = count - 5;*/
|
||||
|
||||
// count = 0;
|
||||
for(it = g_TextEdit.m_deqPartyMessage.begin(); it != g_TextEdit.m_deqPartyMessage.end(); it++)
|
||||
{
|
||||
if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
(*it)->fTimer -= fUpdate;
|
||||
}
|
||||
/* if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
count++;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* if(count < 5)
|
||||
g_TextEdit.m_dwStartParty = 0;
|
||||
else
|
||||
g_TextEdit.m_dwStartParty = count - 5;*/
|
||||
|
||||
// count = 0;
|
||||
for(it = g_TextEdit.m_deqGuildMessage.begin(); it != g_TextEdit.m_deqGuildMessage.end(); it++)
|
||||
{
|
||||
if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
(*it)->fTimer -= fUpdate;
|
||||
}
|
||||
/* if((*it)->fTimer > 0.0f)
|
||||
{
|
||||
count++;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* if(count < 5)
|
||||
g_TextEdit.m_dwStartGuild = 0;
|
||||
else
|
||||
g_TextEdit.m_dwStartGuild = count - 5;*/
|
||||
|
||||
/* if(g_DeviceInput.KeyHold(VK_PRIOR))
|
||||
{
|
||||
switch(g_TextEdit.m_dwChatMode)
|
||||
{
|
||||
case CHATMODE_CHAT:
|
||||
if(g_TextEdit.m_deqChatMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartChat != 0) g_TextEdit.m_dwStartChat--;
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_PARTY:
|
||||
if(g_TextEdit.m_deqPartyMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartParty != 0) g_TextEdit.m_dwStartParty--;
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_GUILD:
|
||||
if(g_TextEdit.m_deqGuildMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartGuild != 0) g_TextEdit.m_dwStartGuild--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else if(g_DeviceInput.KeyHold(VK_NEXT))
|
||||
{
|
||||
switch(g_TextEdit.m_dwChatMode)
|
||||
{
|
||||
case CHATMODE_CHAT:
|
||||
if(g_TextEdit.m_deqChatMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartChat != g_TextEdit.m_deqChatMessage.size() - 5) g_TextEdit.m_dwStartChat++;
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_PARTY:
|
||||
if(g_TextEdit.m_deqPartyMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartParty != g_TextEdit.m_deqPartyMessage.size() - 5) g_TextEdit.m_dwStartParty++;
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_GUILD:
|
||||
if(g_TextEdit.m_deqGuildMessage.size() > 5)
|
||||
{
|
||||
if(g_TextEdit.m_dwStartGuild != g_TextEdit.m_deqGuildMessage.size() - 5) g_TextEdit.m_dwStartGuild++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////// 스크롤 부분
|
||||
/* if(g_TextEdit.m_deqChatMessage.size() <= MAX_DRAWCHAT)
|
||||
m_lstScroll[0]->SetRange(0, 0);
|
||||
else
|
||||
m_lstScroll[0]->SetRange(0, g_TextEdit.m_deqChatMessage.size() - MAX_DRAWCHAT);
|
||||
m_lstScroll[0]->Update();*/
|
||||
// m_lstScroll[0]->m_lValue = g_TextEdit.m_dwStartChat;
|
||||
// m_lstScroll[0]->Update();
|
||||
// g_TextEdit.m_dwStartChat = m_lstScroll[0]->m_lValue;
|
||||
|
||||
if(g_TextEdit.m_dwEditMode == EDITMODE_CHAT && GetAsyncKeyState(VK_RETURN) && !g_TextEdit.IsFocus())
|
||||
{
|
||||
if(strcmp(g_TextEdit.GetMessage(), ""))
|
||||
{
|
||||
char strChat[MAX_PATH];
|
||||
unsigned long dwTotalLength;
|
||||
strcpy(strChat, g_TextEdit.GetMessage());
|
||||
dwTotalLength = strlen(strChat);
|
||||
|
||||
if(strChat[0] == '/')
|
||||
{
|
||||
char seps[] = " ,\t\n";
|
||||
char *token, strCommand[MAX_PATH];
|
||||
|
||||
token = strtok(strChat, seps);
|
||||
strcpy(strCommand, token);
|
||||
token = strlwr(strCommand);
|
||||
|
||||
if(!strcmp(token,"/kill"))
|
||||
{
|
||||
g_ClientMain.SetKillCounter(15000);
|
||||
} else if(!strcmp(token, "/p"))
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_PartyInfo.m_dwPartyID)
|
||||
{
|
||||
int len = strlen(token) + 1;
|
||||
if(dwTotalLength >= len)
|
||||
{
|
||||
if(g_ClientMain.m_dwInternationalCode || g_StringFilter.Filter(&strChat[len]))
|
||||
{
|
||||
g_ClientMain.m_Network.SendChatMessage(NULL, &strChat[len], CHATMODE_PARTY);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SendClientLog(1, &strChat[len], g_StringFilter.m_lpSearched);
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[570], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(!strcmp(token, "/s") || !strcmp(token, "/ㄴ")) // 귓속말
|
||||
{
|
||||
int count = 0;
|
||||
count += strlen(token) + 1;
|
||||
|
||||
unsigned long dwLen = strlen(&strChat[count]);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
unsigned long dwCount = strlen(token);
|
||||
|
||||
if(dwLen > dwCount)
|
||||
{
|
||||
count += dwCount + 1;
|
||||
|
||||
if(token && (strlen(token) < 16))
|
||||
{
|
||||
if(g_ClientMain.m_dwInternationalCode || g_StringFilter.Filter(&strChat[count]))
|
||||
{
|
||||
g_ClientMain.m_Network.SendChatMessage(token, &strChat[count], 10);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SendClientLog(1, &strChat[count], g_StringFilter.m_lpSearched);
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[570], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(!strcmp(token, "/c") || !strcmp(token, "/ㅊ")) // 외치기
|
||||
{
|
||||
int len = strlen(token) + 1;
|
||||
if(dwTotalLength >= len)
|
||||
{
|
||||
if(g_ClientMain.m_dwInternationalCode || g_StringFilter.Filter(&strChat[len]))
|
||||
{
|
||||
if(!g_ClientMain.m_Network.SendChatMessage(NULL, &strChat[len], ClientSocket::ChatType_Shout))
|
||||
{
|
||||
char strMessage[MAX_PATH];
|
||||
sprintf(strMessage, "%4.2f초 후에 외치기가 가능합니다.", g_ClientMain.m_Network.m_lShoutCounter / 1000.0f);
|
||||
g_TextEdit.AddMessage(strMessage, g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SendClientLog(1, &strChat[len], g_StringFilter.m_lpSearched);
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[570], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
} else if(!strcmp(token, "/cursor"))
|
||||
{
|
||||
g_ClientMain.m_bHardwareCursor = !g_ClientMain.m_bHardwareCursor;
|
||||
if(g_ClientMain.m_bHardwareCursor)
|
||||
{
|
||||
g_DeviceInput.ShowCursor(TRUE);
|
||||
} else
|
||||
{
|
||||
g_DeviceInput.ShowCursor(FALSE);
|
||||
}
|
||||
} else if(!strcmp(token, "/fame"))
|
||||
{
|
||||
g_ClientMain.m_Network.SendFameInfo(ClientSocket::FameInfoType_Fame);
|
||||
} else if(!strcmp(token, "/merits"))
|
||||
{
|
||||
g_ClientMain.m_Network.SendFameInfo(ClientSocket::FameInfoType_Merits);
|
||||
} else if(!strcmp(token, "/shop"))
|
||||
{
|
||||
if(!g_ClientMain.m_lpInterface->GetBusy())
|
||||
{
|
||||
g_ClientMain.m_lpInterface->InitStreetStall(g_ClientMain.m_dwMyChrID, NULL);
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_bAdminMode)
|
||||
{
|
||||
if(!strcmp(token, "/#moviemode!") || !strcmp(token, "/무비모드"))
|
||||
{
|
||||
g_ClientMain.m_bMovieVersion = TRUE;
|
||||
g_ClientMain.m_bSimpleMode = TRUE;
|
||||
} else if(!strcmp(token, "/#gamemode!") || !strcmp(token, "/게임모드"))
|
||||
{
|
||||
g_ClientMain.m_bMovieVersion = FALSE;
|
||||
} else if(!strcmp(token, "/goto") || !strcmp(token, "/이동"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
double y = atof(token);
|
||||
|
||||
vector3 vecPos = vector3(x, 0.0f, y);
|
||||
vecPos.y = g_ClientMain.m_lpSceneManager->m_HeightField.GetHeight(vecPos) + 15.0f;
|
||||
POS psPos = { vecPos.x, vecPos.y / 100.0f, vecPos.z };
|
||||
g_ClientMain.m_Network.m_pSocket->CharBindPos(g_ClientMain.m_dwMyChrID, 1, &psPos, 0);
|
||||
} else if(!strcmp(token, "/#setsize!"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
int a = atoi(token);
|
||||
|
||||
MAXCHRLOAD = a;
|
||||
} else if(!strcmp(token, "/changetipcounter"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
int a = atoi(token);
|
||||
|
||||
g_ClientMain.m_lTipBroadCounterSeed = a;
|
||||
} else if(!strcmp(token, "/#systeminfo!"))
|
||||
{
|
||||
g_ClientMain.m_bSystemConsoleShow = !g_ClientMain.m_bSystemConsoleShow;
|
||||
if(g_ClientMain.m_bSystemConsoleShow == TRUE)
|
||||
{
|
||||
AllocConsole();
|
||||
SetConsoleTitle("R.Y.L.의 예쁜 시스템 콘솔");
|
||||
} else
|
||||
{
|
||||
FreeConsole();
|
||||
}
|
||||
} else if(!strcmp(token, "/#showinfo!"))
|
||||
{
|
||||
g_ClientMain.m_bShowInfo = !g_ClientMain.m_bShowInfo;
|
||||
} else if(!strcmp(token, "/pos") || !strcmp(token, "/좌표"))
|
||||
{
|
||||
char strText[MAX_PATH];
|
||||
float fDir = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_fDirection - FLOAT_PHI;
|
||||
if(fDir < 0.0f) fDir = FLOAT_PHI * 2 + fDir;
|
||||
|
||||
sprintf(strText, "X = %f, Y = %f, Z = %f, Dir = %f", g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x / 100.0f,
|
||||
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.y / 100.0f,
|
||||
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z / 100.0f,
|
||||
fDir);
|
||||
g_TextEdit.AddMessage(strText, g_ClientMain.m_dwMyChrID, 128);
|
||||
} else if(!strcmp(token, "/zone"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int zone = atoi(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
|
||||
POS psPos = { x, 100.0f, y };
|
||||
g_ClientMain.m_Network.m_pSocket->CharMoveZone(zone, psPos);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/move") || !strcmp(token, "/존이동"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
char strName[16];
|
||||
if(token)
|
||||
{
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int zone = atoi(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double z = atof(token);
|
||||
|
||||
POS psPos = { x, y + 0.2f, z };
|
||||
if(zone == 100)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveChar, strName, zone, 0, 0, psPos, 0);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveZoneChar, strName, zone, 0, 0, psPos, 0);
|
||||
}
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/moveparty") || !strcmp(token, "/존이동파티"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int zone = atoi(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double z = atof(token);
|
||||
|
||||
POS psPos = { x, y + 0.2f, z };
|
||||
if(zone == 100)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveParty, strName, zone, 0, 0, psPos, 0);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveZoneParty, strName, zone, 0, 0, psPos, 0);
|
||||
}
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/moveit") || !strcmp(token, "/워프"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double z = atof(token);
|
||||
|
||||
POS psPos = { x, y + 0.2f, z };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveChar, strName, 0, 0, 0, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/moveitparty") || !strcmp(token, "/워프파티"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double z = atof(token);
|
||||
|
||||
POS psPos = { x, y + 0.2f, z };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::MoveParty, strName, 0, 0, 0, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/respawn") || !strcmp(token, "/리스폰"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::RespawnChar, strName, 0, 0, 0, psPos, 0);
|
||||
}
|
||||
} else if(!strcmp(token, "/kick"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::KillChar, strName, 0, 0, 0, psPos, 0);
|
||||
}
|
||||
} else if(!strcmp(token, "/duelinit") || !strcmp(token, "/듀얼해제"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::DuelInit, strName, 0, 0, 0, psPos, 0);
|
||||
}
|
||||
} else if(!strcmp(token, "/hp"))
|
||||
{
|
||||
token = strtok(NULL, seps);
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::InfoChar, strName, 0, 0, 0, psPos, 0);
|
||||
}
|
||||
} else if(!strcmp(token, "/createmob"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
char strMobName[MAX_PATH];
|
||||
if(token)
|
||||
{
|
||||
strcpy(strMobName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double x = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double y = atof(token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
double z = atof(token);
|
||||
|
||||
POS psPos = { x, y + 0.2f, z };
|
||||
const CMonsterMgr::MonsterProtoType *lpMonster = g_MonsterMgr.GetMonsterProtoType(strMobName);
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::CreateMon,
|
||||
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_strName,
|
||||
0, 0, lpMonster->m_MonsterInfo.m_dwKID, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
}
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/dropitem"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int nItemID = atoi(token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::CreateItem, strName, 0, 0, (unsigned short)nItemID, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/giveexp"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int nAmount = atoi(token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::GetExp, strName, 0, 0, 0, psPos, (unsigned long)nAmount);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/givegold"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
int nAmount = atoi(token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::GetGold, strName, 0, 0, 0, psPos, (unsigned long)nAmount);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/levelup"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::LevelUp, strName, 0, 0, 0, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/peacemode"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::PeaceMode, strName, 0, 0, 0, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else if(!strcmp(token, "/battlemode"))
|
||||
{
|
||||
BOOL bExcept = FALSE;
|
||||
|
||||
token = strtok(NULL, seps);
|
||||
if(token)
|
||||
{
|
||||
char strName[16];
|
||||
if(strlen(token) < 16)
|
||||
{
|
||||
strcpy(strName, token);
|
||||
POS psPos = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
g_ClientMain.m_Network.m_pSocket->CharAdmin(ClientSocket::WarMode, strName, 0, 0, 0, psPos, 0);
|
||||
} else bExcept = TRUE;
|
||||
} else bExcept = TRUE;
|
||||
|
||||
if(bExcept)
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[571], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(strcmp(g_ClientMain.m_strWhisperChrID, ""))
|
||||
{
|
||||
if(g_ClientMain.m_dwInternationalCode || g_StringFilter.Filter(g_TextEdit.GetMessage()))
|
||||
{
|
||||
g_ClientMain.m_Network.SendChatMessage(g_ClientMain.m_strWhisperChrID, g_TextEdit.GetMessage(), 10);
|
||||
if(g_ClientMain.m_bInstanceWhisper)
|
||||
{
|
||||
strcpy(g_ClientMain.m_strWhisperChrID, "");
|
||||
g_ClientMain.m_bInstanceWhisper = FALSE;
|
||||
}
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SendClientLog(1, g_TextEdit.GetMessage(), g_StringFilter.m_lpSearched);
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[570], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_dwInternationalCode || g_StringFilter.Filter(g_TextEdit.GetMessage()))
|
||||
{
|
||||
switch(g_TextEdit.m_dwChatMode)
|
||||
{
|
||||
case CHATMODE_CHAT:
|
||||
{
|
||||
char strMessage[MAX_PATH];
|
||||
unsigned long Count = 0;
|
||||
strcpy(strMessage, g_TextEdit.GetMessage());
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
if(!strcmp(g_ClientMain.m_strChatMessage[i], strMessage)) Count++;
|
||||
}
|
||||
if(Count < 2)
|
||||
{
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
strcpy(g_ClientMain.m_strChatMessage[i], g_ClientMain.m_strChatMessage[i + 1]);
|
||||
}
|
||||
strcpy(g_ClientMain.m_strChatMessage[2], strMessage);
|
||||
g_ClientMain.m_Network.SendChatMessage(NULL, strMessage, CHATMODE_CHAT);
|
||||
} else
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[104], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_PARTY:
|
||||
g_ClientMain.m_Network.SendChatMessage(NULL, g_TextEdit.GetMessage(), CHATMODE_PARTY);
|
||||
break;
|
||||
|
||||
case CHATMODE_GUILD:
|
||||
g_ClientMain.m_Network.SendChatMessage(NULL, g_TextEdit.GetMessage(), CHATMODE_GUILD);
|
||||
break;
|
||||
}
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.SendClientLog(1, g_TextEdit.GetMessage(), g_StringFilter.m_lpSearched);
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[570], g_ClientMain.m_dwMyChrID, 129);
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_bInstanceWhisper)
|
||||
{
|
||||
strcpy(g_ClientMain.m_strWhisperChrID, "");
|
||||
g_ClientMain.m_bInstanceWhisper = FALSE;
|
||||
}
|
||||
}
|
||||
g_TextEdit.InitMessage();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSimpleChat::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_CHAT)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
}
|
||||
|
||||
RECT rcRect;
|
||||
int i, count = 0;
|
||||
|
||||
if(!g_ClientMain.m_bMovieVersion)
|
||||
{
|
||||
switch(g_TextEdit.m_dwChatMode)
|
||||
{
|
||||
case CHATMODE_CHAT:
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 4, m_rcWindowSize.top + 4 + 60, m_rcWindowSize.left + 487, m_rcWindowSize.top + 4 + 15 + 60);
|
||||
for(i = g_TextEdit.m_deqChatMessage.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if(count >= 5) break;
|
||||
if(g_TextEdit.m_deqChatMessage[i]->fTimer > 0.0f)
|
||||
{
|
||||
rcRect.left++; rcRect.right++; rcRect.top++; rcRect.bottom++;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqChatMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(0, 0, 0, 255));
|
||||
rcRect.left--; rcRect.right--; rcRect.top--; rcRect.bottom--;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqChatMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, g_TextEdit.m_deqChatMessage[i]->dwColor);
|
||||
|
||||
rcRect.top -= 15;
|
||||
rcRect.bottom = rcRect.top + 15;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_PARTY:
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 4, m_rcWindowSize.top + 4 + 60, m_rcWindowSize.left + 487, m_rcWindowSize.top + 4 + 15 + 60);
|
||||
for(i = g_TextEdit.m_deqPartyMessage.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if(count >= 5) break;
|
||||
if(g_TextEdit.m_deqPartyMessage[i]->fTimer > 0.0f)
|
||||
{
|
||||
rcRect.left++; rcRect.right++; rcRect.top++; rcRect.bottom++;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqPartyMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(0, 0, 0, 255));
|
||||
rcRect.left--; rcRect.right--; rcRect.top--; rcRect.bottom--;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqPartyMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, g_TextEdit.m_deqPartyMessage[i]->dwColor);
|
||||
|
||||
rcRect.top -= 15;
|
||||
rcRect.bottom = rcRect.top + 15;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CHATMODE_GUILD:
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 4, m_rcWindowSize.top + 4 + 60, m_rcWindowSize.left + 487, m_rcWindowSize.top + 4 + 15 + 60);
|
||||
for(i = g_TextEdit.m_deqGuildMessage.size() - 1; i >= 0; i--)
|
||||
{
|
||||
if(count >= 5) break;
|
||||
if(g_TextEdit.m_deqGuildMessage[i]->fTimer > 0.0f)
|
||||
{
|
||||
rcRect.left++; rcRect.right++; rcRect.top++; rcRect.bottom++;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqGuildMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(0, 0, 0, 255));
|
||||
rcRect.left--; rcRect.right--; rcRect.top--; rcRect.bottom--;
|
||||
g_TextEdit.DrawText(g_TextEdit.m_deqGuildMessage[i]->strMessage, &rcRect, DT_LEFT | DT_VCENTER, g_TextEdit.m_deqGuildMessage[i]->dwColor);
|
||||
|
||||
rcRect.top += 15;
|
||||
rcRect.bottom = rcRect.top + 15;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_TextEdit.IsFocus() && g_TextEdit.m_dwEditMode == EDITMODE_CHAT)
|
||||
{
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 112, m_rcWindowSize.top + 83, m_rcWindowSize.left + 501, m_rcWindowSize.top + 98);
|
||||
if(g_ClientMain.m_bCursorToggle)
|
||||
{
|
||||
char strChat[MAX_PATH];
|
||||
sprintf(strChat, "%s_", g_TextEdit.GetMessage());
|
||||
g_TextEdit.DrawText(strChat, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(g_TextEdit.GetMessage(), &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
if(strcmp(g_ClientMain.m_strWhisperChrID, ""))
|
||||
{
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 30, m_rcWindowSize.top + 83, m_rcWindowSize.left + 107, m_rcWindowSize.top + 98);
|
||||
g_TextEdit.DrawText(g_ClientMain.m_strWhisperChrID, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
27
GameTools/NeoRylClient/HumanSimpleChat.h
Normal file
27
GameTools/NeoRylClient/HumanSimpleChat.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanSimpleChat.h: interface for the CHumanSimpleChat class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANSIMPLECHAT_H__B80E393B_B89F_4B32_A9EC_A77555C464D9__INCLUDED_)
|
||||
#define AFX_HUMANSIMPLECHAT_H__B80E393B_B89F_4B32_A9EC_A77555C464D9__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanSimpleChat : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanSimpleChat();
|
||||
virtual ~CHumanSimpleChat();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void) { }
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANSIMPLECHAT_H__B80E393B_B89F_4B32_A9EC_A77555C464D9__INCLUDED_)
|
||||
177
GameTools/NeoRylClient/HumanSimpleParty.cpp
Normal file
177
GameTools/NeoRylClient/HumanSimpleParty.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
// HumanSimpleParty.cpp: implementation of the CHumanSimpleParty class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "HumanSimpleParty.h"
|
||||
#include "CharacterControl.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanSimpleParty::CHumanSimpleParty()
|
||||
{
|
||||
}
|
||||
|
||||
CHumanSimpleParty::~CHumanSimpleParty()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleParty::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, 0, 0, 0, 126, 22, g_ClientMain.m_lpInterface->m_lstTexture[28]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // HP
|
||||
lpSprite->Create(x + 99, 5, 32, 22, 53, 26, g_ClientMain.m_lpInterface->m_lstTexture[28]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // MP
|
||||
lpSprite->Create(x + 99, 10, 32, 26, 53, 30, g_ClientMain.m_lpInterface->m_lstTexture[28]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // Àå½Ä
|
||||
lpSprite->Create(x + 76, 0, 76, 22, 126, 58, g_ClientMain.m_lpInterface->m_lstTexture[28]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 126; m_rcWindowSize.bottom = y + 22;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 126; m_rcMoveEdge.bottom = y + 22;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSimpleParty::InitValue(void)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleParty::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSimpleParty::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
RECT rcRect;
|
||||
CCreature *lpCreature;
|
||||
char strTempName[16], strDot[4] = "...";
|
||||
unsigned long lengthDot = g_TextEdit.GetStringLength(strDot);
|
||||
int count = 1;
|
||||
|
||||
for(int i = 0; i < g_ClientMain.m_csStatus.m_PartyInfo.m_cMemberNum; i++)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_PartyInfo.ServerID[i])
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_PartyInfo.MemberCID[i] == g_ClientMain.m_dwMyChrID)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, 0xFF, 0, 0);
|
||||
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 3, 0, m_rcWindowSize.left + 93, 22);
|
||||
if(g_TextEdit.GetStringLength(g_ClientMain.m_csStatus.m_PartyInfo.Name[i]) > 90)
|
||||
{
|
||||
int nNumUnicode = 0;
|
||||
for(int j = 0; j < 15; j++)
|
||||
{
|
||||
strTempName[j] = g_ClientMain.m_csStatus.m_PartyInfo.Name[i][j];
|
||||
strTempName[j + 1] = '\0';
|
||||
if(strTempName[j] & 0x80) nNumUnicode++;
|
||||
if(g_TextEdit.GetStringLength(strTempName) + lengthDot > 90)
|
||||
{
|
||||
if(nNumUnicode % 2)
|
||||
{
|
||||
memcpy(&strTempName[j], strDot, 4);
|
||||
} else
|
||||
{
|
||||
memcpy(&strTempName[j - 1], strDot, 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_TextEdit.DrawText(strTempName, &rcRect, DT_VCENTER | DT_LEFT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(g_ClientMain.m_csStatus.m_PartyInfo.Name[i], &rcRect, DT_VCENTER | DT_LEFT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
m_lstSprite[1]->SetRate(g_ClientMain.m_csStatus.m_Info.HP / (float)g_ClientMain.m_csStatus.m_MaxHP);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, 0xFF, 0, 0);
|
||||
m_lstSprite[2]->SetRate(g_ClientMain.m_csStatus.m_Info.MP / (float)g_ClientMain.m_csStatus.m_MaxMP);
|
||||
m_lstSprite[2]->Render(lpD3DDevice, 0xFF, 0, 0);
|
||||
} else
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, 0xFF, 0, count * 22);
|
||||
|
||||
SetRect(&rcRect, m_rcWindowSize.left + 3, count * 22, m_rcWindowSize.left + 93, count * 22 + 22);
|
||||
if(g_TextEdit.GetStringLength(g_ClientMain.m_csStatus.m_PartyInfo.Name[i]) > 90)
|
||||
{
|
||||
int nNumUnicode = 0;
|
||||
for(int j = 0; j < 15; j++)
|
||||
{
|
||||
strTempName[j] = g_ClientMain.m_csStatus.m_PartyInfo.Name[i][j];
|
||||
strTempName[j + 1] = '\0';
|
||||
if(strTempName[j] & 0x80) nNumUnicode++;
|
||||
if(g_TextEdit.GetStringLength(strTempName) + lengthDot > 90)
|
||||
{
|
||||
if(nNumUnicode % 2)
|
||||
{
|
||||
memcpy(&strTempName[j], strDot, 4);
|
||||
} else
|
||||
{
|
||||
memcpy(&strTempName[j - 1], strDot, 4);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_TextEdit.DrawText(strTempName, &rcRect, DT_VCENTER | DT_LEFT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
} else
|
||||
{
|
||||
g_TextEdit.DrawText(g_ClientMain.m_csStatus.m_PartyInfo.Name[i], &rcRect, DT_VCENTER | DT_LEFT, D3DCOLOR_RGBA(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
lpCreature = g_CharacterData.GetCreature(g_ClientMain.m_csStatus.m_PartyInfo.MemberCID[i]);
|
||||
if(lpCreature)
|
||||
{
|
||||
if(lpCreature->m_wMaxHP != 0)
|
||||
{
|
||||
m_lstSprite[1]->SetRate(lpCreature->m_sCurrHP / (float)lpCreature->m_wMaxHP);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, 0xFF, 0, count * 22);
|
||||
}
|
||||
if(lpCreature->m_wMaxMP != 0)
|
||||
{
|
||||
m_lstSprite[2]->SetRate(lpCreature->m_sCurrMP / (float)lpCreature->m_wMaxMP);
|
||||
m_lstSprite[2]->Render(lpD3DDevice, 0xFF, 0, count * 22);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(g_ClientMain.m_csStatus.m_PartyInfo.m_cMemberNum)
|
||||
m_lstSprite[3]->Render(lpD3DDevice, 0xFF, 0, count * 22);
|
||||
else
|
||||
m_lstSprite[3]->Render(lpD3DDevice, 0xFF, 0, 0);
|
||||
}
|
||||
27
GameTools/NeoRylClient/HumanSimpleParty.h
Normal file
27
GameTools/NeoRylClient/HumanSimpleParty.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanSimpleParty.h: interface for the CHumanSimpleParty class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANSIMPLEPARTY_H__1907D8DB_2EE3_4534_901E_DF000FFAE1BE__INCLUDED_)
|
||||
#define AFX_HUMANSIMPLEPARTY_H__1907D8DB_2EE3_4534_901E_DF000FFAE1BE__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanSimpleParty : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanSimpleParty();
|
||||
virtual ~CHumanSimpleParty();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANSIMPLEPARTY_H__1907D8DB_2EE3_4534_901E_DF000FFAE1BE__INCLUDED_)
|
||||
153
GameTools/NeoRylClient/HumanSimpleWindow.cpp
Normal file
153
GameTools/NeoRylClient/HumanSimpleWindow.cpp
Normal file
@@ -0,0 +1,153 @@
|
||||
// HumanSimpleWindow.cpp: implementation of the CHumanSimpleWindow class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanSimpleWindow.h"
|
||||
#include "WinInput.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanSimpleWindow::CHumanSimpleWindow()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanSimpleWindow::~CHumanSimpleWindow()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleWindow::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 40, 2, 80, 156, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // HP
|
||||
lpSprite->Create(x + 3, y + 9, 82, 0, 92, 136, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpSprite->SetDirection(FALSE);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // MP
|
||||
lpSprite->Create(x + 18, y + 9, 92, 0, 102, 136, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpSprite->SetDirection(FALSE);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // EXP
|
||||
lpSprite->Create(x + 34, y + 9, 102, 0, 104, 136, g_ClientMain.m_lpInterface->m_lstTexture[26]);
|
||||
lpSprite->SetDirection(FALSE);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUITooltipButton *lpTooltip;
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[207]);
|
||||
lpTooltip->SetRect(3, 8, 12, 144);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[208]);
|
||||
lpTooltip->SetRect(17, 8, 27, 144);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
lpTooltip = new CGUITooltipButton;
|
||||
lpTooltip->InitTooltip(g_StringTable.m_strString[209]);
|
||||
lpTooltip->SetRect(33, 8, 35, 144);
|
||||
m_TooltipManager.AddTooltip(lpTooltip);
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 40; m_rcWindowSize.bottom = y + 155;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 40; m_rcMoveEdge.bottom = y + 155;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSimpleWindow::InitValue(void)
|
||||
{
|
||||
}
|
||||
|
||||
BOOL CHumanSimpleWindow::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
char strString[MAX_PATH];
|
||||
|
||||
sprintf(strString, "%d / %d", g_ClientMain.m_csStatus.m_Info.HP, g_ClientMain.m_csStatus.m_MaxHP + g_ClientMain.m_csStatus.m_lAddMaxHP);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[0])->InitTooltip(strString);
|
||||
m_lstSprite[1]->SetRate((float)g_ClientMain.m_csStatus.m_Info.HP / (float)(g_ClientMain.m_csStatus.m_MaxHP + g_ClientMain.m_csStatus.m_lAddMaxHP));
|
||||
|
||||
sprintf(strString, "%d / %d", g_ClientMain.m_csStatus.m_Info.MP, g_ClientMain.m_csStatus.m_MaxMP + g_ClientMain.m_csStatus.m_lAddMaxMP);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[1])->InitTooltip(strString);
|
||||
m_lstSprite[2]->SetRate((float)g_ClientMain.m_csStatus.m_Info.MP / (float)(g_ClientMain.m_csStatus.m_MaxMP + g_ClientMain.m_csStatus.m_lAddMaxMP));
|
||||
|
||||
unsigned long dwExp, dwExpMax;
|
||||
char strExp[2], strExpMax[2];
|
||||
if(1000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000;
|
||||
strcpy(strExp, "K");
|
||||
} else if(1000000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000000;
|
||||
strcpy(strExp, "M");
|
||||
} else if(1000000000000 < g_ClientMain.m_csStatus.m_Info.Exp && g_ClientMain.m_csStatus.m_Info.Exp <= 1000000000000000)
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp / 1000000000;
|
||||
strcpy(strExp, "T");
|
||||
} else
|
||||
{
|
||||
dwExp = g_ClientMain.m_csStatus.m_Info.Exp;
|
||||
strcpy(strExp, "");
|
||||
}
|
||||
if(1000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000;
|
||||
strcpy(strExpMax, "K");
|
||||
} else if(1000000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000000;
|
||||
strcpy(strExpMax, "M");
|
||||
} else if(1000000000000 < g_ClientMain.m_csStatus.m_llExpMax && g_ClientMain.m_csStatus.m_llExpMax <= 1000000000000000)
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax / 1000000000;
|
||||
strcpy(strExpMax, "T");
|
||||
} else
|
||||
{
|
||||
dwExpMax = g_ClientMain.m_csStatus.m_llExpMax;
|
||||
strcpy(strExpMax, "");
|
||||
}
|
||||
sprintf(strString, "%d%s / %d%s", dwExp, strExp, dwExpMax, strExpMax);
|
||||
((CGUITooltipButton *)m_TooltipManager.m_lstTooltip[2])->InitTooltip(strString);
|
||||
m_lstSprite[3]->SetRate((double)g_ClientMain.m_csStatus.m_Info.Exp / (double)g_ClientMain.m_csStatus.m_llExpMax);
|
||||
|
||||
m_TooltipManager.Update(m_rcWindowSize.left, m_rcWindowSize.top);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSimpleWindow::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice);
|
||||
m_lstSprite[1]->Render(lpD3DDevice);
|
||||
m_lstSprite[2]->Render(lpD3DDevice);
|
||||
m_lstSprite[3]->Render(lpD3DDevice);
|
||||
}
|
||||
27
GameTools/NeoRylClient/HumanSimpleWindow.h
Normal file
27
GameTools/NeoRylClient/HumanSimpleWindow.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// HumanSimpleWindow.h: interface for the CHumanSimpleWindow class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_HUMANSIMPLEWINDOW_H__64E2F619_F9EA_4DB5_A6C7_CE23A8ACF545__INCLUDED_)
|
||||
#define AFX_HUMANSIMPLEWINDOW_H__64E2F619_F9EA_4DB5_A6C7_CE23A8ACF545__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include "GUIWindow.h"
|
||||
|
||||
class CHumanSimpleWindow : public CGUIWindow
|
||||
{
|
||||
public:
|
||||
CHumanSimpleWindow();
|
||||
~CHumanSimpleWindow();
|
||||
|
||||
BOOL Init(unsigned short x, unsigned short y);
|
||||
void InitValue(void);
|
||||
BOOL Update(BOOL &bClick, BOOL &bEdge);
|
||||
void ShowWindow(BOOL bShow) { }
|
||||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_HUMANSIMPLEWINDOW_H__64E2F619_F9EA_4DB5_A6C7_CE23A8ACF545__INCLUDED_)
|
||||
607
GameTools/NeoRylClient/HumanSkill.cpp
Normal file
607
GameTools/NeoRylClient/HumanSkill.cpp
Normal file
@@ -0,0 +1,607 @@
|
||||
// HumanSkill.cpp: implementation of the CHumanSkill class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "ClientMain.h"
|
||||
#include "HumanSkill.h"
|
||||
#include "GUITextEdit.h"
|
||||
#include "WinInput.h"
|
||||
#include "GUIMessageBox.h"
|
||||
|
||||
#include "Skill\SkillMgr.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CHumanSkill::CHumanSkill()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CHumanSkill::~CHumanSkill()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CHumanSkill::InitValue(void)
|
||||
{
|
||||
m_bSkillUnLock = FALSE;
|
||||
m_dwStartSlot = 0;
|
||||
m_dwLockResult = 0;
|
||||
m_dwEraseResult = 0;
|
||||
m_dwUnLockResult = 0;
|
||||
m_dwProcessSkillIndex = 0;
|
||||
}
|
||||
|
||||
BOOL CHumanSkill::Init(unsigned short x, unsigned short y)
|
||||
{
|
||||
CSprite *lpSprite;
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[6]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(x, y + 256, 0, 0, 222, 224, g_ClientMain.m_lpInterface->m_lstTexture[7]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 백판
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 0, 0, 193, 53, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 슬롯 감추기
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 80, 106, 161, 115, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// 스킬 게이지
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 70, 106, 80, 111, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// INSTANT
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 193, 36, 235, 47, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// PASSIVE
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 193, 47, 235, 58, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// CHANT
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 193, 58, 235, 69, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
// CAST
|
||||
lpSprite = new CSprite;
|
||||
lpSprite->Create(0, 0, 193, 69, 235, 80, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
CGUIButton *lpButton;
|
||||
for(int i = 0; i < 7; i++)
|
||||
{
|
||||
// 1
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(155, 74 + i * 53, 0, 106, 35, 123, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(155, 74 + i * 53, 0, 123, 35, 140, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(155, 95 + i * 53, 35, 106, 70, 123, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(155, 95 + i * 53, 35, 123, 70, 140, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
}
|
||||
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(190, 1, 0, 0, 28, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(190, 1, 28, 0, 56, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
||||
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[210]);
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
|
||||
for(i = 0; i < 7; i++)
|
||||
{
|
||||
lpButton = new CGUIButton;
|
||||
lpButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpButton->m_lpNormalButton = new CSprite;
|
||||
lpButton->m_lpNormalButton->Create(153, 78 + i * 53, 0, 140, 42, 169, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->m_lpClickMouseButton = new CSprite;
|
||||
lpButton->m_lpClickMouseButton->Create(153, 78 + i * 53, 42, 140, 84, 169, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpButton->SetTooltip(&m_TooltipManager, "");
|
||||
lpButton->SetMove(x, y);
|
||||
m_ButtonManager.AddButton(lpButton);
|
||||
}
|
||||
|
||||
CGUIScroll *lpScroll;
|
||||
lpScroll = new CGUIScroll;
|
||||
lpScroll->m_lpBarButton = new CGUIButton;
|
||||
lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpNormalButton->Create(206, 71, 228, 0, 239, 20, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(206, 71, 228, 0, 239, 20, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
|
||||
lpScroll->m_lpUpArrowButton = new CGUIButton;
|
||||
lpScroll->m_lpUpArrowButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpUpArrowButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpUpArrowButton->m_lpNormalButton->Create(206, 62, 243, 2, 254, 12, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton->Create(206, 62, 243, 14, 254, 24, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
|
||||
lpScroll->m_lpDownArrowButton = new CGUIButton;
|
||||
lpScroll->m_lpDownArrowButton->m_nMethod = BUTTON_SIMPLE;
|
||||
lpScroll->m_lpDownArrowButton->m_lpNormalButton = new CSprite;
|
||||
lpScroll->m_lpDownArrowButton->m_lpNormalButton->Create(206, 431, 243, 26, 254, 36, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton = new CSprite;
|
||||
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton->Create(206, 431, 243, 40, 254, 50, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
||||
|
||||
lpScroll->m_lValue = (long *)&m_dwStartSlot;
|
||||
lpScroll->SetMove(x, y);
|
||||
lpScroll->SetPosition(206, 73);
|
||||
lpScroll->SetEdge(0, 0, 10, 338);
|
||||
lpScroll->SetRange(0, 0);
|
||||
m_lstScroll.push_back(lpScroll);
|
||||
|
||||
m_bShow = FALSE;
|
||||
|
||||
m_dwWindowKind = WINDOW_FIX;
|
||||
|
||||
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
||||
m_rcWindowSize.right = x + 222; m_rcWindowSize.bottom = y + 480;
|
||||
|
||||
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
||||
m_rcMoveEdge.right = x + 150; m_rcMoveEdge.bottom = y + 20;
|
||||
|
||||
InitValue();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CHumanSkill::Update(BOOL &bClick, BOOL &bEdge)
|
||||
{
|
||||
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
||||
{
|
||||
bEdge = TRUE;
|
||||
|
||||
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
||||
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
||||
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
||||
{
|
||||
bClick = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
m_ButtonManager.Update();
|
||||
m_TooltipManager.Update();
|
||||
|
||||
//////// 스킬 락
|
||||
if(m_dwLockResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_Network.m_pSocket->CharSkillLock(g_ClientMain.m_dwMyChrID,
|
||||
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
||||
m_dwProcessSkillIndex);
|
||||
|
||||
m_dwLockResult = 0;
|
||||
return TRUE;
|
||||
} else if(m_dwLockResult & MB_NO || m_dwLockResult & MB_EXIT)
|
||||
{
|
||||
m_dwLockResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////// 스킬 지우기
|
||||
if(m_dwEraseResult & MB_YES)
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_SKILLERASE;
|
||||
g_ClientMain.m_Network.m_pSocket->CharSkillErase(g_ClientMain.m_dwMyChrID,
|
||||
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
||||
m_dwProcessSkillIndex);
|
||||
|
||||
m_dwEraseResult = 0;
|
||||
return TRUE;
|
||||
} else if(m_dwEraseResult & MB_NO || m_dwEraseResult & MB_EXIT)
|
||||
{
|
||||
m_dwEraseResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////// 스킬 락 해제
|
||||
if(m_dwUnLockResult & MB_YES)
|
||||
{
|
||||
unsigned short wForgotStone = 9914;
|
||||
CItemInstance *lpItem = g_ClientMain.m_csStatus.GetInventoryItemfromID(wForgotStone);
|
||||
|
||||
if(lpItem)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Info.Level * 10000 > g_ClientMain.m_csStatus.m_Info.Gold)
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[216]);
|
||||
} else
|
||||
{
|
||||
g_ClientMain.m_Network.m_nsNetworkState = NS_SKILLUNLOCK;
|
||||
g_ClientMain.m_Network.m_pSocket->CharSkillUnLock(g_ClientMain.m_dwMyChrID,
|
||||
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
||||
m_dwProcessSkillIndex, &lpItem->m_lpItemBase->GetPos());
|
||||
}
|
||||
} else
|
||||
{
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[217]);
|
||||
}
|
||||
|
||||
m_dwUnLockResult = 0;
|
||||
return TRUE;
|
||||
} else if(m_dwEraseResult & MB_NO || m_dwEraseResult & MB_EXIT)
|
||||
{
|
||||
m_dwUnLockResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/////////////// 스크롤 부분
|
||||
if((g_ClientMain.m_csStatus.m_lstClassSkill.size() + g_ClientMain.m_csStatus.m_Skill.wSlotNum) < 7)
|
||||
m_lstScroll[0]->SetRange(0, 0);
|
||||
else
|
||||
m_lstScroll[0]->SetRange(0, (g_ClientMain.m_csStatus.m_lstClassSkill.size() + g_ClientMain.m_csStatus.m_Skill.wSlotNum) - 7);
|
||||
m_lstScroll[0]->Update();
|
||||
|
||||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||||
|
||||
long lStartSkill;
|
||||
if(m_dwStartSlot < g_ClientMain.m_csStatus.m_lstClassSkill.size())
|
||||
{
|
||||
lStartSkill = 0;
|
||||
} else
|
||||
{
|
||||
lStartSkill = m_dwStartSlot - g_ClientMain.m_csStatus.m_lstClassSkill.size();
|
||||
}
|
||||
|
||||
unsigned long dwSlot = 0;
|
||||
for(unsigned long i = m_dwStartSlot; i < g_ClientMain.m_csStatus.m_lstClassSkill.size(); i++)
|
||||
{
|
||||
if(dwSlot < 7)
|
||||
{
|
||||
dwSlot++;
|
||||
} else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
lStartSkill -= dwSlot;
|
||||
/* for(i = 0 + lStartSkill; i < 7 + lStartSkill; i++)
|
||||
{
|
||||
if(dwSlot < 7)
|
||||
{
|
||||
RenderSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstSkillSlot[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
||||
dwSlot++;
|
||||
} else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
|
||||
unsigned long dwFunction;
|
||||
if(!g_ClientMain.CheckStillCasting(dwFunction))
|
||||
{
|
||||
for(long i = 0; i < 7; i++)
|
||||
{
|
||||
if(m_ButtonManager.m_lstButton[i * 2]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cSkillLevel < 6)
|
||||
{
|
||||
// 스킬이 부족합니다.
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[211]);
|
||||
} else
|
||||
{
|
||||
// Yes / No 창 뜨기
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[212], MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwLockResult);
|
||||
m_dwLockResult = 0;
|
||||
m_dwProcessSkillIndex = i + lStartSkill;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[1 + i * 2]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cSkillLevel)
|
||||
{
|
||||
// Yes / No 창 뜨기
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[213], MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwEraseResult);
|
||||
m_dwEraseResult = 0;
|
||||
m_dwProcessSkillIndex = i + lStartSkill;
|
||||
} else
|
||||
{
|
||||
// 스킬이 부족합니다.
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[214]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} else if(m_ButtonManager.m_lstButton[15 + i]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cLockCount)
|
||||
{
|
||||
// Yes / No 창 뜨기
|
||||
char strText[MAX_PATH];
|
||||
unsigned long dwGold = g_ClientMain.m_csStatus.m_Info.Level * 10000;
|
||||
sprintf(strText, g_StringTable.m_strString[218], dwGold);
|
||||
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(strText, MB_YES | MB_NO | MB_EXIT);
|
||||
lpMessageBox->SetResult(&m_dwUnLockResult);
|
||||
m_dwUnLockResult = 0;
|
||||
m_dwProcessSkillIndex = i + lStartSkill;
|
||||
} else
|
||||
{
|
||||
// 락 된 스킬이 없습니다.
|
||||
CGUIMessageBox *lpMessageBox;
|
||||
lpMessageBox = new CGUIMessageBox;
|
||||
lpMessageBox->Create(g_StringTable.m_strString[219]);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} else if(g_DeviceInput.GetIsLeftMouseDown())
|
||||
{
|
||||
if(i < dwSlot)
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i] &&
|
||||
g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]->IsOverMouse() &&
|
||||
!g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
const Skill::ProtoType *lpProtoType = g_SkillMgr.g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]->GetProtoTypeID());
|
||||
|
||||
if(lpProtoType)
|
||||
{
|
||||
if(lpProtoType->m_eSkillType != Skill::Type::PASSIVE)
|
||||
{
|
||||
g_ClientMain.m_lpPickItem = new CItemInstance;
|
||||
g_ClientMain.m_lpPickItem->SetSkillInfo(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]);
|
||||
g_ClientMain.SetPickItem(g_ClientMain.m_lpPickItem);
|
||||
|
||||
return TRUE;
|
||||
} else
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[215], g_ClientMain.m_dwMyChrID, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
if(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill] && g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]->IsOverMouse() && !g_ClientMain.m_lpPickItem)
|
||||
{
|
||||
const Skill::ProtoType *lpProtoType = g_SkillMgr.g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]->GetProtoTypeID());
|
||||
|
||||
if(lpProtoType)
|
||||
{
|
||||
if(lpProtoType->m_eSkillType != Skill::Type::PASSIVE)
|
||||
{
|
||||
g_ClientMain.m_lpPickItem = new CItemInstance;
|
||||
g_ClientMain.m_lpPickItem->SetSkillInfo(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]);
|
||||
g_ClientMain.SetPickItem(g_ClientMain.m_lpPickItem);
|
||||
|
||||
return TRUE;
|
||||
} else
|
||||
{
|
||||
g_TextEdit.AddMessage(g_StringTable.m_strString[215], g_ClientMain.m_dwMyChrID, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(m_ButtonManager.m_lstButton[14]->m_nState == BUTTON_CLICK)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[14]->m_nState = BUTTON_NONE;
|
||||
m_bShow = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void CHumanSkill::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||||
{
|
||||
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
for(int i = 0; i < 7; i++)
|
||||
{
|
||||
m_ButtonManager.m_lstButton[i * 2]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[1 + i * 2]->ShowButton(FALSE);
|
||||
m_ButtonManager.m_lstButton[15 + i]->ShowButton(FALSE);
|
||||
}
|
||||
|
||||
long lStartSkill;
|
||||
if(m_dwStartSlot < g_ClientMain.m_csStatus.m_lstClassSkill.size())
|
||||
{
|
||||
lStartSkill = 0;
|
||||
} else
|
||||
{
|
||||
lStartSkill = m_dwStartSlot - g_ClientMain.m_csStatus.m_lstClassSkill.size();
|
||||
}
|
||||
|
||||
unsigned long dwSlot = 0;
|
||||
for(i = m_dwStartSlot; i < g_ClientMain.m_csStatus.m_lstClassSkill.size(); i++)
|
||||
{
|
||||
if(dwSlot < 7)
|
||||
{
|
||||
RenderClassSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstClassSkill[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
||||
dwSlot++;
|
||||
} else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0 + lStartSkill; i < 7 + lStartSkill; i++)
|
||||
{
|
||||
if(dwSlot < 7)
|
||||
{
|
||||
RenderSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstSkillSlot[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
||||
dwSlot++;
|
||||
} else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RECT rcRect;
|
||||
char strString[MAX_PATH];
|
||||
// 현재 스킬수
|
||||
SetRect(&rcRect, 100 + m_rcWindowSize.left, 35 + m_rcWindowSize.top, 124 + m_rcWindowSize.left, 47 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Skill.wSkillNum);
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
// 레벨
|
||||
long lINT = (((g_ClientMain.m_csStatus.m_Info.INT + g_ClientMain.m_csStatus.m_lAddINT) - 20) / 10.0f);
|
||||
if(lINT < 0 ) lINT = 0;
|
||||
SetRect(&rcRect, 132 + m_rcWindowSize.left, 35 + m_rcWindowSize.top, 155 + m_rcWindowSize.left, 47 + m_rcWindowSize.top);
|
||||
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Info.Level + lINT);
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
m_lstScroll[0]->Render(lpD3DDevice, m_cAlpha);
|
||||
|
||||
m_ButtonManager.Render(lpD3DDevice);
|
||||
}
|
||||
|
||||
void CHumanSkill::RenderClassSlot(LPDIRECT3DDEVICE8 lpD3DDevice, CItemInstance *lpSkill, long lSlot, unsigned char cAlpha, long lMoveX, long lMoveY)
|
||||
{
|
||||
if(lpSkill)
|
||||
{
|
||||
m_lstSprite[2]->Render(lpD3DDevice, cAlpha, lMoveX, lMoveY);
|
||||
|
||||
RECT rcRect;
|
||||
char strString[MAX_PATH];
|
||||
|
||||
lpSkill->m_wPutX = lMoveX + 9;
|
||||
lpSkill->m_wPutY = lMoveY + 5;
|
||||
lpSkill->Render(lpD3DDevice);
|
||||
|
||||
// 스킬 이름
|
||||
SetRect(&rcRect, 50 + lMoveX, 7 + lMoveY, 135 + lMoveX, 20 + lMoveY);
|
||||
strcpy(strString, lpSkill->GetItemInfo().m_SpriteData.m_szName);
|
||||
if(strlen(strString) > 13)
|
||||
{
|
||||
strString[13] = '.';
|
||||
strString[14] = '.';
|
||||
strString[15] = '.';
|
||||
strString[16] = '\0';
|
||||
}
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
m_lstSprite[3]->Render(lpD3DDevice, cAlpha, 63 + lMoveX, 42 + lMoveY);
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanSkill::RenderSlot(LPDIRECT3DDEVICE8 lpD3DDevice, CItemInstance *lpSkill, long lSlot, unsigned char cAlpha, long lMoveX, long lMoveY)
|
||||
{
|
||||
if(lpSkill)
|
||||
{
|
||||
m_lstSprite[2]->Render(lpD3DDevice, cAlpha, lMoveX, lMoveY);
|
||||
/* switch(GetSkillClass(CGameData::m_Status.m_Skill.SSlot[nSkillSlot + m_StartSkillSlot].SKILLINFO.wSkill))
|
||||
{
|
||||
case SKILL_PASSIVE:
|
||||
RenderSprite(m_FramePassive, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
||||
break;
|
||||
|
||||
case SKILL_INSTANCE:
|
||||
RenderSprite(m_FrameInstance, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
||||
break;
|
||||
|
||||
case SKILL_CHANT:
|
||||
RenderSprite(m_FrameChant, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
||||
break;
|
||||
|
||||
case SKILL_CAST:
|
||||
RenderSprite(m_FrameCast, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
||||
break;
|
||||
}*/
|
||||
|
||||
// int nSkillPos = GetSkillPos(CGameData::m_Status.m_Skill.SSlot[nSkillSlot + m_StartSkillSlot].SKILLINFO.wSkill);
|
||||
RECT rcRect;
|
||||
char strString[MAX_PATH];
|
||||
|
||||
if(lpSkill)
|
||||
{
|
||||
lpSkill->m_wPutX = lMoveX + 9;
|
||||
lpSkill->m_wPutY = lMoveY + 5;
|
||||
lpSkill->Render(lpD3DDevice);
|
||||
|
||||
// 스킬 이름
|
||||
SetRect(&rcRect, 50 + lMoveX, 7 + lMoveY, 135 + lMoveX, 20 + lMoveY);
|
||||
strcpy(strString, lpSkill->GetItemInfo().m_SpriteData.m_szName);
|
||||
if(strlen(strString) > 13)
|
||||
{
|
||||
strString[13] = '.';
|
||||
strString[14] = '.';
|
||||
strString[15] = '.';
|
||||
strString[16] = '\0';
|
||||
}
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
}
|
||||
|
||||
if(lpSkill)
|
||||
{
|
||||
// 스킬 레벨
|
||||
SetRect(&rcRect, 127 + lMoveX, 23 + lMoveY, 138 + lMoveX, 39 + lMoveY);
|
||||
sprintf(strString, "%d", lpSkill->GetNowDurability());
|
||||
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
||||
|
||||
for(int i = 0; i < lpSkill->GetNowDurability(); i++)
|
||||
{
|
||||
m_lstSprite[4]->Render(lpD3DDevice, cAlpha, 70 + lMoveX + i * 12, 43 + lMoveY);
|
||||
}
|
||||
|
||||
if(m_bSkillUnLock)
|
||||
{
|
||||
if(lpSkill->GetMaxDurability()) m_ButtonManager.m_lstButton[15 + lSlot]->ShowButton(TRUE);
|
||||
} else
|
||||
{
|
||||
if(lpSkill->GetNowDurability() == 6) m_ButtonManager.m_lstButton[lSlot * 2]->ShowButton(TRUE);
|
||||
if(lpSkill->GetNowDurability() != 0) m_ButtonManager.m_lstButton[1 + lSlot * 2]->ShowButton(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CHumanSkill::ShowWindow(BOOL bShow)
|
||||
{
|
||||
if(bShow)
|
||||
{
|
||||
m_bShow = TRUE;
|
||||
InitValue();
|
||||
} else
|
||||
{
|
||||
m_bShow = FALSE;
|
||||
m_bSkillUnLock = FALSE;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user