📒Usable Handheld Catalogue

This function cannot be exported. Therefore, the 'catalog.lua' file has been added. You can write all your catalog-related code here. Additionally, example codes are included in this file.

Event Handling
AddEventHandler("qadr_ui:catalog_selectedItem",function(data)
    -- also you can listen onselected
    -- data return selected item info
    print("qadr_ui:catalog_selectedItem")
end)

AddEventHandler("qadr_ui:catalog_hovered",function(data)
    -- also you can listen onhovered
    -- data return hovered item info
    print("qadr_ui:catalog_hovered")
end)
Page Items Examples
-- Page item examples
local contentItem = {
    itemName = "Items 1",
    diver = false,
    onHovered = function(data)        
    end,
    onSelected =function(data)
    end,
    setPage = 7, -- page index start from 0
}
local pageItem = {
    TextureDictionary = "ui_consumable_predator_bait",
    TextureName = "grid_of_4_layout_0",
    Header =  "Header",
    SubHeader =  "SubHeader",
    Description =  "Description",
    OldPrice =  "Old Price 30$",
    TokenPrice = "1",
    ItemRank = "Rank 1",
    ItemPrice =  "50",
    PriceLabel =  "",
    Focused =  true,
    TokenVisible = true,
    onHovered = function(data)        
    end,
    onSelected =function(data)
    end,
}
local pageAdvertyItem = {
    AdvertTextureDictionary = "ui_advert_whr_quarter_benefits", -- tam sayfa için bu
    AdvertTextureName = "grid_of_4_layout_0",
    onHovered = function(data)        
    end,
    onSelected =function(data)
    end,
}
Command Example
RegisterCommand("catalog",function()
    local createCatalog = catalogCreator()
    local contentPageDouble = createCatalog:pageCreator({
        header = "NPageHeader",
        PageTitle = "PageTitle 1",
        pageType = "contentPageDouble",
        TextureName = "catalog_index_double",
        TextureDictionary = "catalog_index_double",
        doubleItemList = {
            leftSide = {
                contentItem,
                contentItem,
            },
            rightSide = {
                contentItem,
                contentItem,
                contentItem,
            }
        }
    })
    local contentPage = createCatalog:pageCreator({
        header = "NPageHeader",
        PageTitle = "PageTitle 2",
        pageType = "contentPage",
        singleItemList = {
            contentItem,
            contentItem,
            contentItem,
            contentItem,
            contentItem,
            contentItem,
        }
    })
    local bundle_page = createCatalog:pageCreator({
        pageType = "bundle_page",
        header = "NPageHeader",
        pagedata = {
            ItemName =  "ItemName",
            ItemSubHeader = "ItemSubHeader",
            Focused = false,
            TextureDictionary = "UI_CLOTHING_STYLE_F_BOUNTY_HUNTER_OUTFIT_01",
            TextureName = "fullpage_layout_6",
            ItemDollarSymbolVisible = true,
            ItemPriceDollar = "1",
            ItemPriceCents = "2",
            ItemOldPrice = "3",
            ItemSelection = "ItemSelection",
            onHovered = function(data)                
            end,
            onSelected =function(data)
            end,
        }
    })
    local horse_page = createCatalog:pageCreator({
        pageType = "horse_page",
        header = "NPageHeader",
        pagedata = {
            ItemName =  "ItemName",
            ItemSubHeader = "",
            Focused = false,
            Hovered = true,
            TextureDictionary = "UI_CLOTHING_STYLE_M_MOONSHINER_OUTFIT_01",
            TextureName = "fullpage_layout_6",
            ItemTokenVisible = true,
            ItemTokenPrice = "ItemTokenPrice",
            ItemDollarSymbolVisible = true,
            ItemPriceDollar = "1",
            ItemPriceCents = "2",
            ItemOldPrice = "3",
            ItemSelection = "",
            onHovered = function(data)
                
            end,
            onSelected = function(data)
            end,
        }
    })
    local onePageFourItems = createCatalog:pageCreator({
        pageType = "onePageFourItems",
        header = "NPageHeader",
        pageItemData = {
            pageItem,
            pageAdvertyItem,
            pageItem,
            pageItem,
        }
    })
    local onePageThreeItemType1 = createCatalog:pageCreator({
        pageType = "onePageThreeItemType1", -- you can use 1 or 2 'template_type_2'
        -- If it's onePageThreeItemType1, the 3rd item must be an advert.
        -- If it's onePageThreeItemType2, the 1st item must be an advert.
        -- You can add up to 3 items.
        header = "NPageHeader",
        pageItemData = {
            pageItem,
            pageItem,
            pageAdvertyItem,
        }
    })
    local onePageThreeItemType2 = createCatalog:pageCreator({
        pageType = "onePageThreeItemType2", -- you can use 1 or 2 'template_type_2'
        -- If it's onePageThreeItemType1, the 1st item must be an advert.
        -- If it's onePageThreeItemType2, the 3rd item must be an advert.
        -- You can add up to 3 items.
        header = "NPageHeader",
        pageItemData = {
            pageAdvertyItem,
            pageItem,
            pageItem,
        }
    })
    local image_page = createCatalog:pageCreator({
        pageType = "image_page",
        header = "NPageHeader", -- check texture first
        pagedata = {
            --AdvertTextureDictionary = "header_provisions",
            --AdvertTextureName = "header_provisions",
            ItemName =  "ItemName", -- check texture first
            Focused = false,
            Hovered = true,
            TextureDictionary = "ui_clothing_style_outfit_m_shop_001", -- paralı şeylerde bunu kullan
            TextureName = "fullpage_layout_6",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
        }
    })
    local pageType1 = createCatalog:pageCreator({
        header = "NPageHeader",
        PageTitle = "PageTitle 2",
        pageType = "pageType1", -- you can use 1 to 5 'pageType5'
        pagedata = {
            Focused =  true,
            Hovered =  true,
            TextureDictionary = "ui_weapon_shotgun_doublebarrel_exotic",
            TextureName = "fullpage_layout_4",
            Selection =  "Selection",
            ItemName =  "ItemName",
            DollarVisible =  true,
            Dollar =  "50",
            Cents =  "51",
            OldPrice =  "Old Price 30$",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
        }
    })
    local pageType2 = createCatalog:pageCreator({
        pageType = "pageType2",
        header = "NPageHeader",
        pagedata = {
            Focused =  true,
            Hovered =  true,
            TextureDictionary = "ui_weapon_pistol_volcanic",
            TextureName = "fullpage_layout_1",
            Selection =  "",
            ItemName =  "ItemName",
            DollarVisible =  true,
            Dollar =  "50",
            Cents =  "51",
            OldPrice =  "Old Price 30$",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
            stats = {
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_DAMAGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 10,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 12,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RANGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 20,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 22,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_FIRERATE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RELOAD"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_ACCURACY"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
            }
        }
    })
    local pageType3 = createCatalog:pageCreator({
        pageType = "pageType3",
        header = "NPageHeader",
        pagedata = {
            Focused =  true,
            Hovered =  true,
            TextureDictionary = "ui_weapon_pistol_mauser",
            TextureName = "fullpage_layout_3",
            Selection =  "",
            ItemName =  "ItemName",
            DollarVisible =  true,
            Dollar =  "50",
            Cents =  "51",
            OldPrice =  "Old Price 30$",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
            stats = {
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_DAMAGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 10,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 12,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RANGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 20,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 22,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_FIRERATE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RELOAD"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_ACCURACY"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
            }
        }
    })
    local pageType4 = createCatalog:pageCreator({
        pageType = "pageType4",
        header = "NPageHeader",
        pagedata = {
            Focused =  true,
            Hovered =  true,
            TextureDictionary = "ui_weapon_shotgun_doublebarrel_exotic",
            TextureName = "fullpage_layout_4",
            Selection =  "",
            ItemName =  "ItemName",
            DollarVisible =  true,
            Dollar =  "50",
            Cents =  "51",
            OldPrice =  "Old Price 30$",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
            stats = {
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_DAMAGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 10,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 12,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RANGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 20,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 22,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_FIRERATE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RELOAD"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_ACCURACY"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
            }
        }
    })
    local pageType5 = createCatalog:pageCreator({
        pageType = "pageType5",
        header = "NPageHeader",
        pagedata = {
            Focused =  true,
            Hovered =  true,
            TextureDictionary = "ui_weapon_rifle_elephant",
            TextureName = "fullpage_layout_5",
            Selection =  "",
            ItemName =  "ItemName",
            DollarVisible =  true,
            Dollar =  "50",
            Cents =  "51",
            OldPrice =  "Old Price 30$",
            onHovered = function(data)                
            end,
            onSelected =function(data)                
            end,
            stats = {
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_DAMAGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 10,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 12,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RANGE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 20,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 22,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_FIRERATE"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_RELOAD"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
                {
                    {
                        name = "statLabel",
                        tip = "hash",
                        value = GetHashKey("SHOP_WEAPON_STAT_ACCURACY"),
                    },
                    {
                        name = "invertedCurrentStat",
                        tip = "int",
                        value = 30,
                    },
                    {
                        name = "invertedPotentialStat",
                        tip = "int",
                        value = 32,
                    },
                },
            }
        }
    })
end)

Usable Page Textures

Last updated