GPD.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // GPD.inc
  2. /*
  3. native GetPlayerDialog(playerid);
  4. */
  5. #if !defined INVALID_DIALOG_ID
  6. #define INVALID_DIALOG_ID (-1)
  7. #endif
  8. static
  9. s_iOpenedDialogID[MAX_PLAYERS];
  10. stock GetPlayerDialog(playerid)
  11. {
  12. return s_iOpenedDialogID[playerid];
  13. }
  14. stock DL_ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])
  15. {
  16. new
  17. ret = ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  18. if((dialogid != -1 && style >= 0) && strcmp(caption, " ") != 0 && strcmp(info, " ") != 0)
  19. {
  20. s_iOpenedDialogID[playerid] = dialogid;
  21. }
  22. return ret;
  23. }
  24. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  25. {
  26. s_iOpenedDialogID[playerid] = -1;
  27. #if defined DL_OnDialogResponse
  28. return DL_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  29. #else
  30. return 1;
  31. #endif
  32. }
  33. #if defined _ALS_ShowPlayerDialog
  34. #undef ShowPlayerDialog
  35. #else
  36. #define _ALS_ShowPlayerDialog
  37. #endif
  38. #define ShowPlayerDialog DL_ShowPlayerDialog
  39. #if defined _ALS_OnDialogResponse
  40. #undef OnDialogResponse
  41. #else
  42. #define _ALS_OnDialogResponse
  43. #endif
  44. #define OnDialogResponse DL_OnDialogResponse
  45. #if defined DL_OnDialogResponse
  46. forward DL_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  47. #endif