GuiInterface

A userdata object representing a GUI interface.

A gui interface is an adapter between a script and a GUI.

Can only be used on the client.

Operations:

Operation Returns Description
GuiInterface == GuiInterface boolean Checks if two instances of GuiInterface refer to the same GuiInterface.

Client-only

addGridItem

guiInterface:addGridItem( gridName, item )

Adds an item to a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
item table The item

addGridItemsFromFile

guiInterface:addGridItemsFromFile( gridName, jsonPath, additionalData )

Adds items to a grid from json

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
jsonPath string Json file path
additionalData (optional) table Additional data to the json (Optional)

addListItem

guiInterface:addListItem( listName, itemName, data )

Appends an item to a list

Parameters:

Name Type Description
gui GuiInterface The Gui interface
listName string The name of the list
itemName string The name of the item
data table Table of data to store

addToPickupDisplay

guiInterface:addToPickupDisplay( uuid, amount )

Adds an item to the item pickup display

Parameters:

Name Type Description
gui GuiInterface The players survival hud interface
uuid Uuid The item uuid
amount number Quantity of items picked up

clearGrid

guiInterface:clearGrid( gridName )

Clears a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid to clear

clearList

guiInterface:clearList( listName )

Clears a list

Parameters:

Name Type Description
gui GuiInterface The Gui interface
listName string The name of the list

clearOnCloseCallback

guiInterface:clearOnCloseCallback(  )

Clears the close callback so it will not be called when the gui is closed

Parameters:

Name Type Description
gui GuiInterface The Gui interface

close

guiInterface:close(  )

Close a gui interface

Parameters:

Name Type Description
gui GuiInterface The Gui interface to close

compassAddIcon

guiInterface:compassAddIcon( iconName, image, showDistance, width, height )

Add an icon to the compass.

Parameters:

Name Type Description
compassHud GuiInterface The compass hud GUI.
iconName string Name of the new compass icon.
image (optional) string The name or path of the image. (Optional)
showDistance (optional) string If the icon should display distance. (Optional)
width (optional) string The width of the icon, defaults to 22. (Optional)
height (optional) string The height of the icon, defaults to 22. (Optional)

compassPingMarker

guiInterface:compassPingMarker(  )

compassRemoveIcon

guiInterface:compassRemoveIcon( iconName )

Remove an icon from the compass.

Parameters:

Name Type Description
compassHud GuiInterface The compass hud GUI.
iconName string Name of a compass icon.

compassSetIconHost - Character

guiInterface:compassSetIconHost( host, joint )

Sets a Character as host for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
host Character The host of the icon
joint (optional) string The joint/bone name (Optional)

compassSetIconHost - Shape

guiInterface:compassSetIconHost( iconName, host, joint )

Sets a Shape as host for a compass icon

Parameters:

Name Type Description
compassHud GuiInterface The compass hud GUI.
iconName string Name of a compass icon.
host Shape The host of the icon
joint (optional) string The host joint/bone name (Optional)

compassSetIconStacking

guiInterface:compassSetIconStacking( iconName, stacking )

Sets whether the icon should be stacked on top of other icons.

Parameters:

Name Type Description
compassHud GuiInterface The compass hud GUI.
iconName string Name of a compass icon.
stacking boolean The stacking setting.

compassSetIconWorldPosition

guiInterface:compassSetIconWorldPosition( iconName, worldPosition, world )

Sets the world position for a world gui

Parameters:

Name Type Description
compassHud GuiInterface The compass hud GUI.
iconName string Name of a compass icon.
worldPosition Vec3 The position to set.
world (optional) World The world, defaults to same as the script

createDropDown

guiInterface:createDropDown( widgetName, functionName, options )

Creates a dropdown at the specified widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
functionName string The name of the function
options table The options in the dropdown menu

createGridFromJson

guiInterface:createGridFromJson( gridName, index )

Creats a grid from a table/json

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
index table Grid data table { type=string, layout=string, itemWidth=integer, itemHeight=integer, itemCount=integer }

createHorizontalSlider

guiInterface:createHorizontalSlider(
    widgetName,
    range,
    value,
    functionName,
    numbered,
    inverted
)

Creates a slider at the specified widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
range number The range of the slider
value number The start value on the slider
functionName string Slider change callback function name
numbered (optional) boolean Enable numbered steps (Defaults to false)
inverted (optional) boolean Invert slider direction (Defaults to false)

createVerticalSlider

guiInterface:createVerticalSlider( widgetName, range, value, functionName )

Creates a slider at the specified widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
range number The range of the slider
value number The start value on the slider
functionName string Slider change callback function name

destroy

guiInterface:destroy(  )

Destroy a gui interface

Parameters:

Name Type Description
gui GuiInterface The interface to destroy

getWorldPosition

guiInterface:getWorldPosition(  )

Gets the current world position of a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface

Returns:

Type Description
Vec3 The in world position of the gui

isActive

guiInterface:isActive(  )

Checks if a gui interface is active

Parameters:

Name Type Description
gui GuiInterface The Gui interface

