Last active
May 10, 2018 10:57
-
-
Save arieh/dc88e48db14b8c5215ec52fd11703521 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
TMW:RegisterCallback("TMW_ST_VARIABLE_MODIFIED", DogTag.FireEvent, DogTag) | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment