TellMeWhen

TellMeWhen

24M Downloads

[CF 1512] Issues with setting DogTags

tmw-issue-import opened this issue ยท 3 comments

commented

Hey

 

Starting with pre-patch, my costume dog-tags stopped updating. I'm using the following code:

TMW_ST.ScriptTexts = {}

function TMW_ST:SetScriptText(name, text)
    TMW_ST.ScriptTexts[name] = text
    TMW:Fire("TMW_ST_VARIABLE_MODIFIED", name)
end

local DogTag = LibStub("LibDogTag-3.0", true)
if DogTag then
    DogTag:AddTag("TMW", "ST_GetScriptText", {
        code = function(name)
            return TMW_ST.ScriptTexts[name] or ""
        end,
        arg = {
            'name', 'string', '@req',
        },
        ret = "string",
        doc = "Return the value of a script variable",
        example = '[ST_GetScriptText("var1")] => "my var"',
        events = "TMW_ST_VARIABLE_MODIFIED",
        category = "Userland"
    })
end

 It used to be that firing "TMW_ST_VARIABLE_MODIFIED" would update the DogTag, however since 8.0 landed the DogTag code function won't get called again after initial icon setup. Any idea what might be causing this?

 


Posted by CurseForge user ariehg | Imported from CurseForge issue #1512 | Raw

commented

Interesting - this code totally worked prior to 8.0. Was just assuming there was a bridge between the 2. 


Posted by CurseForge user ariehg

commented

There are a few that are passed along - TMW_COUNTER_MODIFIED, TMW_GLOBAL_UPDATE_POST, and most TMW_ICON_DATA_CHANGED_* events. Any others have to be done yourself: 

 

TMW:RegisterCallback("TMW_EVENT_NAME", DogTag.FireEvent, DogTag)


Posted by CurseForge user Cybeloras

commented

DogTag doesn't know about TMW's event system. You need to fire a DogTag event, not a TMW event.


Posted by CurseForge user Cybeloras