Image
-- **************************************************
-- Provide Moho with the name of this script object
-- **************************************************

ScriptName = "SZ_RefreshLayerscript"

-- **************************************************
-- General information about this script
-- **************************************************

SZ_RefreshLayerscript = {}

function SZ_RefreshLayerscript:Name()
	return self:Localize("Name")
end

function SZ_RefreshLayerscript:Version()
	return "1.0"
end

function SZ_RefreshLayerscript:Description()
	return self:Localize("Description")
end

function SZ_RefreshLayerscript:Creator()
	return "Stan from 2danimator.ru"
end

function SZ_RefreshLayerscript:UILabel()
	return self:Localize("Name")
end

-- **************************************************
-- The guts of this script
-- **************************************************

function SZ_RefreshLayerscript:IsEnabled(moho)
	if moho.layer:LayerScript() ~= "" then
		return true
	end
	return false
end

function SZ_RefreshLayerscript:IsRelevant(moho)
	if moho.layer:LayerScript() ~= "" then
		return true
	end
	return false
end

function SZ_RefreshLayerscript:Run(moho)
	moho.layer:SetLayerScript(moho.layer:LayerScript())
end

function SZ_RefreshLayerscript:Localize(text)
	local fileWord = MOHO.Localize("/Menus/File/File=File")
	
	local phrase = {}
	
	phrase["Name"] = "Refresh Layerscript"
	phrase["Description"] = "Refreshes layer's embedded script"	
	
	if fileWord == "Файл" then
		phrase["Name"] = "Перезагрузить скрипт слоя"
		phrase["Description"] = "Перезагружает подключенный скрипт слоя"
	end
	
	return phrase[text];
end

Icon
Refresh LayerScript
Listed

Author: Stan View Script
Script type: Button/Menu

Uploaded: Dec 26 2020, 23:17

A button to quickly and easily refresh embedded layer script.
Very useful for those who work on layer scripts and need to refresh them over and over again.

Installation Options:

This script, and all other scripts on this site are distributed as free software under the GNU General Public License 3.0 or later.
Downloads count: 622