mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-12 05:33:15 +00:00
Message Dialog library (#767)
* system/MsgDialog: types & basic text display * system/MsgDialog: User message dialog * system/MsgDialog: RAII for MsgDialog ui * system/MsgDialog: Progress bar dialog * system/MsgDialog: System message texts * system/MsgDialog: copy all ui state to local memory handles when game release memory before close extracted all UI code to it's own file use single window instead of creating new one every single dialogOpen * system/MsgDialog: debug logging
This commit is contained in:
parent
035cb3eeaa
commit
446d8c4ff1
9 changed files with 716 additions and 153 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
#include "core/libraries/system/commondialog.h"
|
||||
|
||||
namespace Core::Loader {
|
||||
|
@ -12,95 +11,23 @@ class SymbolsResolver;
|
|||
|
||||
namespace Libraries::MsgDialog {
|
||||
|
||||
using OrbisUserServiceUserId = s32;
|
||||
struct DialogResult;
|
||||
struct OrbisParam;
|
||||
enum class OrbisMsgDialogProgressBarTarget : u32;
|
||||
|
||||
enum OrbisCommonDialogStatus {
|
||||
ORBIS_COMMON_DIALOG_STATUS_NONE = 0,
|
||||
ORBIS_COMMON_DIALOG_STATUS_INITIALIZED = 1,
|
||||
ORBIS_COMMON_DIALOG_STATUS_RUNNING = 2,
|
||||
ORBIS_COMMON_DIALOG_STATUS_FINISHED = 3
|
||||
};
|
||||
|
||||
enum OrbisMsgDialogMode {
|
||||
ORBIS_MSG_DIALOG_MODE_USER_MSG = 1,
|
||||
ORBIS_MSG_DIALOG_MODE_PROGRESS_BAR = 2,
|
||||
ORBIS_MSG_DIALOG_MODE_SYSTEM_MSG = 3,
|
||||
};
|
||||
|
||||
enum OrbisMsgDialogButtonType {
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_OK = 0,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_YESNO = 1,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_NONE = 2,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_OK_CANCEL = 3,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_WAIT = 5,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_WAIT_CANCEL = 6,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_YESNO_FOCUS_NO = 7,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_OK_CANCEL_FOCUS_CANCEL = 8,
|
||||
ORBIS_MSG_DIALOG_BUTTON_TYPE_2BUTTONS = 9,
|
||||
};
|
||||
|
||||
enum OrbisMsgDialogProgressBarType {
|
||||
ORBIS_MSG_DIALOG_PROGRESSBAR_TYPE_PERCENTAGE = 0,
|
||||
ORBIS_MSG_DIALOG_PROGRESSBAR_TYPE_PERCENTAGE_CANCEL = 1,
|
||||
};
|
||||
|
||||
enum OrbisMsgDialogSystemMessageType {
|
||||
ORBIS_MSG_DIALOG_SYSMSG_TYPE_TRC_EMPTY_STORE = 0,
|
||||
ORBIS_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION = 1,
|
||||
ORBIS_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_UGC_RESTRICTION = 2,
|
||||
ORBIS_MSG_DIALOG_SYSMSG_TYPE_CAMERA_NOT_CONNECTED = 4,
|
||||
ORBIS_MSG_DIALOG_SYSMSG_TYPE_WARNING_PROFILE_PICTURE_AND_NAME_NOT_SHARED = 5,
|
||||
};
|
||||
|
||||
struct OrbisMsgDialogButtonsParam {
|
||||
const char* msg1;
|
||||
const char* msg2;
|
||||
char reserved[32];
|
||||
};
|
||||
|
||||
struct OrbisMsgDialogUserMessageParam {
|
||||
OrbisMsgDialogButtonType buttonType;
|
||||
s32 : 32;
|
||||
const char* msg;
|
||||
OrbisMsgDialogButtonsParam* buttonsParam;
|
||||
char reserved[24];
|
||||
};
|
||||
|
||||
struct OrbisMsgDialogProgressBarParam {
|
||||
OrbisMsgDialogProgressBarType barType;
|
||||
int32_t : 32;
|
||||
const char* msg;
|
||||
char reserved[64];
|
||||
};
|
||||
|
||||
struct OrbisMsgDialogSystemMessageParam {
|
||||
OrbisMsgDialogSystemMessageType sysMsgType;
|
||||
char reserved[32];
|
||||
};
|
||||
|
||||
struct OrbisMsgDialogParam {
|
||||
CommonDialog::OrbisCommonDialogBaseParam baseParam;
|
||||
std::size_t size;
|
||||
OrbisMsgDialogMode mode;
|
||||
s32 : 32;
|
||||
OrbisMsgDialogUserMessageParam* userMsgParam;
|
||||
OrbisMsgDialogProgressBarParam* progBarParam;
|
||||
OrbisMsgDialogSystemMessageParam* sysMsgParam;
|
||||
OrbisUserServiceUserId userId;
|
||||
char reserved[40];
|
||||
s32 : 32;
|
||||
};
|
||||
|
||||
int PS4_SYSV_ABI sceMsgDialogClose();
|
||||
int PS4_SYSV_ABI sceMsgDialogGetResult();
|
||||
int PS4_SYSV_ABI sceMsgDialogGetStatus();
|
||||
int PS4_SYSV_ABI sceMsgDialogInitialize();
|
||||
s32 PS4_SYSV_ABI sceMsgDialogOpen(const OrbisMsgDialogParam* param);
|
||||
int PS4_SYSV_ABI sceMsgDialogProgressBarInc();
|
||||
int PS4_SYSV_ABI sceMsgDialogProgressBarSetMsg();
|
||||
int PS4_SYSV_ABI sceMsgDialogProgressBarSetValue();
|
||||
int PS4_SYSV_ABI sceMsgDialogTerminate();
|
||||
int PS4_SYSV_ABI sceMsgDialogUpdateStatus();
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogClose();
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogGetResult(DialogResult* result);
|
||||
CommonDialog::Status PS4_SYSV_ABI sceMsgDialogGetStatus();
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogInitialize();
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogOpen(const OrbisParam* param);
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogProgressBarInc(OrbisMsgDialogProgressBarTarget,
|
||||
u32 delta);
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogProgressBarSetMsg(OrbisMsgDialogProgressBarTarget,
|
||||
const char* msg);
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogProgressBarSetValue(OrbisMsgDialogProgressBarTarget,
|
||||
u32 value);
|
||||
CommonDialog::Error PS4_SYSV_ABI sceMsgDialogTerminate();
|
||||
CommonDialog::Status PS4_SYSV_ABI sceMsgDialogUpdateStatus();
|
||||
|
||||
void RegisterlibSceMsgDialog(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::MsgDialog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue