CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/Core/Dialog/PSPMsgDialog.h
Views: 1401
// Copyright (c) 2012- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <string>2021#include "Common/Swap.h"22#include "Core/Dialog/PSPDialog.h"2324#define SCE_UTILITY_MSGDIALOG_OPTION_ERRORSOUND 0x0000000025#define SCE_UTILITY_MSGDIALOG_OPTION_TEXTSOUND 0x0000000126#define SCE_UTILITY_MSGDIALOG_OPTION_NOSOUND 0x0000000227#define SCE_UTILITY_MSGDIALOG_OPTION_YESNO 0x0000001028#define SCE_UTILITY_MSGDIALOG_OPTION_OK 0x0000002029#define SCE_UTILITY_MSGDIALOG_OPTION_NOCANCEL 0x0000008030#define SCE_UTILITY_MSGDIALOG_OPTION_DEFAULT_NO 0x000001003132#define SCE_UTILITY_MSGDIALOG_SIZE_V1 57233#define SCE_UTILITY_MSGDIALOG_SIZE_V2 58034#define SCE_UTILITY_MSGDIALOG_SIZE_V3 7083536#define SCE_UTILITY_MSGDIALOG_OPTION_SUPPORTED 0x000001B3 // OR of all options coded to display warning3738#define SCE_UTILITY_MSGDIALOG_ERROR_BADOPTION 0x8011050139#define SCE_UTILITY_MSGDIALOG_ERROR_ERRORCODEINVALID 0x801105024041struct pspMessageDialog42{43pspUtilityDialogCommon common;44s32_le result;45s32_le type;46u32_le errorNum;47char string[512];48// End of request V1 (Size 572)49u32_le options;50u32_le buttonPressed;51// End of request V2 (Size 580)52char okayButton[64];53char cancelButton[64];54// End of request V3 (Size 708)55};565758class PSPMsgDialog: public PSPDialog {59public:60PSPMsgDialog(UtilityDialogType type);61~PSPMsgDialog();6263int Init(unsigned int paramAddr);64int Update(int animSpeed) override;65int Shutdown(bool force = false) override;66void DoState(PointerWrap &p) override;67pspUtilityDialogCommon *GetCommonParam() override;6869int Abort();7071protected:72bool UseAutoStatus() override {73return false;74}7576private:77void FormatErrorCode(uint32_t code);78void DisplayMessage(const std::string &text, bool hasYesNo = false, bool hasOK = false);7980enum Flags81{82DS_MSG = 0x1,83DS_ERRORMSG = 0x2,84DS_YESNO = 0x4,85DS_DEFNO = 0x8,86DS_OK = 0x10,87DS_VALIDBUTTON = 0x20,88DS_CANCELBUTTON = 0x40,89DS_NOSOUND = 0x80,90DS_ERROR = 0x100,91DS_ABORT = 0x200,92};9394u32 flag = 0;9596pspMessageDialog messageDialog{};97int messageDialogAddr = 0;9899char msgText[512];100int yesnoChoice = 0;101float scrollPos_ = 0.0f;102int framesUpHeld_ = 0;103int framesDownHeld_ = 0;104};105106107108