2021-05-13, 01:20 PM
2021-05-13: y_dialog Inline Parameters
Most documentation on y_dialog callbacks show the following:
However, when the closure also contains playerid, this gets cumbersome to constantly rename the playerid variable passed to the inline, then not use it.? Similarly the dialogid variable is redundant because y_dialog doesn?t use IDs and never provides them for comparison.? Thus, these two parameters are both optional and can be skipped in the inline:
Dialog_ShowCallback takes either iis or iiiis functions.
Most documentation on y_dialog callbacks show the following:
Quote:
inline const Response(pid, dialogid, response, listitem, string:inputtext[])
{
____// Code goes here.
}
Dialog_ShowCallback(playerid, using inline Response, DIALOG_STYLE_INPUT, "Title", "Contents", "OK");
However, when the closure also contains playerid, this gets cumbersome to constantly rename the playerid variable passed to the inline, then not use it.? Similarly the dialogid variable is redundant because y_dialog doesn?t use IDs and never provides them for comparison.? Thus, these two parameters are both optional and can be skipped in the inline:
Quote:
inline const Response(response, listitem, string:inputtext[])
{
____// Code goes here.
}
Dialog_ShowCallback(playerid, using inline Response, DIALOG_STYLE_INPUT, "Title", "Contents", "OK");
Dialog_ShowCallback takes either iis or iiiis functions.