BOOL CDisabledSystemKeyDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
	//  执行此操作
	SetIcon(m_hIcon, TRUE);			// 设置大图标
	SetIcon(m_hIcon, FALSE);		// 设置小图标

	// KeyState Class
	// 保存屏蔽按键及程序的状态
	g_pKeyState = new CKeyState;
	ASSERT(g_pKeyState);

	// 检查设置文件是否存在
	if (!g_pKeyState->IsSettingFileExist())
	{
		g_pKeyState->StandardDisable();
	}
	else
	{
		g_pKeyState->GetSetting();
	}

	//安装全局键盘钩子
	ms_hHookWnd = ::SetWindowsHookEx(WH_KEYBOARD_LL, HookProc, AfxGetInstanceHandle(), 0);
	
	if (!ms_hHookWnd)
	{
		AfxMessageBox(_T("钩子安装失败,程序无法继续运行"));
		EndDialog(1);
	}

	// 初始化远线程注入类对象
	m_pInject = new CRemoteInject();
	ASSERT(m_pInject);

	// DLL例行检查
	if (!m_pInject->IsDllFileExit())
	{
		AfxMessageBox(_T("关键DLL不存在, 程序无法继续运行!"));
		EndDialog(TRUE);
	}

	// 添加系统托盘
	m_pTray = new CTray(IDR_MAINFRAME, WM_MY_TRAY);
	ASSERT(m_pTray);
	m_uTaskMsg = m_pTray->Create(this, GetIcon(1), _T("DisabledSystemKey - 已经屏蔽"));

	// 同步复选框
	ReadyCheck();

	return TRUE;  // 除非设置了控件的焦点,否则返回 TRUE
}
int JoinGameScreen::Update(float p_dt,std::vector<UserCMD>* userCMD)
{
	MenuScreen::Update(p_dt,userCMD);
	static float t_gameTime = 0;
	t_gameTime += p_dt;

	for (int i = 0; i < 4; i++)
	{
		m_graphicHandle->UpdateSelectVehicle(p_dt,i);
		if (timeSinceLastChange[i]>0.1)
		{
			if (userCMD->at(i).aButtonPressed)
			{
				timeSinceLastChange[i] = 0;
				if (m_playerStatus[i] < READY)
				{
					m_playerStatus[i] = (PlayerStatus)(m_playerStatus[i]+1);
					m_graphicHandle->UseHud(i,m_hudIDs[m_playerStatus[i]]);
					m_graphicHandle->SetVehicleSelectionCamera(i);
				}
				
			}
			else if (userCMD->at(i).bButtonPressed)
			{
				timeSinceLastChange[i] = 0;
				if (m_playerStatus[i]>0)
				{
					m_playerStatus[i] = (PlayerStatus)(m_playerStatus[i]-1);
					m_graphicHandle->UseHud(i,m_hudIDs[m_playerStatus[i]]);
					if (m_playerStatus[i] == DISCONNECTED)
					{
						m_graphicHandle->InitializeJoinScreenCamera(i);
					}
				}
			}
			else if (userCMD->at(i).backButtonPressed)
			{
				timeSinceLastChange[i] = 0;
				m_graphicHandle->RemoveSelectionDraw();
				return GAME_SETUP_SCREEN;
			}
			if (userCMD->at(i).xButtonPressed && (m_playerStatus[i] == CHOOSE_MODELL))
			{
				timeSinceLastChange[i] = 0;
				m_playerStatus[i] = READY;
			}
		

			if (userCMD->at(i).startButtonPressed)
			{
				if (ReadyCheck(i))
				{
					SaveInfo();
					return GAME_SCREEN;
				}
			} 
		}
		if (m_playerStatus[i]==CHOOSE_MODELL)
		{
			ModellChanger(i,p_dt,userCMD);
			ColorChanger(i,p_dt,userCMD);
			TauntChanger(i,p_dt,userCMD);
		}

		m_graphicHandle->UpdateCameraVehicleSelection(i,m_whatVehicleToLookAt[i],-t_gameTime);
			
		
	}

	return JOIN_GAME_SCREEN;
}