[Include] mdialog - modern dialog system
#1

mdialog
About
Modern dialog system.

Functions
Open dialog
PHP код:
Dialog_Open(playerid, function[], stylecaption[], info[], button1[], button2[]); 
Close dialog
PHP код:
Dialog_Close(playerid); 
Check on openning dialog
PHP код:
Dialog_IsOpen(playerid); 
Show dialog by name
PHP код:
Dialog_Show(playerid, function[]); 
Show message dialog
PHP код:
Dialog_Message(playeridcaption[], info[], button1[]); 
Show message dialog with custom response callback
PHP код:
Dialog_MessageEx(playeridresponse[], caption[], info[], button1[], button2[]); 
zlang support
If MDIALOG_ZLANG_MODE is defined then some mdialog functions take a new view.

Open dialog
PHP код:
Dialog_Open(playerid, function[], stylecaption[], info[], button1[], button2[], {Float_}:...); 
Show message dialog
PHP код:
Dialog_Message(playeridcaption[], info[], button1[], {Float_}:...); 
Show message dialog with custom response callback
PHP код:
Dialog_MessageEx(playeridresponse[], caption[], info[], button1[], button2[], {Float_}:...); 
Tags support
You can use tags for markup your dialogs:

Tag
Description
\\c Centers the text
\\r Aligns the text to the right


Usage
You can use DialogCreate: and DialogResponse: prefixes:
PHP код:
DialogCreate:test(playerid)
{
    
Dialog_Open(playeridDialog:testDIALOG_STYLE_MSGBOX,
                
"Hello",
                
"Are you ok?",
                
"Yes""No");
}
DialogResponse:test(playeridresponselistiteminputtext[])
{
    if (!
response) {
        
SendClientMessage(playerid, -1"This club only for OK guys!");
        
Dialog_Show(playeridDialog:test);
        return 
1;
    }
    
SendClientMessage(playerid, -1"Welcome to the club");
    return 
1;

Usage with zlang mode
PHP код:
#define MDIALOG_ZLANG_MODE
#include "mdialog"
DialogCreate:test(playerid)
{
    
Dialog_Open(playeridDialog:testDIALOG_STYLE_MSGBOX,
                
"Hello",
                
"LANG_ARE_YOU_OK",
                
"Yes""BUTTON_NO",
                
playerid);
}
DialogResponse:test(playeridresponselistiteminputtext[])
{
    if (!
response) {
        
SendClientMessage(playerid, -1"This club only for OK guys!");
        
Dialog_Show(playeridDialog:test);
        return 
1;
    }
    
SendClientMessage(playerid, -1"Welcome to the club");
    return 
1;

Lang file:
PHP код:
LANG_ARE_YOU_OK Hey id %dare you ok?
BUTTON_NO No 
Download
- GitHub download page: https://github.com/Open-GTO/mdialog/releases
Reply
#2

screenshots?
Reply
#3

Quote:
Originally Posted by Darrenr
Посмотреть сообщение
screenshots?
It's default dialogs with new scripting syntax.
Reply
#4

I haven't gone much through the code since I'm browsing on my cellphone, but why would you declare button arrays with the same size as caption and header? AFAIK - buttons have width limit.
Reply
#5

Quote:
Originally Posted by Lordzy
Посмотреть сообщение
I haven't gone much through the code since I'm browsing on my cellphone, but why would you declare button arrays with the same size as caption and header? AFAIK - buttons have width limit.
I don't know. I will fix this later.

UPD: fixed.
Reply
#6

mdialog v1.2.0

- Add tags support

Now you can use tags for markup your dialogs:

Tag
Description
\\c Centers the text
\\r Aligns the text to the right
Reply
#7

good job
Reply
#8

PHP код:
Dialog_Show(playeridDialog:test); 
For being able to do that in the script, I like it! If I ever go forward with the development of a server, I'll be sure to implement a system that works in the same way.

++
Reply
#9

Can I use Chinese?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)