The problem is that the stuff I have in function Update() seems to refresh the skin even though the [Variable] #ImageToGet# has not been changed. Help Please.
[/code]Substitute.lua
Code: Select all
PROPERTIES =
{
}
function Initialize()
msImageLink = SKIN:GetMeasure('MeasureImageLink')
sImageVar = SKIN:GetVariable('ImageToGet')
sSubstitute = SKIN:GetVariable('SubstituteImage')
sCheckString = SKIN:GetVariable('CheckString')
end
function Update()
sImageLink = msImageLink:GetStringValue()
if (sImageLink ~= sImageVar) and (sImageLink ~= sSubstitute)then
if sImageLink == sCheckString then
SKIN:Bang('!WriteKeyValue "Variables" "ImageToGet" "'..sSubstitute..'"')
else
SKIN:Bang('!WriteKeyValue "Variables" "ImageToGet" "'..sImageLink..'"')
end
SKIN:Bang("!Refresh")
end
SKIN:Bang("!DisableMeasure MeasureLuaScript")
SKIN:Bang("!EnableMeasure MeasureImageDownload")
return "Image File Set"
end -- Update