Here's the code for the label generation:
Code: Select all
local w, h = getMainWindowSize()
if (createLabel("CraftingON", 0, 0, 0, 0, 1)) then
echo("LABEL CREATED \n")
else
echo("LABEL CREATION FAILED \n")
end
resizeWindow("CraftingON", 200, 35) -- w, h
moveWindow("CraftingON", w-200, 0) -- x, y
setBackgroundColor("CraftingON", 0, 255, 0, 150) -- r, g, b, trans
setLabelClickCallback("CraftingON", "turnCraftingOff")
echo("CraftingON", [[<p><b><center><font size="14" color ="red">Crafting On</font></center></b></p>]])
showWindow("CraftingON")
Here is the code for the callback, not that it's important:
Code: Select all
function turnCraftingOff()
disableTrigger("Crafting")
disableAlias("Crafting")
hideWindow("CraftingON")
isCrafting = false
end --turnCraftingOff(void)