-- 
-- Please see the readme.txt file included with this distribution for 
-- attribution and copyright information.
--

function onInit()
	registerMenuItem("Remove Effect", "deletepointer", 3);
end

function onMenuSelection(selection)
	if selection == 3 then
		windowlist.deleteChild(self, true);
	end
end

function onDrag(button, x, y, draginfo)
	if label.getValue() ~= "" then
		draginfo.setType("effect");
		draginfo.setDescription(label.getValue());
		draginfo.setStringData(label.getValue());
		
		draginfo.setSlot(2);
		draginfo.setStringData(getDatabaseNode().getNodeName());
	end

	return true;
end

function onDrop(x, y, draginfo)
	if draginfo.isType("combattrackerentry") then
		caster.setSource(draginfo.getCustomData());
		return true;
	end
end
