SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 27/11/2016, 11:49 AM   #1
ZiGGi
Banned
 
Join Date: Sep 2008
Location: Russia
Posts: 1,447
Reputation: 356
Default mdialog - modern dialog system

mdialog

About
Modern dialog system.

Functions
Open dialog
PHP Code:
Dialog_Open(playerid, function[], stylecaption[], info[], button1[], button2[]); 
Close dialog
PHP Code:
Dialog_Close(playerid); 
Check on openning dialog
PHP Code:
Dialog_IsOpen(playerid); 
Show dialog by name
PHP Code:
Dialog_Show(playerid, function[]); 
Show message dialog
PHP Code:
Dialog_Message(playeridcaption[], info[], button1[]); 
Show message dialog with custom response callback
PHP Code:
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 Code:
Dialog_Open(playerid, function[], stylecaption[], info[], button1[], button2[], {Float_}:...); 
Show message dialog
PHP Code:
Dialog_Message(playeridcaption[], info[], button1[], {Float_}:...); 
Show message dialog with custom response callback
PHP Code:
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 Code:
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 Code:
#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 Code:
LANG_ARE_YOU_OK Hey id %dare you ok?
BUTTON_NO No 
Download
- GitHub download page: https://github.com/Open-GTO/mdialog/releases

Last edited by ZiGGi; 25/11/2017 at 02:55 PM.
ZiGGi is offline   Reply With Quote
Old 31/12/2016, 04:30 PM   #2
Darrenr
Big Clucker
 
Darrenr's Avatar
 
Join Date: Mar 2015
Posts: 90
Reputation: 13
Default Re: mdialog - modern dialog system

screenshots?
__________________
PM me for help with scripting in Pawn.








rep+
Darrenr is offline   Reply With Quote
Old 31/12/2016, 05:18 PM   #3
ZiGGi
Banned
 
Join Date: Sep 2008
Location: Russia
Posts: 1,447
Reputation: 356
Default Re: mdialog - modern dialog system

Quote:
Originally Posted by Darrenr View Post
screenshots?
It's default dialogs with new scripting syntax.
ZiGGi is offline   Reply With Quote
Old 02/01/2017, 03:42 PM   #4
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,759
Reputation: 1175
Default Re: mdialog - modern dialog system

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.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 02/01/2017, 04:44 PM   #5
ZiGGi
Banned
 
Join Date: Sep 2008
Location: Russia
Posts: 1,447
Reputation: 356
Default Re: mdialog - modern dialog system

Quote:
Originally Posted by Lordzy View Post
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.

Last edited by ZiGGi; 04/01/2017 at 04:31 AM.
ZiGGi is offline   Reply With Quote
Old 17/09/2017, 04:23 PM   #6
ZiGGi
Banned
 
Join Date: Sep 2008
Location: Russia
Posts: 1,447
Reputation: 356
Default Re: mdialog - modern dialog system

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

ZiGGi is offline   Reply With Quote
Old 17/09/2017, 06:53 PM   #7
Tort
Little Clucker
 
Join Date: Sep 2017
Posts: 4
Reputation: 4
Default Re: mdialog - modern dialog system

good job
Tort is offline   Reply With Quote
Old 20/09/2017, 05:03 AM   #8
Paulice
Gangsta
 
Join Date: Jul 2017
Posts: 470
Reputation: 44
Default Re: mdialog - modern dialog system

PHP Code:
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.

++
Paulice is offline   Reply With Quote
Old 22/09/2017, 05:43 AM   #9
Cyuan
Little Clucker
 
Join Date: Jul 2015
Posts: 1
Reputation: 0
Default Re: mdialog - modern dialog system

Can I use Chinese?
Cyuan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[GameMode] Modern War Battalation V2.8| Back to Back release after 8 months | 3500+ Lines | New CMDS | Radio System | Admin System Nirzor Gamemode Scripts 40 30/07/2013 08:09 AM
[Include] Airstrike system - Based on Modern Warfare 2 Hiddos Includes 43 09/04/2013 03:54 PM
Modern Taxi System Help y@sin1 Help Archive 4 26/03/2011 12:26 AM


All times are GMT. The time now is 11:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.