Returns:

Type Description
boolean True if gui is active

open

guiInterface:open(  )

Open a gui interface

Parameters:

Name Type Description
gui GuiInterface The Gui interface to open

playEffect

guiInterface:playEffect( widgetName, effectName, restart, useHistory )

Plays an effect at a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
effectName string The name of the effect
restart (optional) boolean If the effect should restart if its already playing (Defaults to true)
useHistory (optional) boolean If the effect should use call history (Defaults to false)

playGridEffect

guiInterface:playGridEffect( gridName, index, effectName, restart )

Plays an effect at widget inside a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
index integer The index in the grid
effectName string The name of the effect
restart (optional) boolean If the effect should restart if its already palying (Defaults to true)

removeFromPickupDisplay

guiInterface:removeFromPickupDisplay( uuid, amount )

Removes an item from the item pickup display

Parameters:

Name Type Description
gui GuiInterface The players survival hud interface
uuid Uuid The item uuid
amount number Quantity of items to remove

setButtonCallback

guiInterface:setButtonCallback( buttonName, callback )

Sets a button callback to be called when the button is pressed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
buttonName string The button name
callback string Function to be called when button is pressed

setButtonEnabled

guiInterface:setButtonEnabled( widgetName, enabled )

Sets the enabled state of a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
enabled boolean True if the widget should be enabled

setButtonState

guiInterface:setButtonState( buttonName, state )

Sets the button state

Parameters:

Name Type Description
gui GuiInterface The Gui interface
buttonName string The name of the button
state boolean The state of the button

setColor

guiInterface:setColor( widgetName, Color )

Sets the color of a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
Color Color The color

setContainer

guiInterface:setContainer( gridName, container )

Sets a container to a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
container Container The container

setContainers

guiInterface:setContainers( gridName, containers )

Sets multiple containers to a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
containers table Table of containers. {Container, ..}

setData

guiInterface:setData( widgetName, data )

Sets data to a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
data table The data

setDressbotUnlockCallback

guiInterface:setDressbotUnlockCallback( function )

Sets the Lua callback for when the DressbotGui unlocks something. The callback will receive the uuid of the unlocked customization item.

/

Parameters:

Name Type Description
gui GuiInterface The DressbotGui interface.
function string The name function.

setFadeRange

guiInterface:setFadeRange( range )

Sets the fade range for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
range number The fade range

setFocus

guiInterface:setFocus( widgetName )

Sets a widget to receive key focus

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget that needs focus

setGridButtonCallback

guiInterface:setGridButtonCallback( buttonName, callback )

Sets a callback to be called when a button inside a grid is pressed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
buttonName string The button name
callback string Function to be called when button is pressed

setGridItem

guiInterface:setGridItem( gridName, index, item )

Sets an item in a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
index integer The item index
item table The item

setGridItemChangedCallback

guiInterface:setGridItemChangedCallback( gridName, callback )

Sets a callback to be called when a grid item is changed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The grid name
callback string Function to be called when button is pressed

setGridItemClickedCallback

guiInterface:setGridItemClickedCallback( gridName, callback )

Sets a callback to be called when a grid item is changed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The grid name
callback string Function to be called when button is pressed

setGridMouseFocusCallback

guiInterface:setGridMouseFocusCallback( buttonName, callback )

Sets a callback to be called when a grid widget gets mouse focus

Parameters:

Name Type Description
gui GuiInterface The Gui interface
buttonName string The button name
callback string Function to be called when button is pressed

setGridSize

guiInterface:setGridSize( gridName, index )

Sets the size of a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
index integer The size

setHost - Character

guiInterface:setHost( character, joint )

Sets a Character as host for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
character Character The character to host the gui
joint (optional) string The joint (Optional)

setHost - Shape

guiInterface:setHost( shape, joint )

Sets a Shape as host for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
shape Shape The shape to host the gui
joint (optional) string The joint (Optional)

setIconImage

guiInterface:setIconImage( itembox, uuid )

Sets the icon image to a shape from an uuid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
itembox string The name of the itembox
uuid Uuid The item uuid

setImage

guiInterface:setImage( imagebox, image )

Sets the image of an imagebox

Parameters:

Name Type Description
gui GuiInterface The Gui interface
imagebox string The name of the imagebox widget
image string The name or path of the image

setItemIcon

guiInterface:setItemIcon( imagebox, itemResource, itemGroup, itemName )

Sets the resource, group and item name on an imagebox widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
imagebox string The name of the imagebox
itemResource string The item resource
itemGroup string The item group
itemName string The item name

setListSelectionCallback

guiInterface:setListSelectionCallback( listName, callback )

Sets a callback to be called when a list selection is changed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
listName string The list name
callback string Function to be called when list is selected

setMaxRenderDistance

guiInterface:setMaxRenderDistance( distance )

Sets the maximum render distance for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
distance number The max render distance

setMeshPreview

guiInterface:setMeshPreview( widgetName, uuid )

Sets a mesh preview to display an item from uuid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
uuid Uuid The item uuid to display

