Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CreateHyperLink

From RoR Wiki
Revision as of 19:41, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Interface functions
Version: WAR 1.4.8

Builds the markup for a clickable link that can be put into chat or label text.

link = CreateHyperLink(data, text, color, color2)

Arguments

data
wstring – The link's data string, for example L"PLAYER:"..name. The stock UI starts it with a tag that tells what kind of link it is.
text
wstring – The text shown for the link.
color
number-table – Colour of the link as {r, g, b} on a 0–255 scale, or {} for no colour.
color2
number-table – A second colour in the same form, or {}. The stock UI always passes {}.

Returns

link
wstring – The markup, for example <LINK data="PLAYER:Name" text="Name" color="255,255,255">.

Details

  • The result has the form <LINK data="data" text="text">. Each colour table adds a color="r,g,b" attribute before the closing >; with both tables filled the markup has two color attributes.
  • A colour table is used only if it has at least three entries; only the first three are read. Each value is clamped to 0–255 and written as a whole number.
  • data and text are copied as they are. Quotes or > characters in them are not escaped.
  • data and text must be wide strings. Passing a plain Lua string raises an Invalid Parameters error.
  • The function needs at least four arguments and only reads the last four.

Errors

None besides the Invalid Parameters argument check.

Example

Inserting an item link into the chat input, from ea_chatwindow/source/chathyperlinking.lua:

local data  = ITEM_TAG..itemData.uniqueID
local text  = L"["..itemData.name..L"]"
local color = DataUtils.GetItemRarityColor(itemData)

local link  = CreateHyperLink( data, text, {color.r,color.g,color.b}, {} )

EA_ChatWindow.InsertText( link )

A player link without a colour, from ea_guildwindow/source/guildwindowtabrecruitsearch.lua:

local text = CreateHyperLink( L"PLAYER:"..name, name, {}, {} )

See also