mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-19 08:50:48 +00:00
Wiimote: Fixed crash that would occur if no gamepad was detected
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2211 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
c1214d2026
commit
5ba51ed789
3 changed files with 20 additions and 5 deletions
|
@ -1143,9 +1143,21 @@ void ConfigDialog::UpdateGUI(int Slot)
|
|||
m_UseRealWiimote[Page]->Enable((m_bEnableUseRealWiimote && g_RealWiiMotePresent && g_Config.bConnectRealWiimote) || !g_EmulatorRunning);
|
||||
|
||||
// Linux has no FindItem()
|
||||
// Disable all pad items if no pads are detected
|
||||
if(ControlsCreated)
|
||||
{
|
||||
bool PadEnabled = WiiMoteEmu::NumGoodPads != 0;
|
||||
#ifdef _WIN32
|
||||
for(int i = IDB_ANALOG_LEFT_X; i <= IDB_TRIGGER_R; i++) m_Notebook->FindItem(i)->Enable(PadEnabled);
|
||||
m_Notebook->FindItem(IDC_JOYNAME)->Enable(PadEnabled);
|
||||
m_Notebook->FindItem(ID_TRIGGER_TYPE)->Enable(PadEnabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Disable all recording buttons
|
||||
bool ActiveRecording = !(m_bWaitForRecording || m_bRecording);
|
||||
#ifdef _WIN32
|
||||
// Disable all recording buttons
|
||||
for(int i = IDB_RECORD + 1; i < (IDB_RECORD + RECORDING_ROWS + 1); i++)
|
||||
if(ControlsCreated) m_Notebook->FindItem(i)->Enable(!(m_bWaitForRecording || m_bRecording));
|
||||
if(ControlsCreated) m_Notebook->FindItem(i)->Enable(ActiveRecording);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue