本文整理汇总了C++中CGameSettings::UseJoystick方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameSettings::UseJoystick方法的具体用法?C++ CGameSettings::UseJoystick怎么用?C++ CGameSettings::UseJoystick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameSettings
的用法示例。
在下文中一共展示了CGameSettings::UseJoystick方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFocus
// Change in focus
void CFolderControls::OnFocus(LTBOOL bFocus)
{
CGameSettings *pSettings = g_pInterfaceMgr->GetSettings();
if (bFocus)
{
// Load the folder options from the console
m_bUseJoystick=pSettings->UseJoystick();
CFolderJoystick *pJoy = (CFolderJoystick *)m_pFolderMgr->GetFolderFromID(FOLDER_ID_JOYSTICK);
if (!pJoy->IsJoystickConfigured()) m_bUseJoystick = LTFALSE;
m_pJoystickCtrl->Enable(m_bUseJoystick);
UpdateData(LTFALSE);
}
else
{
UpdateData();
CGameSettings *pSettings = g_pInterfaceMgr->GetSettings();
pSettings->SetBoolVar("UseJoystick",m_bUseJoystick);
if (m_bUseJoystick)
{
char strJoystick[128];
memset (strJoystick, 0, 128);
LTRESULT result = g_pLTClient->GetDeviceName (DEVICETYPE_JOYSTICK, strJoystick, 127);
if (result == LT_OK)
{
char strConsole[256];
sprintf (strConsole, "EnableDevice \"%s\"", strJoystick);
g_pLTClient->RunConsoleString (strConsole);
}
else
{
pSettings->SetBoolVar("UseJoystick",LTFALSE);
}
}
// Just to be safe save the config incase anything changed...
g_pLTClient->WriteConfigFile("autoexec.cfg");
}
CBaseFolder::OnFocus(bFocus);
}