forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MessageBox.h
34 lines (27 loc) · 849 Bytes
/
MessageBox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//Class to show a YR-style Message Box ingame
#pragma once
#include <YRPPCore.h>
#include <StringTable.h>
typedef int eMessageBoxResult;
#define MESSAGEBOXRESULT_OK 0
#define MESSAGEBOXRESULT_CANCEL 1
#define MESSAGEBOXRESULT_BUTTON0 0
#define MESSAGEBOXRESULT_BUTTON1 1
class MessageBox
{
public:
static eMessageBoxResult Show(const wchar_t* pMessage, const wchar_t* pButton1Text, const wchar_t* pButton2Text)
{
wchar_t* pTitle=reinterpret_cast<wchar_t*>(0x82083C); //Title?
wchar_t** ppTitle=&pTitle;
PUSH_IMM(0);
PUSH_IMM(0);
PUSH_VAR32(pButton2Text);
PUSH_VAR32(pButton1Text);
PUSH_VAR32(pMessage);
SET_REG32(ecx,ppTitle);
CALL(0x5D3490);
}
static eMessageBoxResult Show(const wchar_t* pMessage)
{ return Show(pMessage, StringTable::LoadString("TXT_OK"), StringTable::LoadString("TXT_CANCEL")); }
};