Command.Slash.Register

From Riftui Wiki

Jump to: navigation, search

This is a Table of slash commands used by both the game's default commands and any commands added by addons.

Command.Slash.Register("addonname") = {Function, Identifier, Text Label}

Parameters:

Example, from ZorbasBuffBars:

-- Here's our configuration function. Call it as "/zorbasbuffbars 200 100" to shift the UI element around.
local function config(commandline)
  local x, y = commandline:match("(%d+) (%d+)")
  x, y = tonumber(x), tonumber(y)
  if not x or not y then
    print("Example: /zorbasbuffbars 200 100")
  end
 
  ZorbasBuffBars_Placement.x = x
  ZorbasBuffBars_Placement.y = y
 
  -- If we were being clever, and only updating when buffs changed, we'd have to update our position here.
  -- Luckily, we're not being clever.
end
table.insert(Command.Slash.Register("zorbasbuffbars"), {config, "ZorbasBuffBars", "config"})

You will note that in this example, the SavedVariable ZorbasBuffBars_Placement is used to retain the user's preferred x and y co-ordinates for the bar positions. See RiftAddon.toc on SavedVariable use.

Personal tools
Namespaces
Variants
Actions
Menu
Wiki
Toolbox