[Include] Dialogs include - Adding new styles to SAMP GUI

It seems to screw with other includes/functions using OnPlayerClickPlayerTextDraw, basically, no matter what IDs you choose for each it triggers OnDialogResponse. An mSelection feature was triggering my login system, resolved when i removed the include.
Reply

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
It seems to screw with other includes/functions using OnPlayerClickPlayerTextDraw, basically, no matter what IDs you choose for each it triggers OnDialogResponse. An mSelection feature was triggering my login system, resolved when i removed the include.
I am working on a new version which will be fixing all known issues.
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Sometimes (or maybe most of the times) it goes above the scroll button (the down one) and when the pages are less it stays a bit up than sticking its bottom to the scroll down button. (best understand by going in game)
Fixed. Check your github

UPD: Images
Reply

Quote:
Originally Posted by OstGot
Посмотреть сообщение
Fixed. Check your github

UPD: Images
Thanks! Updated the include!
Reply

How textdraw looks on diffrent screen resolution? By the way nice design.
Reply

Quote:
Originally Posted by Sanady
Посмотреть сообщение
How textdraw looks on diffrent screen resolution? By the way nice design.
They were initially built on standard resolution of 16x9.
Reply

Update v2.5
- Bug fixes: Showing a dialog simultaneously ended up in no dialog on screen (now fixed).
- New dialog function to add content through arrays: (faster method than "ShowPlayerDialog")
pawn Код:
ShowPlayerPreviewModelDialog(playerid, dialogid, style, caption[], models[], labels[][], button1[], button2[], limit = sizeof (models));
Reply

Hi, how to take the model ID of the selected list item?
Reply

Quote:
Originally Posted by maraz1987
Посмотреть сообщение
Hi, how to take the model ID of the selected list item?
Hi. Reading the model id is similar to how you read listitems from other dialog styles. You create the list so you should know which listitem belongs to which model id.

For example:
pawn Код:
new models[] = {0, 1, 2};
new labels[][] = {"item1", "item2", "item3"};

// Show dialog to player
ShowPlayerPreviewModelDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "Dialog:", models, labels, "Button1", "Button2");

// Response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 0)
    {
        if (response)
        {
            new str[45];
            format(str, sizeof (str), "Listitem: %i, Modelid: %i", listitem, models[listitem]);
            SendClientMessage(playerid,-1, str);
        }
    }
}
Reply

Gammix, It is possible to specify the position of the model and the size of it?
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Hi. Reading the model id is similar to how you read listitems from other dialog styles. You create the list so you should know which listitem belongs to which model id.

For example:
pawn Код:
new models[] = {0, 1, 2};
new labels[][] = {"item1", "item2", "item3"};

// Show dialog to player
ShowPlayerPreviewModelDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "Dialog:", models, labels, "Button1", "Button2");

// Response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 0)
    {
        if (response)
        {
            new str[45];
            format(str, sizeof (str), "Listitem: %i, Modelid: %i", listitem, models[listitem]);
            SendClientMessage(playerid,-1, str);
        }
    }
}
're Interested in on the thank you, I'm doing it , but you do not have the easier way to do this? For example Dialog_GetModel... use ?
Reply

Quote:
Originally Posted by Kolstin
Посмотреть сообщение
Gammix, It is possible to specify the position of the model and the size of it?
Yes, checkout Dialog_SetListitem.

Quote:
Originally Posted by maraz1987
Посмотреть сообщение
're Interested in on the thank you, I'm doing it , but you do not have the easier way to do this? For example Dialog_GetModel... use ?
Are you using arrays with ShowPlayerPreviewModelDialog?
Or are you using ShowPlayerDialog ?
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Yes, checkout Dialog_SetListitem.



Are you using arrays with ShowPlayerPreviewModelDialog?
Or are you using ShowPlayerDialog ?
I use them both.
Reply

Quote:
Originally Posted by maraz1987
Посмотреть сообщение
I use them both.
Edit the include with this piece of code at the end:
pawn Код:
stock Dialog_GetModel(playerid, listitem)
{
    if (playerid < 0 || playerid >= MAX_PLAYERS)
    {
        return false;
    }

    if (pDialogStyle[playerid] == -1)
    {
        return false;
    }

    new index;

    switch (pDialogStyle[playerid])
    {
        case DIALOG_STYLE_PREVMODEL,
             DIALOG_STYLE_PREVMODEL_LIST:
        {
            if (listitem >= pDialogTotalListitems[playerid])
            {
                return false;
            }

            index = listitem - (floatround(Float:(listitem - (6 * 4)), floatround_floor) * (6 * 4));
            if (index >= (6 * 4))
            {
                return false;
            }

            return Dialog_GetModel(playerid, listitem);
        }
    }

    return true;
}
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Edit the include with this piece of code at the end:
pawn Код:
stock Dialog_GetModel(playerid, listitem)
{
    if (playerid < 0 || playerid >= MAX_PLAYERS)
    {
        return false;
    }

    if (pDialogStyle[playerid] == -1)
    {
        return false;
    }

    new index;

    switch (pDialogStyle[playerid])
    {
        case DIALOG_STYLE_PREVMODEL,
             DIALOG_STYLE_PREVMODEL_LIST:
        {
            if (listitem >= pDialogTotalListitems[playerid])
            {
                return false;
            }

            index = listitem - (floatround(Float:(listitem - (6 * 4)), floatround_floor) * (6 * 4));
            if (index >= (6 * 4))
            {
                return false;
            }

            return Dialog_GetModel(playerid, listitem);
        }
    }

    return true;
}
Thank you for your interest!
Reply

sorry del...
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Edit the include with this piece of code at the end:
pawn Код:
stock Dialog_GetModel(playerid, listitem)
{
    if (playerid < 0 || playerid >= MAX_PLAYERS)
    {
        return false;
    }

    if (pDialogStyle[playerid] == -1)
    {
        return false;
    }

    new index;

    switch (pDialogStyle[playerid])
    {
        case DIALOG_STYLE_PREVMODEL,
             DIALOG_STYLE_PREVMODEL_LIST:
        {
            if (listitem >= pDialogTotalListitems[playerid])
            {
                return false;
            }

            index = listitem - (floatround(Float:(listitem - (6 * 4)), floatround_floor) * (6 * 4));
            if (index >= (6 * 4))
            {
                return false;
            }

            return Dialog_GetModel(playerid, listitem);
        }
    }

    return true;
}
Function does not work, does not return the model ID.

Returned number: 0
Reply

Quote:
Originally Posted by maraz1987
Посмотреть сообщение
Function does not work, does not return the model ID.

Returned number: 0
Wait you cannot use this actually because OnDialogResponse will be delayed due to CallRemoteFunction and in that time, the player dialog data gets reset.

I'll modify the include soon.
Reply

Quote:
Originally Posted by Gammix
Посмотреть сообщение
It was caused due to the limit of PVars, i am still using PVars but now only 1 PVar per listitem. So if any of your other scripts uses say 100 PVars, you can still have a maximum of 700 preview model listitems.

And the random labels or text appearance has also been fixed.

Update v2.7.2:
- Increased the dialog listitems limit (maximum allowed 800 - depends on the usage of PVars)
- Fixed random labels or text appearance when there was none set.
thanks! +rep
Reply

Quote:
Originally Posted by Jensenn
Посмотреть сообщение
thanks! +rep
YN'ye mi ekleyeceksin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)