📄 channelinsystem.cpp
字号:
// LobbyScene.cpp: implementation of the CMCLobbySceneEx class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ButtonCtrl.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//static LONG g_nVolue = 0;
/* 镜父茄 康巩 迄飘
star series
*/
// 积己磊.
CMCChannelInScene::CMCChannelInScene(CDrawEx *pDraw)
:m_pDraw(pDraw)
{
InitScene();
}
// 家戈磊
CMCChannelInScene::~CMCChannelInScene()
{
if(m_pBackGround)
SAFE_RELEASE(m_pBackGround->pTex);
//滚瓢.
if(m_pButton_Refresh != NULL)
SAFE_DELETE(m_pButton_Refresh);
if(m_pButton_Exit != NULL)
SAFE_DELETE(m_pButton_Exit);
//弊贰侨 府胶飘 牧飘费
if(m_pGChannelList != NULL)
SAFE_RELEASE(m_pGChannelList);
if(m_pFonts != NULL)
SAFE_RELEASE(m_pFonts);
}
// 阿辆 函荐 檬扁拳
void CMCChannelInScene::InitScene()
{
m_pButton_Refresh = NULL;
m_pButton_Exit = NULL;
m_pGChannelList = NULL;
m_pFonts = NULL;
}
// 阿辆 单捞磐 肺爹.
bool CMCChannelInScene::LoadScene()
{
CScene::LoadingText("[ChannelListScene]...",0,500,D3DCOLOR_XRGB(0,0,0),16);
//Fonts
m_pFonts = new CMcFonts;
m_pFonts->CreateMCFont(g_pApp->GetD3dDevice(), 12, 0, false, TEXT("奔覆眉"));
// m_pDraw->LoadImageFile("data\\Lobby\\ChannelBack.png",&m_pBackGround);
m_pBackGround = m_pDraw->LoadImageFileEx("data\\Lobby\\ChannelBack.png");
//滚瓢 牧飘费
m_pButton_Refresh = new CButtonCtrl( g_pApp->GetD3dDevice(), m_pDraw );
m_pButton_Refresh->CreateButton("data\\Lobby\\ServerList\\Btn_ServerRefresh.mca",ID_BUTTON_CHANNEL_REFRESH, Three_Button);
m_pButton_Exit = new CButtonCtrl( g_pApp->GetD3dDevice(), m_pDraw );
m_pButton_Exit->CreateButton("data\\Lobby\\ServerList\\Btn_ServerExit.mca",ID_BUTTON_CHANNEL_EXIT, Three_Button);
//弊贰侨 府胶飘 牧飘费
m_pGChannelList = new CGraphicListCtrl(g_pApp->GetD3dDevice(), m_pDraw);
m_pGChannelList->CreateGraphicListBox("data\\Lobby\\ServerList\\List_Btn_Server.mca", ID_CHANNELLIST_BUTTON, Two_Button, 649, 191, 317, 40, 12, 50, 12, D3DCOLOR_ARGB(255, 255, 255, 255));
m_pGChannelList->Add_ScrollBar(0, 974, 193, 20, 445, ".\\data\\Lobby\\ServerList\\Btn_Arrow_Up.mca", ".\\data\\Lobby\\ServerList\\Btn_Arrow_Down.mca", ".\\data\\Lobby\\Scroll_Button_Mid.mca",
20, 20, m_pGChannelList->m_iViewNum);
CScene::LoadingProgress(20);
return true;
}
void CMCChannelInScene::OnLButtonUp( int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0)
{
}
else
{
if(m_pButton_Refresh->UpdateData(x,y,nFlags))
{
void *ioc;
ioc = udp_message(g_pNet->g_server_userindex[M_LOBBYSERVER], M_LOBBYSERVER, CLS_CHANNEL_REFRESH);
if(ioc)
{
//net_send(g_pNet->g_sockindex[M_LOBBYSERVER], ioc);
p2p_send(ioc, g_pNet->g_LobbyServer_IP, g_pNet->g_udp_port[M_LOBBYSERVER]); //秦寸 林家沥焊肺 流立傈价茄促
}
}
if(m_pButton_Exit->UpdateData(x,y,nFlags))
{
PostQuitMessage(0);
}
if(m_pGChannelList != NULL)
{
if(m_pGChannelList->LButtonUp(x, y, nFlags, g_pApp->m_iCurrentLayer))
{
}
}
}
}
void CMCChannelInScene::OnLButtonDown( BOOL fDoubleClick, int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
if(m_pButton_Refresh->UpdateData(x,y,nFlags))
{
}
if(m_pButton_Exit->UpdateData(x,y,nFlags))
{
}
if(m_pGChannelList != NULL)
{
if(m_pGChannelList->LButtonDown(x, y, nFlags, g_pApp->m_iCurrentLayer))
{
}
}
}
}
void CMCChannelInScene::OnRButtonUp( int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
}
}
void CMCChannelInScene::OnRButtonDown( BOOL fDoubleClick, int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
}
}
void CMCChannelInScene::OnLButtonDClick( BOOL fDoubleClick, int x, int y, UINT nkeyFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
if(m_pGChannelList != NULL)
{
int TempID = m_pGChannelList->LButtonDClick(x, y, nkeyFlags, g_pApp->m_iCurrentLayer);
if( TempID != -1)
{
list <ChannelListInfo>::iterator iter;
int i = 0;
short SelectChannelIndex = -1;
for(iter = m_pListChannelList.begin(); iter != m_pListChannelList.end(); iter++, i++)
{
if(TempID > m_pListChannelList.size())
return;
if(i == TempID)
{
ChannelListInfo *pItem = (ChannelListInfo *)&(*iter);
SelectChannelIndex = pItem->lobby_channelindex;
}
}
if(SelectChannelIndex != -1)
{
void *ioc;
ioc = net_message(M_LOBBYSERVER, CLS_CHANNEL_SELECT);
if(ioc)
{
net_packet(ioc, &SelectChannelIndex, 1);
g_pNet->g_SelectChannelIndex = SelectChannelIndex;
net_send(g_pNet->g_sockindex[M_LOBBYSERVER], ioc);
g_pApp->m_pCommonImage->m_pDialog_Notice_NoBtn->Reset_Text();
g_pApp->m_pCommonImage->m_pDialog_Notice_NoBtn->Add_ReplaceText("秦寸 盲澄狼 肺厚 沥焊甫 罐绊乐嚼聪促. 泪矫父 扁促妨 林绞矫坷.", 20, 22, 207, 66, D3DCOLOR_ARGB(255,255,255,255));
g_pApp->m_pCommonImage->m_pDialog_Notice_NoBtn->Show_Window(true);
}
}
}
}
}
}
void CMCChannelInScene::OnMouseMove( int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
}
}
void CMCChannelInScene::OnMouseWheel( int x, int y, UINT nFlags )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
}
}
void CMCChannelInScene::OnKeyDown( BYTE bVk, BYTE bScan, DWORD dwFlags, ULONG_PTR dwExtraInfo )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
switch(bVk)
{
case VK_LEFT:
break;
case VK_RIGHT:
break;
case VK_F5:
break;
}
}
}
void CMCChannelInScene::OnKeyUp( BYTE bVk, BYTE bScan, DWORD dwFlags, ULONG_PTR dwExtraInfo )
{
if(g_pApp->m_iCurrentLayer != 0) //饭捞绢 俺充篮 促捞倔肺弊 冠胶啊 剁况廉具瘤父 饭捞绢啊 积扁绰巴捞促.
{
}
else
{
}
}
void CMCChannelInScene::OnChar( UINT nChar, WPARAM wParam, LPARAM lParam)
{
if(g_pApp->m_iCurrentLayer != 0)
{
}
else
{
// m_pEditBox->OnChar(nChar, wParam, lParam);
}
}
void CMCChannelInScene::CleanupScene()
{
}
HRESULT CMCChannelInScene::InvalidateDeviceObjects()
{
return S_OK;
}
HRESULT CMCChannelInScene::RestoreDeviceObjects()
{
return S_OK;
}
void CMCChannelInScene::ProcessEvent(UINT nCtrlID, UINT nEvent, DWORD nParam)
{
}
bool CMCChannelInScene::render()
{
m_pDraw->DrawSpriteEx(*m_pBackGround, 0, 0, 255);
Draw_BottonControls();
Draw_GraphicList();
g_pApp->m_pCommonImage->m_pDialog_Notice_NoBtn->Draw_DialogBox();
return true;
}
void CMCChannelInScene::Delete_ChannelList(int Index)
{
list <ChannelListInfo>::iterator iter;
for(iter = m_pListChannelList.begin(); iter != m_pListChannelList.end(); iter++)
{
ChannelListInfo *pItem = (ChannelListInfo *)&(*iter);
if(pItem->lobby_channelindex == Index)
{
m_pListChannelList.erase(iter);
break;
}
}
}
void CMCChannelInScene::Draw_BottonControls()
{
m_pButton_Refresh->DrawButton(255, 0.0f, 649, 95);
m_pButton_Exit->DrawButton(255, 0.0f, 879, 95);
}
void CMCChannelInScene::Draw_GraphicList()
{
m_pGChannelList->Draw_GraphicListBox();
}
LRESULT CMCChannelInScene::SceneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_KEYDOWN:
{
if(wParam == VK_F5)
{
void *ioc;
ioc = udp_message(g_pNet->g_server_userindex[M_LOBBYSERVER], M_LOBBYSERVER, CLS_CHANNEL_REFRESH);
if(ioc)
{
net_send(g_pNet->g_sockindex[M_LOBBYSERVER], ioc);
// p2p_send(ioc, inet_addr(g_pApp->m_strServerIp), g_pNet->g_udp_port[M_MASTERSERVER]); //秦寸 林家沥焊肺 流立傈价茄促
}
}
break;
}
break;
case WM_CHAR:
{
if(wParam == VK_SPACE)
{
}
if(wParam == VK_RETURN) //咯扁辑 器目胶 包访 累诀档 秦具登绰单
{
}
}
break;
case WM_MOUSEWHEEL:
{
switch(wParam)
{
case WM_WHEEL_UP: // 荣 诀
{
m_pGChannelList->m_pScrollBar->UpList(1);
}
break;
case WM_WHEEL_DOWN://荣 促款
{
m_pGChannelList->m_pScrollBar->DownList(1);
}
break;
}
}
break;
}
return DefWindowProc( hWnd, uMsg, wParam, lParam );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -