From b757322838800ee78b4018390fafa9b45471233d Mon Sep 17 00:00:00 2001 From: giantpune Date: Sun, 31 May 2009 07:31:26 +0000 Subject: [PATCH] If there are no controllers connected disable the mainWindow. --- source/menu.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/menu.cpp b/source/menu.cpp index 623924f7..6a2231c2 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -2483,10 +2483,10 @@ ProgressUpdateWindow() * * Primary thread to allow GUI to respond to state changes, and draws GUI ***************************************************************************/ - +int noControllers=0; static void * UpdateGUI (void *arg) -{ +{ while(1) { if(guiHalt) @@ -2509,6 +2509,15 @@ UpdateGUI (void *arg) { DoRumble(i); } + if(WPAD_Probe(i, NULL) == WPAD_ERR_NO_CONTROLLER){ + noControllers++; + if (noControllers == 4){ + mainWindow->SetState(STATE_DISABLED); + } + } + else {noControllers =0; + mainWindow->SetState(STATE_DEFAULT);} + } #endif