Skip to content

Instantly share code, notes, and snippets.

@arieh
Last active May 10, 2018 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arieh/dc88e48db14b8c5215ec52fd11703521 to your computer and use it in GitHub Desktop.
Save arieh/dc88e48db14b8c5215ec52fd11703521 to your computer and use it in GitHub Desktop.
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