Added the notion of a 'cancel' button, and unified all the 'cancel' menu IDs to be kCancelMenuID (ie -1). I've slaved the Menu button (ie Esc on win, 'Start' button on PSP) to this - the idea being, if you hit the Menu button to bring up a menu, hitting it again will dismiss it without doing anything, which is pretty standard behavior for most console/computer games.
This commit is contained in:
@@ -76,6 +76,7 @@ JGuiController::JGuiController(int id, JGuiListener* listener) : mId(id), mListe
|
||||
mShowCursor = false;
|
||||
|
||||
mActionButton = JGE_BTN_OK;
|
||||
mCancelButton = JGE_BTN_MENU;
|
||||
|
||||
mStyle = JGUI_STYLE_WRAPPING;
|
||||
|
||||
@@ -110,6 +111,13 @@ bool JGuiController::CheckUserInput(JButton key){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (key == mCancelButton)
|
||||
{
|
||||
if (mListener != NULL)
|
||||
{
|
||||
mListener->ButtonPressed(mId, kCancelMenuID);
|
||||
}
|
||||
}
|
||||
else if ((JGE_BTN_LEFT == key) || (JGE_BTN_UP == key)) // || mEngine->GetAnalogY() < 64 || mEngine->GetAnalogX() < 64)
|
||||
{
|
||||
int n = mCurr;
|
||||
|
||||
Reference in New Issue
Block a user