
#include "public.h"
#include "miniusercommand.h"
#include "./GameGuiManager.h"
#include "./GuiTiaoGameDlg.h"
#include "../gui/include/GuiManager.h"
#include "./Game.h"
#include "LordStrikeManager.h"
#include "LordStrikeLobby.h"
#include "./MainCharacter.h"
///////////////////////////////////////////////////////////////////////////////
#define ID_BUTTON_ROLE_DANCE   3    // 开始跳舞
#define ID_BUTTON_DANCE        4    // 停止跳舞
#define ID_BUTTON_ROLE_WABAO   5    // 开始挖宝
#define ID_BUTTON_WABAO        6    // 停止挖宝
 
#define ID_BUTTON_CLOSE        2   
///////////////////////////////////////////////////////////////////////////////

CGuiTiaoGameDlg::CGuiTiaoGameDlg()
{
	FUNCTION_BEGIN;

	m_bSmDialog = true;

	FUNCTION_END;
}
 
CGuiTiaoGameDlg::~CGuiTiaoGameDlg()
{
	FUNCTION_BEGIN;


	FUNCTION_END;
}

//创建对话框
void CGuiTiaoGameDlg::OnCreate(void)
{
	FUNCTION_BEGIN;

	CGuiDialog::OnCreate();
 
	FUNCTION_END;
}

bool CGuiTiaoGameDlg::OnGuiEvent(UINT nEvent,UINT nID,CGuiControl* pControl)
{
	FUNCTION_BEGIN;

	if(nEvent == EVENT_BUTTON_CLICKED)
	{
		switch(nID)
		{
		case ID_BUTTON_ROLE_DANCE:  // 开始跳舞
			{
				ReqStartDanceOperateCmd cmd;
				SEND_USER_CMD(cmd);
			}
			break;
		case ID_BUTTON_DANCE:  // 停止跳舞
			{
				ReqStopDanceOperateCmd cmd;
				SEND_USER_CMD(cmd);
			}
			break;
		case ID_BUTTON_ROLE_WABAO:  // 开始挖宝
			{
				ReqBeginWabaoMiniFuncCmd Cmd;
				SEND_USER_CMD(Cmd);
			}
			break;
		case ID_BUTTON_WABAO:  //停止挖宝
			{
				ReqEndWabaoMiniFuncCmd Cmd;
				SEND_USER_CMD(Cmd);
			}
			break;
		}
		SetVisible(false);
		
		return true;
	}
	return CGuiDialog::OnGuiEvent(nEvent,nID,pControl);

	FUNCTION_END;
}


void CGuiTiaoGameDlg::OnClose(void)
{
	FUNCTION_BEGIN;

	GetGameGuiManager()->m_guiTiaoGame = NULL;

	FUNCTION_END;
}
