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>
262 lines
13 KiB
C++
262 lines
13 KiB
C++
// 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) // <20>κ<EFBFBD><CEBA>丮
|
||
{
|
||
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) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD>
|
||
{
|
||
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);
|
||
}
|