Vivum Target

Item Styles

Learn how to style target menu items

Default

Destructive

Success

Ghost

Default

Destructive

Success

Ghost

Overview

Vivum Target supports a variety of styles for the menu items. The style property in the item accepts any key of the Config.Graphics.Menu.Styles table.

@class Item : EntityPositioner
FieldTypeDescription
label

string

name?

string

Optional name to reference the item by. Item.label will be used if not specified.

icon?

string | MenuIconTexture

The favicon to display left of the label. A texture object can be specified to render a specific ingame texture (like that of a ped headshot).

style?

"default" | "destructive" | "success" | "ghost"

The theming of the item. Any value specified in Config.Graphics.Menu.Styles will work.

action?

fun(menu: Menu, itemIndex: number, item: Item, coords: vector3, distance: number, entity?: number): boolean | nil

The returned value will be used to determine whether the menu should be hidden after the action is performed. If nil or true is returned, the menu will be hidden (If Config.HideOnAction is set to true), if false is returned it will ignore the Config.HideOnAction setting.

canInteract?

fun(entity?: number, coords: vector3, distance: number, name?: string, bone?: string | number | number[] | string[]): boolean

distance?

number

Override maximum distance at which the item can be interacted with.

styles.lua

exports["vivum-target"]:AddTarget({
	name = "styles",
	target = {
		position = vector3(0, 0, 0),
	},
    items = {
        {
            label = "Default",
            style = "default",
        },
        {
            label = "Destructive",
            style = "destructive",
        },
        {
            label = "Success",
            style = "success",
        },
        {
            label = "Ghost",
            style = "ghost",
        }
    }
})