DIALOG_STYLE_LIST not all is displayed..
#1

Here is the enum for the attachments:

pawn Код:
enum AttachmentEnum
{
    attachmodel,
    attachname[128],
    attachprice
}

new AttachmentObjects[][AttachmentEnum] = {
{18927, "Azure Hat", 500},
{18928, "Funky Hat", 500},
{18929, "Dark Gray Hat", 500},
{18931, "Dark Blue Hat", 500},
{18932, "Orange Hat", 500},
{18933, "Light Gray Hat", 500},
{18934, "Pink Hat", 500},
{18935, "Yellow Hat", 500},
{18945, "Gray Hat Boater", 500},
{18946, "Gray Hat Boater 2", 500},
{18947, "Black Hat Bowler", 500},
{18948, "Azure Hat Bowler", 500},
{18949, "Green Hat Bowler", 500},
{18950, "Red Hat Bowler", 500},
{18951, "Light Green Hat Bowler", 500},
{19488, "White Hat Bowler", 500},
{18967, "Simple Black Hat", 500},
{18968, "Simple Gray Hat", 500},
{18969, "Simple Orange Hat", 500},
{18970, "Tiger Hat", 500},
{18971, "Black & White Cool Hat", 500},
{18972, "Black & Orange Cool Hat", 500},
{18973, "Black & Green Cool Hat", 500},
{19066, "Santa Hat", 3000},
{19067, "Red Hoody Hat", 500},
{19068, "Tiger Hoody Hat", 500},
{19069, "Black Hoody Hat", 500},
{19093, "White Dude Hat", 500},
{19095, "Brown Cowboy Hat", 500},
{19096, "Black Cowboy Hat", 500},
{19097, "Black Cowboy Hat 2", 500},
{19098, "Brown Cowboy Hat 2", 500},
{19352, "Black Top Hat", 500},
{19487, "White Top Hat", 500},
{18964, "Black Skully Cap", 500},
{18965, "Brown Skully Cap", 500},
{18966, "Funky Skully Cap", 500},
{18939, "Dark Blue CapBack", 500},
{18940, "Azure CapBack", 500},
{18941, "Black CapBack", 500},
{18942, "Gray CapBack", 500},
{18943, "Green CapBack", 500},
{19006, "Red Glasses", 500},
{19007, "Green Glasses", 500},
{19008, "Yellow Glasses", 500},
{19009, "Azure Glasses", 500},
{19010, "Pink Glasses", 500},
{19011, "Funky Glasses", 500},
{19012, "Gray Glasses", 500},
{19013, "Funky Glasses 2", 500},
{19014, "Black & White Glasses", 500},
{19015, "White Glasses", 500},
{19016, "X-Ray Glasses", 3000},
{19017, "Covered Yellow Glasses", 500},
{19018, "Covered Orange Glasses", 500},
{19019, "Covered Red Glasses", 500},
{19020, "Covered Blue Glasses", 500},
{19021, "Covered Green Glasses", 500},
{19022, "Cool Black Glasses", 500},
{19023, "Cool Azure Glasses", 500},
{19024, "Cool Blue Glasses", 500},
{19025, "Cool Pink Glasses", 500},
{19026, "Cool Red Glasses", 500},
{19027, "Cool Orange Glasses", 500},
{19028, "Cool Yellow Glasses", 500},
{19029, "Cool Yellow Glasses", 500},
{19030, "Pink Nerd Glasses", 500},
{19031, "Green Nerd Glasses", 500},
{19032, "Red Nerd Glasses", 500},
{19033, "Black Nerd Glasses", 500},
{19034, "Black & White Nerd Glasses", 500},
{19035, "Ocean Nerd Glasses", 500},
{18891, "Purple Bandana", 500},
{18892, "Red Bandana", 500},
{18893, "Red&White Bandana", 500},
{18894, "Orange Bandana", 500},
{18895, "Skull Bandana", 500},
{18896, "Black Bandana", 500},
{18897, "Blue Bandana", 500},
{18898, "Green Bandana", 500},
{18899, "Pink Bandana", 500},
{18900, "Funky Bandana", 500},
{18901, "Tiger Bandana", 500},
{18902, "Yellow Bandana", 500},
{18903, "Azure Bandana", 500},
{18904, "Dark Blue Bandana", 500},
{18905, "Olive Bandana", 500},
{18906, "Orange&Yellow Bandana", 500},
{18907, "Funky Bandana 2", 500},
{18907, "Blue Bandana 2", 500},
{18907, "Azure Bandana 2", 500},
{18907, "Fire Bandana", 500},
{18911, "Skull Bandana Mask", 500},
{18912, "Black Bandana Mask", 500},
{18913, "Green Bandana Mask", 500},
{18914, "Army Bandana Mask", 500},
{18915, "Funky Bandana Mask", 500},
{18916, "Light Bandana Mask", 500},
{18917, "Dark Blue Bandana Mask", 500},
{18918, "Gray Bandana Mask", 500},
{18919, "White Bandana Mask", 500},
{18920, "Colorful Bandana Mask", 500},
{19421, "White Headphones", 500},
{19422, "Black Headphones", 500},
{19423, "Gray Headphones", 500},
{19424, "Blue Headphones", 500},
{19036, "White Hockey Mask", 500},
{19037, "Red Hockey Mask", 500},
{19038, "Green Hockey Mask", 500},
{2919, "Sports Bag", 500},
{3026, "Jansport Backpack", 500},
{18645, "Red&White Motorcycle Helmet", 500},
{18976, "Blue Motorcycle Helmet", 500},
{18977, "Red Motorcycle Helmet", 500},
{18978, "White Motorcycle Helmet", 500},
{18979, "Purple Motorcycle Helmet", 500}
};
Here is the code for the dialog to be displayed:

