Modified instructions for connecting wiimote on windows, added

'OK/cancel' type to MessageDialog (instead of 'Yes/Cancel').


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14333 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-10-28 23:10:45 +00:00
parent 3fae9270c2
commit 206cc802e6
3 changed files with 28 additions and 13 deletions

View File

@ -305,10 +305,15 @@ void* WiimoteManager::threadFuncWrapper(void *data)
int WiimoteManager::askUserToConnectWiimotes()
{
new MessageDialog(
_("Press the buttons 1+2 simultaneously on your wiimote to put "
"it in discovery mode, then click on Yes."
#ifdef WIN32
_("Connect your wiimote to the Bluetooth manager, then click on Ok."
"Detailed instructions at supertuxkart.net/Wiimote"),
MessageDialog::MESSAGE_DIALOG_CONFIRM,
#else
_("Press the buttons 1+2 simultaneously on your wiimote to put "
"it in discovery mode, then click on Ok."
"Detailed instructions at supertuxkart.net/Wiimote"),
#endif
MessageDialog::MESSAGE_DIALOG_OK_CANCEL,
new WiimoteDialogListener(), true);
return getNumberOfWiimotes();

View File

@ -29,19 +29,20 @@ using namespace GUIEngine;
// ------------------------------------------------------------------------------------------------------
MessageDialog::MessageDialog(irr::core::stringw msg, MessageDialogType type, IConfirmDialogListener* listener, bool own_listener) :
MessageDialog::MessageDialog(const irr::core::stringw &msg, MessageDialogType type,
IConfirmDialogListener* listener, bool own_listener) :
ModalDialog(0.6f, 0.6f)
{
doInit(msg, type, listener, own_listener);
}
} // MessageDialog(stringw, type, listener, own_listener)
// ------------------------------------------------------------------------------------------------------
MessageDialog::MessageDialog(irr::core::stringw msg) :
MessageDialog::MessageDialog(const irr::core::stringw &msg) :
ModalDialog(0.6f, 0.6f)
{
doInit(msg, MessageDialog::MESSAGE_DIALOG_OK, NULL, false);
}
} // MessageDialog(stringw)
// ------------------------------------------------------------------------------------------------------
@ -53,11 +54,11 @@ MessageDialog::~MessageDialog()
{
World::getWorld()->scheduleUnpause();
}
}
} // ~MessageDialog
// ------------------------------------------------------------------------------------------------------
void MessageDialog::doInit(irr::core::stringw msg, MessageDialogType type,
void MessageDialog::doInit(const irr::core::stringw &msg, MessageDialogType type,
IConfirmDialogListener* listener, bool own_listener)
{
if (StateManager::get()->getGameState() == GUIEngine::GAME)
@ -85,6 +86,12 @@ void MessageDialog::doInit(irr::core::stringw msg, MessageDialogType type,
cancelbtn->setText(_("OK"));
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
else if (type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL)
{
// In case of a OK_CANCEL dialog, change the text from 'Yes' to 'Ok'
ButtonWidget* yesbtn = getWidget<ButtonWidget>("confirm");
yesbtn->setText(_("OK"));
}
}

View File

@ -62,13 +62,15 @@ public:
virtual void onDialogUpdate(float dt) {}
};
enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM };
enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM,
MESSAGE_DIALOG_OK_CANCEL };
private:
IConfirmDialogListener* m_listener;
bool m_own_listener;
void doInit(irr::core::stringw msg, MessageDialogType type, IConfirmDialogListener* listener, bool own_listener);
void doInit(const irr::core::stringw &msg, MessageDialogType type,
IConfirmDialogListener* listener, bool own_listener);
public:
@ -78,13 +80,14 @@ public:
* \param If set to true, 'listener' will be owned by this dialog and deleted
* along with the dialog.
*/
MessageDialog(irr::core::stringw msg, MessageDialogType type, IConfirmDialogListener* listener, bool delete_listener);
MessageDialog(const irr::core::stringw &msg, MessageDialogType type,
IConfirmDialogListener* listener, bool delete_listener);
/**
* Variant of MessageDialog where cancelling is not possible (i.e. just shows a message box with OK)
* \param msg Message to display in the dialog
*/
MessageDialog(irr::core::stringw msg);
MessageDialog(const irr::core::stringw &msg);
~MessageDialog();