easyDialog vs OnDialogResponse - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: easyDialog vs OnDialogResponse (
/showthread.php?tid=656088)
easyDialog vs OnDialogResponse -
CodeStyle175 - 06.07.2018
what is better for dialogs, like what makes code more readable or what is more beneficial?
Re: easyDialog vs OnDialogResponse -
CantBeJohn - 06.07.2018
Quote:
Feature | OnDialogResponse | easyDialog.inc | Crash Proof | No | Yes | Named Dialogs | No | Yes | Calling a dialog manually | No | Yes | Custom callback for handling | No | Yes |
|
Here are the benefits, which are located in easyDialog's post. This is why easyDialog is more beneficial.
EDIT: Personally though, I use
mdialog.
Re: easyDialog vs OnDialogResponse -
CodeStyle175 - 06.07.2018
these are fake ass benefits
this is the only crash proof thingy there
PHP код:
for (new i = 0, l = strlen(inputtext); i < l; i ++)
{
if (inputtext[i] == '%')
{
inputtext[i] = '#';
}
}
with this there can be also named dialogs in OnDialogResponse
enum {
DIALOG_LOGIN_PASSWORD
}
Re: easyDialog vs OnDialogResponse -
Pottus - 06.07.2018
I write all my dialogs with y_inline/y_dialog this way you don't have to worry about saving data outside the scope of your function. When a dialog response is received any variables created in your function are saved automatically. This eliminates the need of using arrays when you need to save a value.
Re: easyDialog vs OnDialogResponse -
CodeStyle175 - 06.07.2018
nice idea
Re: easyDialog vs OnDialogResponse -
Calisthenics - 07.07.2018
Basically y_dialogs can be used the same way as easyDialog:
pawn Код:
#define DIALOG:%1(%2) forward dlg_%1(%2);public dlg_%1(%2)
Код:
Dialog_ShowCallback(playerid, using callback dlg_login, DIALOG_STYLE_PASSWORD, "Login", "Type your password below:", "Login", "Leave");
pawn Код:
DIALOG:login(playerid, dialogid, response, listitem, string: inputtext[])
{
// code..
}