-- Only possible on the client side of lua
local TextSetOnObjects = {}
local TagDescriptions = {
['Some tag1'] = "Some description 1",
['Some tag2'] = "Some description 2",
}
local function SetCustomTagDescription(ui, method, name, description, param3)
if name ~= "" and description ~= "" and Ext.GetPickingState().HoverCharacter then
local pickingState = Ext.GetPickingState()
local object = Ext.GetCharacter(pickingState.HoverCharacter) or Ext.GetItem(pickingState.HoverCharacter)
if object and not TextSetOnObjects[pickingState.HoverCharacter] then
for i, tag in ipairs(object:GetTags()) do
if TagDescriptions[tag] then
description = description..", "..tag
end
end
TextSetOnObjects[pickingState.HoverCharacter] = true
ui:Invoke("setText", name, description, param3)
TextSetOnObjects[pickingState.HoverCharacter] = nil
end
end
end
---This feature is part of extender version 55; current version is 54.
---It currently works with the development version of the extender. Add the file DefEd\bin\OsiUpdateChannel.txt and fill it with the word "Devel", then change the if statement below to 54 and restart the Engine and DOS2:DE clients.
if Ext.Version() >= 55 then
Ext.RegisterUITypeInvokeListener(42, "setText", SetCustomTagDescription, "After")
end