SA-MP Forums Archive
[Include] mdialog - modern dialog system - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] mdialog - modern dialog system (/showthread.php?tid=622846)



mdialog - modern dialog system - ZiGGi - 27.11.2016

mdialog
GitHub
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


Re: mdialog - modern dialog system - Darrenr - 31.12.2016

screenshots?


Re: mdialog - modern dialog system - ZiGGi - 31.12.2016

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


Re: mdialog - modern dialog system - Lordzy - 02.01.2017

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.


Re: mdialog - modern dialog system - ZiGGi - 02.01.2017

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.


Re: mdialog - modern dialog system - ZiGGi - 17.09.2017

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



Re: mdialog - modern dialog system - Tort - 17.09.2017

good job


Re: mdialog - modern dialog system - Paulice - 20.09.2017

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.

++


Re: mdialog - modern dialog system - Cyuan - 22.09.2017

Can I use Chinese?