Best way for handling custom textdraw menus? (enums, dialog style IDs)
#1

Hi guys. I have created TD menus, I am now struggling to decide which would be a better option.

Would it be better to create an enum, then store EACH menu created, it's info, and return it's ID and then show it to the player? Or just like dialogs, create ONE type and show it to all? I have no idea on how to go ahead with this.

If it's not clear, do ask.
Also, I'd like to know how do you 'create' tags for your variables?
pawn Код:
new TextDrawMenu: custom_menu;
ShowMenu( custom_menu );
Thanks!
Reply
#2

2. You've just created a tag! Simply creating a variable with your new custom tag will do this. Also keep in mind that named enums register a new tag type.

1. Really, it's completely up to you. I don't quite know what do you mean by creating enum. Do you have in mind something like enumerated array?

pawn Код:
#define MAX_CUSTOM_TEXTDRAWS    20

enum E_CUSTOM_TEXTDRAW {
    Text:tid,
    tmessage[128]
}
static
    CustomTextDraws[MAX_CUSTOM_TEXTDRAWS][E_CUSTOM_TEXTDRAW],
    Iterator:CustomTextDraws<MAX_CUSTOM_TEXTDRAWS>;
In either case, think what will be easier for you to work with and go with it.
Reply
#3

Thanks for replying! By enums, I meant.. Storing each menu's data indivisually under the ''create stock'' and returning an id, which then you use under the show stock.. Also, you said I created a tag, but if I don't use it, I won't get a tag mismatch error! Could you please explain to me 'named enums', I have seen examples, but not the syntax, really. And then how'd you use it? Thanks already!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)