diff --git a/ndialog-pages.inc b/ndialog-pages.inc index 69cda3f..85e7609 100644 --- a/ndialog-pages.inc +++ b/ndialog-pages.inc @@ -21,6 +21,7 @@ ShowPlayerDialogPages(playerid, const function[], style, const caption[], const #tryinclude //By Y_Less | Thank you, great include <3 #tryinclude //By Y_Less | Thank you, great include <3 +#tryinclude //By Y_Less | Support added by Tiaansu #tryinclude //By BigETI | Support added by wiger3 #if defined NDP_USE_LOGGER #include //Uncomment to include logger, useful for debugging. @@ -62,6 +63,12 @@ forward OnDialogPagesPerformed(playerid, const dialog[], response, bool:success, #define INVALID_LISTITEM (0xFFFF) // The definition for an Invalid Listitem, don't go above -1 //#define NDP_AUTO (MAX_DIALOG_ITEMS) // Defines the size of the automatic detection definition of list items amount per page. +#if YSI_VERSION_MAJOR == 5 && defined _INC_y_inline + static stock + NDP_DialogName[64] = "Inline_DialogPages", + Func:NDP_InlineCB; +#endif + /************************************************************ ENUMERATORS *************************************************************/ @@ -242,6 +249,19 @@ stock ShowPlayerDialogPages(playerid, const function[], style, const caption[], return NDP_DialogInvoke(playerid, NDP_DIALOG_TYPE_DIALOG, function, 32701, style, caption, button1, button2, items_per_page, nextbutton, backbutton); } +/* Same as ShowPlayerDialogPages but with inline support. */ +#if YSI_VERSION_MAJOR == 5 && defined _INC_y_inline + stock ShowInlineDialogPages(playerid, Func:cb, style, const caption[], const button1[], const button2[], items_per_page, const nextbutton[] = "{FF0000}>>>", const backbutton[] = "{FF0000}<<<") + { + if (ShowPlayerDialogPages(playerid, NDP_DialogName, style, caption, button1, button2, items_per_page, nextbutton, backbutton)) + { + Indirect_Claim(cb); + NDP_InlineCB = cb; + } + return 1; + } +#endif + /************************************************************ INTERNAL FUNCTIONS *************************************************************/ @@ -663,6 +683,20 @@ static stock NDP_ProcessDialogResponse(playerid, dialogid, response, listitem, i return 0; } +#if YSI_VERSION_MAJOR == 5 && defined _INC_y_inline + DialogPages:Inline_DialogPages(playerid, response, listitem, string:inputtext[]) + { + new Func:cb = NDP_InlineCB; + NDP_InlineCB = Func:0; + + @.cb(response, listitem, inputtext); + + Indirect_Release(cb); + + return 1; + } +#endif + /************************************************************ _ALS_ HOOKING *************************************************************/