[Plugin] Dialog Plugin
#1

Dialog v0.8
Description
This plugin allows you to work with dialogs as with commands

Features
  • Made by analogue mdialog
  • Easy and convenient to use
  • Fast
Callbacks
OnDialogReceived - called before calling the dialog response
OnDialogPerformed - called after calling the dialog response

Functions
Dialog_Open - Open the dialog
Dialog_Show - Open existing dialog
Dialog_EnableFix - Enable fix (replaces % by #, and color codes will be removed)

Example
PHP Code:
public OnDialogReceived(dialog[], playeridresponselistiteminputtext[])
{
  if(
strcmp(dialog,"dialog") && !IsPlayerAdmin(playerid)) return 0// The dialog response will not be called
}
public 
OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
  return -
1// Required
}
public 
OnDialogPerformed(dialog[], playeridresponselistiteminputtext[], result)
{
  if(
result == -1printf("Dialog %s doesn't exists",dialog);
}
DialogCreate:dialog(playerid)
{
  
Dialog_Open(playerid,"dialog",DIALOG_STYLE_MSGBOX,"...","...","...","...");
}
DialogResponse:dialog(playeridresponselistiteminputtext[])
{
  
printf("Dialog \"dialog\" called");
  return 
1// Required

Download
Binaries
Source code
Reply
#2

There are already better things out there, however good job for the effort.
Reply
#3

Quote:
Originally Posted by iLearner
View Post
There are already better things out there, however good job for the effort.
Yes, I know:
Quote:
Originally Posted by KashCherry
Made by analogue mdialog
My idea was to make a call and handle a faster
Reply
#4

What are the benefits of this over easyDialog?
Reply
#5

Quote:
Originally Posted by Kaperstone
View Post
What are the benefits of this over easyDialog?
You can say that this is the same, but much faster
Reply
#6

Quote:
Originally Posted by KashCherry
View Post
You can say that this is the same, but much faster
Would love to see benchmarks between this, vanilla and easyDialog.


I personally have a lot of dialogs, if this plugin is faster than the existing solutions, I won't mind rewriting the code.
Reply
#7

Quote:
Originally Posted by Kaperstone
View Post
Would love to see benchmarks between this, vanilla and easyDialog.


I personally have a lot of dialogs, if this plugin is faster than the existing solutions, I won't mind rewriting the code.
Speed tests between RPC_DialogResponse and dialog (registered 100 dialogs, microseconds):
Vanilla: 33,31,55
This plugin: 23,20,26
easyDialog: 83, 92, 80
Reply
#8

Quote:
Originally Posted by KashCherry
View Post
Speed tests between RPC_DialogResponse and dialog (registered 100 dialogs, microseconds):
Vanilla: 33,31,55
This plugin: 23,20,26
easyDialog: 83, 92, 80
Can you reveal the source of the benchmark?
Reply
#9

Quote:
Originally Posted by Kaperstone
View Post
Can you reveal the source of the benchmark?
I used this speedtest with changed address (0x4928A0) on 0x493750
Reply
#10

Can you implement to your plugin to handle Message box's dialogs to switch between different pages example and have 3 buttons [>] [X] [<] something like that?
Reply
#11

This plugins support the tags too?
Reply
#12

Quote:
Originally Posted by Dayvison_
View Post
This plugins support the tags too?
At the moment no. Later will be added
Reply
#13

Can I use the usual dialogs with the plugin?
P.s Sorry for my bad English
Reply
#14

Quote:
Originally Posted by Gammaa
View Post
Can I use the usual dialogs with the plugin?
P.s Sorry for my bad English
Yes, you can.
Reply
#15

hi, i want to ask, in dialogresponse, for dialog, didn't respond.

Quote:

DialogCreate:testDialog(playerid)
{
Dialog_Open(playerid,Dialog:testDialog,DIALOG_STYL E_MSGBOX,
"try",
"its just a try",
"Yas","No");
}

DialogResponse:testDialog(playerid,response,listit em,inputtext[])
{
if(!response)
{
SendClientMessage(playerid, COLOR_GREY, "ERROR");
return 1;
}

SendClientMessage(playerid, COLOR_WHITE, "Box showed!");
return 1;
}

am i make a mistake or somethin?
Reply
#16

Quote:
Originally Posted by billyaga10
View Post
hi, i want to ask, in dialogresponse, for dialog, didn't respond.



am i make a mistake or somethin?
PHP Code:
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[]) 

  return -
1// Required 

Reply
#17

Is this plugin faster than mdialog? Maybe you did tests?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)