Modern dialog system.
Dialog_Open(playerid, const function[], style, const caption[], const info[], const button1[], const button2[]);
Dialog_Close(playerid, const function[] = "", showDialog = true);
Dialog_GetCurrent(playerid, function[], const size = sizeof(function))
Dialog_IsOpen(playerid, const function[] = "");
Dialog_Show(playerid, const function[]);
Dialog_Message(playerid, const caption[], const info[], const button1[]);
Dialog_MessageEx(playerid, const response[], const caption[], const info[], const button1[], const button2[]);
zlang support
If MDIALOG_ZLANG_MODE is defined then some mdialog functions take a new view.
Dialog_Open(playerid, const function[], style, const caption[], const info[], const button1[], const button2[], {Float, _}:...);
Dialog_Message(playerid, const caption[], const info[], const button1[], {Float, _}:...);
Dialog_MessageEx(playerid, const response[], const caption[], const info[], const button1[], const button2[], {Float, _}:...);
You can use tags for markup your dialogs:
Tag | Description |
---|---|
\\c | Centers the text |
\\r | Aligns the text to the right |
You also can disable tags with definition of MDIALOG_DISABLE_TAGS
before mdialog
including. This can be useful if you are not interested in this feature and wants a little bit more performance.
You can use DialogCreate:
, DialogResponse:
and DialogInterrupt:
prefixes:
DialogCreate:test(playerid)
{
Dialog_Open(playerid, Dialog:test, DIALOG_STYLE_MSGBOX,
"Hello",
"Are you ok?",
"Yes", "No");
}
DialogResponse:test(playerid, response, listitem, inputtext[])
{
if (!response) {
SendClientMessage(playerid, -1, "This club only for OK guys!");
Dialog_Show(playerid, Dialog:test);
return 1;
}
SendClientMessage(playerid, -1, "Welcome to the club");
return 1;
}
DialogInterrupt:test(playerid)
{
SendClientMessage(playerid, -1, "Dialog \"test\" was closed by Dialog_Close or by opening other dialog");
return 1;
}
#define MDIALOG_ZLANG_MODE
#include "mdialog"
DialogCreate:test(playerid)
{
Dialog_Open(playerid, Dialog:test, DIALOG_STYLE_MSGBOX,
"Hello",
"LANG_ARE_YOU_OK",
"Yes", "BUTTON_NO",
playerid);
}
DialogResponse:test(playerid, response, listitem, inputtext[])
{
if (!response) {
SendClientMessage(playerid, -1, "This club only for OK guys!");
Dialog_Show(playerid, Dialog:test);
return 1;
}
SendClientMessage(playerid, -1, "Welcome to the club");
return 1;
}
Lang file:
LANG_ARE_YOU_OK = Hey id %d, are you ok?
BUTTON_NO = No