[Include] easyDialog.inc - Dialogs made easier!
#21

Noob scripter here, hi!

Uhm' when doing something with DIALOG_STYLE_LIST, can you use just like with normal dialogs with "cases" or also with like "listitem == 0" etc?
Reply
#22

Yeah - of course! I'm using switch statements with this and it works nice.
Reply
#23

what is the correct way to use this
On my server when cop issues ticket a dialog pops up saying pay or dont pay. if i click pay it says incorrect password please re-enter if i click dont pay it kicks me from server,
I just need to keep them from getting mixed up. Sorry for being a noob. This is all new to me Im not sure which function or callback to use nor where to put it,
Reply
#24

Quote:
Originally Posted by Swisher
Посмотреть сообщение
what is the correct way to use this
On my server when cop issues ticket a dialog pops up saying pay or dont pay. if i click pay it says incorrect password please re-enter if i click dont pay it kicks me from server,
I just need to keep them from getting mixed up. Sorry for being a noob. This is all new to me Im not sure which function or callback to use nor where to put it,
Check out the example script in the first post.

I'm working on a way to fix this.
Reply
#25

Sorry, but:

(Dialog_Reset(%0), ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, " ", " ", " ", ""))
Reply
#26

An optional update:
  • Updated the hooking method.
  • Removed "Dialog_Call" since you can call dialogs directly now.
  • Dialog_Show now accepts formatting parameters, which automatically formats the info string.
  • Updated the callback layout. It now uses the traditional "dialog_x" instead of the other wacky one.
An example:

pawn Код:
Dialog_Show(playerid, Rules, DIALOG_STYLE_MSGBOX, "Rules", "Do you accept the rules, %s?", "Yes", "No", GetName(playerid));
I've also renamed "OnDialogReceived" to "OnDialogPerformed" and added a response parameter:

pawn Код:
public OnDialogPerformed(playerid, dialog[], response, success)
{
    return 1;
}
I'm also considering to integrate y_dialog into this library. When I'm not busy then I'll get around to doing it.

Quote:
Originally Posted by kurta999
Посмотреть сообщение
Sorry, but:

(Dialog_Reset(%0), ShowPlayerDialog(playerid, -1, DIALOG_STYLE_MSGBOX, " ", " ", " ", ""))
Fixed, thanks.
Reply
#27

I've found somewhat of a bug within the script. I for one, prefer the look of:
pawn Код:
#define DIALOG_LOGIN (1001)
// instead of
#define DIALOG_LOGIN 1001
However this include does not support this.
Reply
#28

Quote:
Originally Posted by Isolated
Посмотреть сообщение
I've found somewhat of a bug within the script. I for one, prefer the look of:
pawn Код:
#define DIALOG_LOGIN (1001)
// instead of
#define DIALOG_LOGIN 1001
However this include does not support this.
Yeah, sorry. Due to limitations on the pre-processor, it doesn't detect macros being used within other macros. Since dialog ID's are redundant in this script, you can just do this:

pawn Код:
Dialog:DIALOG_LOGIN(playerid, response, listitem, inputtext[])
{
    // ...
}
Without DIALOG_LOGIN being an actual definition / macro.
Reply
#29

Do you know why I get this error? easyDialog.inc(129) : error 025: function heading differs from prototype
Reply
#30

One question, їIs this optimized?. Thanks
Reply
#31

Quote:
Originally Posted by Crayder
Посмотреть сообщение
Yes, it obviously does. This include doesn't touch the types at all. It just passes them on.
I think that DIALOG_STYLE_TABLIST, added on 0.3.7 and since Emmet_ update the version DIALOG_STYLE_TABLIST is not supported, anyway you can always use DIALOG_STYLE_TABLIST with normal function ShowPlayerDialog
Reply
#32

I think that Emmet_ should answer on that big question.
Reply
#33

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
The include has nothing to do with the style of the dialog. What emmet is doing is only "converting" the response of the dialogs you have into callbacks to make your coding easier, hence easyDialog.

All styles work, and even (if) in the future we had new styles, they will work too.
I never checked the code
Reply
#34

Nice work and include Emmet_! I recommend to use macro definition because original 1st line has a lot text and params for writing(if you understand me.

Код:
#define DIALOG(%0) \
	Dialog:%0(playerid, response, listitem, inputtext[])
So code will look

Код:
DIALOG(DIALOG_NAME)
{
/* CODE HERE */
return (true);
}
Reply
#35

Nice include! Great work, Emmet!
Reply
#36

Quote:
Originally Posted by vannesenn
Посмотреть сообщение
Nice work and include Emmet_! I recommend to use macro definition because original 1st line has a lot text and params for writing(if you understand me.

Код:
#define DIALOG(%0) \
	Dialog:%0(playerid, response, listitem, inputtext[])
So code will look

Код:
DIALOG(DIALOG_NAME)
{
/* CODE HERE */
return (true);
}
You can redefine that in your script. Adding that would hide function arguments that are being passed, while that is your point many people like to know where that comes from.
Reply
#37

Download link: https://github.com/Awsomedude/easyDialog
New Thread: https://sampforum.blast.hk/showthread.php?tid=602886
Reply
#38

Quote:
Originally Posted by awsomedude
Посмотреть сообщение
Dude... Just make a copy of this thread. You can just hit the quote button to get all of the bbcode, then just make a new thread with the new link and a message saying that Emmet_ is the original author.

However, if you do not plan on maintaining this include then let someone else do it.
Reply
#39

Download link needs to be updated.
Reply
#40

Quote:
Originally Posted by VexHex
Посмотреть сообщение
Download link needs to be updated.
Read the post above my post that is just before yours. This script has a new maintainer. Emmet_ is gone.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)