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:
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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 7, 222, 38, g_ClientMain.m_lpInterface->m_lstTexture[23]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD><EEB1B8><EFBFBD><EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 0, 222, 31, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><>ȭ <20><><EFBFBD><EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD>谡 Ʈ<><C6AE><EFBFBD>̳<EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 93, 222, 124, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD>̳<EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 124, 222, 155, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD>̳<EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 155, 222, 186, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD>̳<EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 186, 222, 217, g_ClientMain.m_lpInterface->m_lstTexture[25]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD>̳<EFBFBD>
|
||||
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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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 <20><> #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 <20><> #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 <20><> #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 <20><> #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; // <20><><EFBFBD>谡 <20><> #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; // <20><><EFBFBD>谡 <20><> #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; // <20><><EFBFBD>谡 <20><> #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; // <20><><EFBFBD>谡 <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20>Ͻ<EFBFBD><CFBD><EFBFBD>
|
||||
lpSprite->Create(x, y + 7, 0, 31, 222, 62, g_ClientMain.m_lpInterface->m_lstTexture[44]);
|
||||
m_lstSprite.push_back(lpSprite);
|
||||
|
||||
lpSprite = new CSprite; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> #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)
|
||||
{
|
||||
// <20>Ǵ<EFBFBD>. <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
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)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD>. <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
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:;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user