51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#include "INP_Main.h"
|
|
#include "INP_MsgBox.h"
|
|
|
|
CMsgBox::CMsgBox()
|
|
{
|
|
m_eResult = EMsgBox_Undefined;
|
|
}
|
|
|
|
EMsgBoxResult CMsgBox::RequestMessageBox(EMSgBoxType eType, DWORD dwPad,void( *Func)(int iButtonType,void *pvUserData),LPVOID lpParam, const char *pchText ,unsigned int uiFocusButton )
|
|
{
|
|
InternalInputManager.DebugPrintf("InputManager CMsgBox::RequestMessageBox\n");
|
|
|
|
if (m_eResult == EMsgBox_Pending)
|
|
return EMsgBox_Busy;
|
|
|
|
m_eResult = EMsgBox_Pending;
|
|
int messageType = CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL
|
|
| CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON;
|
|
|
|
m_iPad = dwPad;
|
|
m_pParam = lpParam;
|
|
|
|
switch (eType)
|
|
{
|
|
case EMSgBoxType_OK:
|
|
messageType |= CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK;
|
|
break;
|
|
case EMSgBoxType_YesNo:
|
|
messageType |= CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO;
|
|
if (uiFocusButton)
|
|
{
|
|
messageType |= CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NO;
|
|
}
|
|
break;
|
|
}
|
|
|
|
int msgDialog = cellMsgDialogOpen2(messageType, pchText, Func, this, NULL);
|
|
if (msgDialog != CELL_OK)
|
|
{
|
|
InternalInputManager.DebugPrintf("ERROR : cellMsgDialogOpen2() = 0x%x\n", msgDialog);
|
|
if (msgDialog == CELL_SYSUTIL_ERROR_BUSY)
|
|
{
|
|
InternalInputManager.DebugPrintf("WARN : cellMsgDialogOpen2() = 0x%x (CELL_SYSUTIL_ERROR_BUSY) ... Retry.\n", CELL_SYSUTIL_ERROR_BUSY);
|
|
return EMsgBox_SysUtilBusy;
|
|
}
|
|
return EMsgBox_Undefined;
|
|
}
|
|
|
|
InternalInputManager.DebugPrintf("cellMsgDialogOpen2 - CELL_OK\n");
|
|
return m_eResult;
|
|
} |