pawn Код:
if(dialogid == TOY_SHOP_MENU)
    {
        if(!response)
        {
            SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
            return 1;
        }
        if(response)
        {
            new id;
            sscanf(inputtext[7], "d", id);
            if(ToyInfo[playerid][id][tCreated] == 0)
            {
                new string[8000+1];
                for(new x;x<sizeof(AttachmentObjects);x++)
                {
                    format(string, sizeof(string), "%sID: %d - Name: %s - Price: $%d\n", string, x, AttachmentObjects[x][attachname], AttachmentObjects[x][attachprice]);
                }
                ShowPlayerDialog(playerid, TOY_SHOP_PURCHASE, DIALOG_STYLE_LIST, \
                "{FF0000}Toy Shop - Select a Toy to Purchase", string, "Select", "Cancel");
                PurchaseToy[playerid] = id;
                return 1;
            }
            else if(ToyInfo[playerid][id][tCreated] == 1)
            {
                ShowPlayerDialog(playerid, TOY_SHOP_EDIT, DIALOG_STYLE_LIST, "{FF0000}Toy Shop - Modify Index Selection", "Edit\nDelete", "Select", "Cancel");
                ModifyToy[playerid] = id;
                return 1;
            }
        }
    }
It will cut off for example

ID: example - Name: blah blah - Price $500
ID: example - Name: bl
Reply
#2

From the SA:MP limits wiki page

Quote:

Info (Main text) 2048 N/A
Caption 64 N/A
Input Text (DIALOG_STYLE_INPUT and DIALOG_STYLE_PASSWORD) 128 N/A

Which means that there's a 2048 characters limit (including colors, new lines and all) that can be displayed at once.
Reply
#3

Even when you don't reach the maximum character limit, there is a maximum of 50 lines in a list dialog.
Reply
#4

Quote:
Originally Posted by CuervO
Посмотреть сообщение
From the SA:MP limits wiki page



Which means that there's a 2048 characters limit (including colors, new lines and all) that can be displayed at once.
Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
Even when you don't reach the maximum character limit, there is a maximum of 50 lines in a list dialog.
That's interesting it gets to like ID 90 (90 lines) and then cuts off about there. How would I go about resolving this then? I would know what to do regarding normal lists but this I'm not too familiar with.
Reply
#5

Different pages, display a min and a max. This is an example from my scripts:

pawn Код:
SetPVarInt(playerid, "listviewingmax", 10);
SetPVarInt(playerid, "listviewingmin", 0);

for(new i = GetPVarInt(playerid,"listviewingmin"); i <= GetPVarInt(playerid,"listviewingmax"); i ++)
{
   //code
}
Basically that will loop from the min possibility until the max possibility, this case from 0-10. Add a next or something and increase both the min and max then re display it again.
Reply
#6

Quote:
Originally Posted by CuervO
Посмотреть сообщение
Different pages, display a min and a max. This is an example from my scripts:

pawn Код:
SetPVarInt(playerid, "listviewingmax", 10);
SetPVarInt(playerid, "listviewingmin", 0);

for(new i = GetPVarInt(playerid,"listviewingmin"); i <= GetPVarInt(playerid,"listviewingmax"); i ++)
{
   //code
}
Basically that will loop from the min possibility until the max possibility, this case from 0-10. Add a next or something and increase both the min and max then re display it again.
Sorry I don't really follow? Could you maybe explain in a little more detail?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)