2012-12-10 12:08:54 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2014-03-15 17:38:46 +00:00
|
|
|
#include <string>
|
|
|
|
#include "Core/Dialog/PSPDialog.h"
|
2012-12-10 12:08:54 +00:00
|
|
|
|
2014-01-23 08:41:42 +00:00
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_ERRORSOUND 0x00000000
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_TEXTSOUND 0x00000001
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_NOSOUND 0x00000002
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_YESNO 0x00000010
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_OK 0x00000020
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_NOCANCEL 0x00000080
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_DEFAULT_NO 0x00000100
|
|
|
|
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_SIZE_V1 572
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_SIZE_V2 580
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_SIZE_V3 708
|
|
|
|
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_OPTION_SUPPORTED 0x000001B3 // OR of all options coded to display warning
|
|
|
|
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_ERROR_BADOPTION 0x80110501
|
|
|
|
#define SCE_UTILITY_MSGDIALOG_ERROR_ERRORCODEINVALID 0x80110502
|
2013-01-01 00:18:39 +00:00
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
struct pspMessageDialog
|
|
|
|
{
|
|
|
|
pspUtilityDialogCommon common;
|
2013-07-27 22:30:18 +00:00
|
|
|
s32_le result;
|
|
|
|
s32_le type;
|
|
|
|
u32_le errorNum;
|
2012-12-10 12:08:54 +00:00
|
|
|
char string[512];
|
2013-01-17 22:29:57 +00:00
|
|
|
// End of request V1 (Size 572)
|
2013-07-27 22:30:18 +00:00
|
|
|
u32_le options;
|
|
|
|
u32_le buttonPressed;
|
2013-01-17 22:29:57 +00:00
|
|
|
// End of request V2 (Size 580)
|
2014-01-23 09:02:41 +00:00
|
|
|
char okayButton[64];
|
|
|
|
char cancelButton[64];
|
2013-01-17 22:29:57 +00:00
|
|
|
// End of request V3 (Size 708)
|
2012-12-10 12:08:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class PSPMsgDialog: public PSPDialog {
|
|
|
|
public:
|
|
|
|
PSPMsgDialog();
|
|
|
|
virtual ~PSPMsgDialog();
|
|
|
|
|
2012-12-25 02:37:28 +00:00
|
|
|
virtual int Init(unsigned int paramAddr);
|
2014-12-08 20:14:35 +00:00
|
|
|
virtual int Update(int animSpeed) override;
|
|
|
|
virtual int Shutdown(bool force = false) override;
|
|
|
|
virtual void DoState(PointerWrap &p) override;
|
|
|
|
virtual pspUtilityDialogCommon *GetCommonParam() override;
|
2013-06-10 08:52:26 +00:00
|
|
|
|
2013-03-31 05:54:00 +00:00
|
|
|
int Abort();
|
2012-12-10 12:08:54 +00:00
|
|
|
|
2014-02-09 01:26:54 +00:00
|
|
|
protected:
|
2015-09-17 18:29:37 +00:00
|
|
|
virtual bool UseAutoStatus() override {
|
2014-02-09 01:26:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-12-10 12:08:54 +00:00
|
|
|
private :
|
2013-07-21 09:59:04 +00:00
|
|
|
void DisplayMessage(std::string text, bool hasYesNo = false, bool hasOK = false);
|
2012-12-10 12:08:54 +00:00
|
|
|
|
2013-01-17 22:29:57 +00:00
|
|
|
enum Flags
|
2012-12-10 12:08:54 +00:00
|
|
|
{
|
2014-03-03 16:16:53 +00:00
|
|
|
DS_MSG = 0x1,
|
|
|
|
DS_ERRORMSG = 0x2,
|
|
|
|
DS_YESNO = 0x4,
|
|
|
|
DS_DEFNO = 0x8,
|
|
|
|
DS_OK = 0x10,
|
|
|
|
DS_VALIDBUTTON = 0x20,
|
|
|
|
DS_CANCELBUTTON = 0x40,
|
|
|
|
DS_NOSOUND = 0x80,
|
2014-09-27 07:13:11 +00:00
|
|
|
DS_ERROR = 0x100,
|
|
|
|
DS_ABORT = 0x200,
|
2012-12-10 12:08:54 +00:00
|
|
|
};
|
|
|
|
|
2013-01-17 22:29:57 +00:00
|
|
|
u32 flag;
|
2012-12-10 12:08:54 +00:00
|
|
|
|
|
|
|
pspMessageDialog messageDialog;
|
|
|
|
int messageDialogAddr;
|
|
|
|
|
2013-01-17 22:29:57 +00:00
|
|
|
char msgText[512];
|
2012-12-10 12:08:54 +00:00
|
|
|
int yesnoChoice;
|
|
|
|
};
|
|
|
|
|