setOnCloseCallback

guiInterface:setOnCloseCallback( callback )

Sets a callback to be called when the gui is closed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
callback string Function to be called when gui is closed

setOnOpenCallback

guiInterface:setOnOpenCallback( callback )

Sets a callback to be called when the gui is opened

Parameters:

Name Type Description
gui GuiInterface The Gui interface
callback string Function to be called when gui is opened

setOpenCloseEffect

guiInterface:setOpenCloseEffect( openEffectName, closEffectName )

Overwrites default gui effects with specified open and close effects

Parameters:

Name Type Description
gui GuiInterface The Gui interface
openEffectName string The name of the open effect
closEffectName string The name of the close effect

setRequireLineOfSight

guiInterface:setRequireLineOfSight( required )

Sets if a world gui requires line of sight to be shown

Parameters:

Name Type Description
gui GuiInterface The Gui interface
required boolean True if gui requires line of sight to render

setSelectedDropDownItem

guiInterface:setSelectedDropDownItem(  )

setSelectedListItem

guiInterface:setSelectedListItem( listName, itemName )

Selects an item in a list

Parameters:

Name Type Description
gui GuiInterface The Gui interface
listName string The name of the list
itemName string The name of the item

setSliderCallback

guiInterface:setSliderCallback( sliderName, callback )

Sets a callback to be called when the slider is moved

Parameters:

Name Type Description
gui GuiInterface The Gui interface
sliderName string The button name
callback string Function to be called when slider is moved

setSliderData

guiInterface:setSliderData( sliderName, range, position )

Sets the position and range of a slider

Parameters:

Name Type Description
gui GuiInterface The Gui interface
sliderName string The name of the slider
range unsigned The slider range
position unsigned The slider position

setSliderPosition

guiInterface:setSliderPosition( sliderName, position )

Sets the position of a slider

Parameters:

Name Type Description
gui GuiInterface The Gui interface
sliderName string The name of the slider
position integer The slider position

setSliderRange

guiInterface:setSliderRange( sliderName, range )

Sets the slider range of a slider.

Parameters:

Name Type Description
gui GuiInterface The Gui interface
sliderName string The name of the slider
range integer The slider range

setSliderRangeLimit

guiInterface:setSliderRangeLimit( sliderName, limit )

Sets the range limit of a slider

Parameters:

Name Type Description
gui GuiInterface The Gui interface
sliderName string The name of the slider
limit integer The slider range limit

setText

guiInterface:setText( textbox, text )

Sets the text caption of a textbox widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
textbox string The name of the textbox widget
text string The text

setTextAcceptedCallback

guiInterface:setTextAcceptedCallback( editBoxName, callback )

Sets a callback to be called when the text change is accepted

Parameters:

Name Type Description
gui GuiInterface The Gui interface
editBoxName string The edit box name
callback string Function to be called when text is committed

setTextChangedCallback

guiInterface:setTextChangedCallback( editBoxName, callback )

Sets a callback to be called when the text is changed

Parameters:

Name Type Description
gui GuiInterface The Gui interface
editBoxName string The edit box name
callback string Function to be called when text is edited

setVisible

guiInterface:setVisible( widgetName, visible )

Sets a widget to be visible or not

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
visible boolean True if visible

setWidgetState

guiInterface:setWidgetState( widgetName, state )

Sets the state of a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
state integer The widget state sm.gui.widgetStates

setWorldPosition

guiInterface:setWorldPosition( worldPosition, world )

Sets the world position for a world gui

Parameters:

Name Type Description
gui GuiInterface The Gui interface
worldPosition Vec3 The position to set.
world (optional) World The world, defaults to same as the script

stopEffect

guiInterface:stopEffect( widgetName, effectName, immediate, useHistory )

Stops an effect playing at a widget

Parameters:

Name Type Description
gui GuiInterface The Gui interface
widgetName string The name of the widget
effectName string The name of the effect
immediate (optional) boolean When true, the effect stops immediately (Defaults to false)
useHistory (optional) boolean If the effect should use call history (Defaults to false)

stopGridEffect

guiInterface:stopGridEffect( gridName, index, effectName )

Stopts an effect playing inside a grid

Parameters:

Name Type Description
gui GuiInterface The Gui interface
gridName string The name of the grid
index integer The index in the grid
effectName string The name of the effect

trackQuest

guiInterface:trackQuest( name, title, mainQuest, questTasks, icon )

Adds a quest to the quest tracker

Parameters:

Name Type Description
gui GuiInterface The QuestGui interface
name string The name of quest
title string The quest title to be displayed in the tracker
mainQuest boolean If the quest is a main quest (Displayed on top in the tracker)
questTasks table The table of quest tasks to display in the log Task{ name = string, text = string, count = number, target = number, complete = boolean }
icon (optional) string The icon to display in the tracker (Optional)

untrackQuest

guiInterface:untrackQuest( questName )

Removes a quest from the quest tracker

/

Parameters:

Name Type Description
gui GuiInterface The QuestGui interface
questName string The name of quest