---
description: You can now use, change or even hide the ability interface as you wish.
---

# Ability UI

{% embed url="https://youtu.be/Kp-BufjfRyQ" %}

<details>

<summary>Available Cards</summary>

```lua
local available_card_sets = {
        ["ability_cards"] = {
            "ability_card_back",
            "ability_card_black_ink_only",
            "ability_card_design_masked",
            "ability_card_glint",
            "ability_card_no_color",
            "corner_bg",
            "menu_icon_ability_combat",
            "menu_icon_ability_defense",
            "menu_icon_ability_recovery",
        },
        ["ability_cards_set_a"] = {
            "ability_card_a_moment_to_recuperate",
            "ability_card_focus_fire",
            "ability_card_paint_it_black",
            "ability_card_quite_an_inspiration",
            "ability_card_slippery_bastard",
            "ability_card_slow_and_steady",
        },
        ["ability_cards_set_b"] = {
            "ability_card_cold_blooded",
            "ability_card_come_back_stronger",
            "ability_card_eye_for_an_eye",
            "ability_card_iron_lung",
            "ability_card_kick_in_the_butt",
            "ability_card_live_for_the_fight",
            "ability_card_peak_condition",
            "ability_card_ride_like_the_wind",
            "ability_card_strange_medicine",
            "ability_card_the_gift_of_focus",
        },
        ["ability_cards_set_c"] = {
            "ability_card_gunslingers_choice",
            "ability_card_hangman",
            "ability_card_horseman",
            "ability_card_landons_patience",
            "ability_card_necessity_breeds",
            "ability_card_sharpshooter",
            "ability_card_the_short_game",
            "ability_card_winning_streak",
        },
        ["ability_cards_set_d"] = {
            "ability_card_fool_me_once",
            "ability_card_friends_for_life",
            "ability_card_hunker_down",
            "ability_card_never_without_one",
            "ability_card_of_single_purpose",
            "ability_card_strength_in_numbers",
            "ability_card_take_the_pain_away",
            "ability_card_the_unblinking_eye",
            "ability_card_to_fight_another_day",
        },
    }
```



</details>

<details>

<summary>Usable Colors</summary>

