LilyPad: Display a warning when all controls are inactive

Displays a console warning if no controls/controllers are active and the
emulation cannot be controlled.
This commit is contained in:
FlatOutPS2 2017-02-09 22:37:59 +01:00 committed by Jonathan Li
parent 2ea078beb5
commit bd45bab34a
1 changed files with 14 additions and 0 deletions

View File

@ -531,6 +531,8 @@ void Update(unsigned int port, unsigned int slot)
dm->Update(&info);
static int rapidFire = 0;
rapidFire++;
static bool anyDeviceActiveAndBound = true;
bool currentDeviceActiveAndBound = false;
for (i = 0; i < dm->numDevices; i++) {
Device *dev = dm->devices[i];
// Skip both disabled devices and inactive enabled devices.
@ -570,6 +572,18 @@ void Update(unsigned int port, unsigned int slot)
}
}
}
if (dev->attached && dev->pads[0][0][config.padConfigs[0][0].type].numBindings > 0) {
if (!anyDeviceActiveAndBound) {
fprintf(stderr, "LilyPad: A device(%ws) has been attached with bound controls.\n", dev->displayName);
anyDeviceActiveAndBound = true;
}
currentDeviceActiveAndBound = true;
}
}
if (!currentDeviceActiveAndBound && activeWindow) {
if (anyDeviceActiveAndBound)
fprintf(stderr, "LilyPad: Warning! No controls are bound to a currently attached device!\nPlease attach a controller that has been setup for use with LilyPad or go to the Plugin settings and setup new controls.\n");
anyDeviceActiveAndBound = false;
}
dm->PostRead();