[All RDR Colors](https://github.com/abdulkadiraktas/rdr3_discoveries/tree/master/useful_info_from_rpfs/colours#full-codes)

or

```lua
local defaultAbilityColors= { -- you can use all colors on rdr2 but default ones here
        "ABILITY_CARD_DEAD_EYE_TIER_1",
        "ABILITY_CARD_DEAD_EYE_TIER_2",
        "ABILITY_CARD_DEAD_EYE_TIER_3",
        "ABILITY_CARD_COMBAT_TIER_1",
        "ABILITY_CARD_COMBAT_TIER_2",
        "ABILITY_CARD_COMBAT_TIER_3",
        "ABILITY_CARD_DEFENSE_TIER_1",
        "ABILITY_CARD_DEFENSE_TIER_2",
        "ABILITY_CARD_DEFENSE_TIER_3",
        "ABILITY_CARD_RECOVERY_TIER_1",
        "ABILITY_CARD_RECOVERY_TIER_2",
        "ABILITY_CARD_RECOVERY_TIER_3",
    }

```

</details>

<details>

<summary>Example</summary>

```lua
RegisterCommand("abilityUI",function(src,args,raw)
    local abilityUi = exports["qadr_ui"]:abilityUiCreator()
    local available_card_sets = {
        ["ability_cards"] = {
            "ability_card_back",
            "ability_card_black_ink_only",
            "ability_card_design_masked",
            "ability_card_glint",
            "ability_card_no_color",
            "corner_bg",
            "menu_icon_ability_combat",
            "menu_icon_ability_defense",
            "menu_icon_ability_recovery",
        },
        ["ability_cards_set_a"] = {
            "ability_card_a_moment_to_recuperate",
            "ability_card_focus_fire",
            "ability_card_paint_it_black",
            "ability_card_quite_an_inspiration",
            "ability_card_slippery_bastard",
            "ability_card_slow_and_steady",
        },
        ["ability_cards_set_b"] = {
            "ability_card_cold_blooded",
            "ability_card_come_back_stronger",
            "ability_card_eye_for_an_eye",
            "ability_card_iron_lung",
            "ability_card_kick_in_the_butt",
            "ability_card_live_for_the_fight",
            "ability_card_peak_condition",
            "ability_card_ride_like_the_wind",
            "ability_card_strange_medicine",
            "ability_card_the_gift_of_focus",
        },
        ["ability_cards_set_c"] = {
            "ability_card_gunslingers_choice",
            "ability_card_hangman",
            "ability_card_horseman",
            "ability_card_landons_patience",
            "ability_card_necessity_breeds",
            "ability_card_sharpshooter",
            "ability_card_the_short_game",
            "ability_card_winning_streak",
        },
        ["ability_cards_set_d"] = {
            "ability_card_fool_me_once",
            "ability_card_friends_for_life",
            "ability_card_hunker_down",
            "ability_card_never_without_one",
            "ability_card_of_single_purpose",
            "ability_card_strength_in_numbers",
            "ability_card_take_the_pain_away",
            "ability_card_the_unblinking_eye",
            "ability_card_to_fight_another_day",
        },
    }
    local colors = { -- you can use all colors on rdr2 but default ones here
        "ABILITY_CARD_DEAD_EYE_TIER_1",
        "ABILITY_CARD_DEAD_EYE_TIER_2",
        "ABILITY_CARD_DEAD_EYE_TIER_3",
        "ABILITY_CARD_COMBAT_TIER_1",
        "ABILITY_CARD_COMBAT_TIER_2",
        "ABILITY_CARD_COMBAT_TIER_3",
        "ABILITY_CARD_DEFENSE_TIER_1",
        "ABILITY_CARD_DEFENSE_TIER_2",
        "ABILITY_CARD_DEFENSE_TIER_3",
        "ABILITY_CARD_RECOVERY_TIER_1",
        "ABILITY_CARD_RECOVERY_TIER_2",
        "ABILITY_CARD_RECOVERY_TIER_3",
    }
    local cardData = {
        {
            index = 1,
            indicatorVisible = true,
            color = colors[math.random(1,#colors)],
            cardset = "ability_cards_set_a",
            card = available_card_sets["ability_cards_set_a"][math.random(1,#available_card_sets["ability_cards_set_a"])],
            unlocked = true, -- if set false, you can use rankText
            rankText = "30",
            cardtier = 3,  -- 1 min max 4
        },
        {
            index = 2,
            indicatorVisible = true,
            color = colors[math.random(1,#colors)],
            cardset = "ability_cards_set_b",
            card = available_card_sets["ability_cards_set_b"][math.random(1,#available_card_sets["ability_cards_set_b"])],
            unlocked = true, -- if set false, you can use rankText
            rankText = "30",
            cardtier = 3,  -- 1 min max 4
        },
        {
            index = 3,
            indicatorVisible = false,
            color = colors[math.random(1,#colors)],
            cardset = "ability_cards_set_c",
            card = available_card_sets["ability_cards_set_c"][math.random(1,#available_card_sets["ability_cards_set_c"])],
            unlocked = true, -- if set false, you can use rankText
            rankText = "30",
            cardtier = 3,  -- 1 min max 4
        },
        {
            index = 4,
            indicatorVisible = true,
            color = colors[math.random(1,#colors)],
            cardset = "ability_cards_set_d",
            card = available_card_sets["ability_cards_set_d"][math.random(1,#available_card_sets["ability_cards_set_d"])],
            unlocked = true, -- if set false, you can use rankText
            rankText = "30",
            cardtier = 3,  -- 1 min max 4
        }
    }
    abilityUi:setCardToUiItemList(cardData)
    abilityUi:enablePauseMenuButton(false)
    local indicatorData = {
        {
            index = 1, -- 1 min max 4 (cardData index)
            visible = true, -- true or false nill = false
        },
        {
            index = 4,
            visible = true,
        }
    }
    abilityUi:setIndicator(indicatorData)
    Wait(5000)
    local getUI = exports["qadr_ui"]:getAbilityUI()
    getUI:enablePauseMenuButton(true)
end)
```



</details>

<details>

<summary>Usable functions</summary>

```lua
local abilityUi = exports["qadr_ui"]:abilityUiCreator() -- Main UI Creator Function. Returns usable functions
abilityUi:setCardToUiItemList(cardData) -- This functions need cardData. Check example for more information.
abilityUi:enablePauseMenuButton(false) -- You can set pause menu button disable. False means disabled.
abilityUi:setIndicator(indicatorData) -- You hide/show only indicator with index. Check example for indicatorData table.

local latestAbilityUI = exports["qadr_ui"]:getAbilityUI() -- Return abilityUi main functions.
if latestAbilityUI then
    latestAbilityUI:enablePauseMenuButton(true) -- You can set pause menu button enable. true means enabled.
end
```



</details>

##
