Posted 23 February 2014 - 02:11 PM
Ive updated to the most recent Openperipherals version the methods changed, i tried to edit but im still getting an error and my bars are stacking gradientboxes since setZindex no longer is there.
im Using openp core 0.3.1, openlib 0.2, openblocks 1.2.5. this program worked perfect for openp build# 112
The bars are stacking overtop each other instead of adding a new bar lower down
screenshot of issue
http://tinypic.com/r/2w6i8t1/8
offset2 = 18
for i=1, #array1 do
for key,value in pairs(array1) do
value["label"] = bridge.addText(5,5+offset2 + posStart,array1[1]["name"],0x33FF33)
value["label"].setScale(0.5)
value["proc"] = bridge.addText(45,5+offset2 + posStart,"FILL: 0.0%",0xC5360F)
value["proc"].setScale(0.5)
if addtext then
value["textadd"] = bridge.addText(10,offset2 + posStart," ",0x33FF33)
value["textadd"].setScale(0.5)
end
value["heatTitle"] = bridge.addText(5,10+offset2 + posStart,"0",0x66FFFF)
value["heatTitle"].setScale(0.8)
value["progressbar"] = bridge.addGradientBox(10,10+offset2 + posStart,100,7,0x66ccff,7,0x000033,0.7,1)
value["progressbar"].setZ(10)
–value["progressbar"].setGradient(1)
–value["progressbar"].setColor2(0x66ccff)
value["progressbarmarker"] = bridge.addGradientBox(10,11+offset2 + posStart,1,7,0xFFFFFF,1,colBar,0.7,1)
value["progressbarmarker"].setZ(11)
–value["progressbarmarker"].setGradient(1)–these need rewritten for new openp
–value["progressbarmarker"].setColor2(0xFFFFFF)
value["capTitle"] = bridge.addText(26,11+offset2 + posStart," 0/0",0x33FF33)
value["capTitle"].setScale(0.5)
offset2 = offset2 + 18
end
end
boxName = bridge.addBox(2, 2+posStart, 111, offset2, 0x262626, 0.2)
boxName2 = bridge.addText(5,5+posStart,BoxName,0x66CCFF)
boxName2.setScale(0.7)
end
function ClearBridge(array1)
for i=1, #array1 do
for key,value in pairs(array1) do
value["label"].delete()
value["proc"].delete()
value["heatTitle"].delete()
value["progressbar"].delete()
value["progressbarmarker"].delete()
value["capTitle"].delete()
end
end
boxName.delete()
boxName2.delete()
end
function upBridgeDis(arrayNames,arrayNumber,capa1,stor1,currBOX,colBr,addtext1,newtext)
for i=#arrayNames,1,-1 do
for j=#arrayNames,1,-1 do
storage1 = arrayNames[j]
if storage1["id"] == arrayNumber then
curStored = widthBR / capa1 * stor1
– storage1["progressbarmarker"].setColor(colBr) <————- This is throwing an error on return works if texted out but bars are stacking
storage1["progressbarmarker"].setWidth(curStored)
if addtext1 then
storage1["textadd"].setText(newtext)
end
curStoredE = round1(curStored)
if curStoredE <= 29 then
storage1["proc"].setColor(0xFF0000)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 30 and curStoredE <= 79 then
storage1["proc"].setColor(0xFFFF00)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 80 and curStoredE <= 99 then
storage1["proc"].setColor(0x009900)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 100 then
storage1["proc"].setColor(0x66CCFF)
storage1["proc"].setText("FULL")
end
disSmalCAP= enu.dot(stor1).."/"..enu.dot(capa1)
storage1["capTitle"].setX(writeCenter(disSmalCAP,100)+11)
storage1["capTitle"].setText(disSmalCAP)
storage1["heatTitle"].setText(tostring(currBOX))
end
end
end
end
im Using openp core 0.3.1, openlib 0.2, openblocks 1.2.5. this program worked perfect for openp build# 112
The bars are stacking overtop each other instead of adding a new bar lower down
screenshot of issue
http://tinypic.com/r/2w6i8t1/8
Spoiler
function disBridgeInfo(array1,posStart,BoxName,colBar,addtext)offset2 = 18
for i=1, #array1 do
for key,value in pairs(array1) do
value["label"] = bridge.addText(5,5+offset2 + posStart,array1[1]["name"],0x33FF33)
value["label"].setScale(0.5)
value["proc"] = bridge.addText(45,5+offset2 + posStart,"FILL: 0.0%",0xC5360F)
value["proc"].setScale(0.5)
if addtext then
value["textadd"] = bridge.addText(10,offset2 + posStart," ",0x33FF33)
value["textadd"].setScale(0.5)
end
value["heatTitle"] = bridge.addText(5,10+offset2 + posStart,"0",0x66FFFF)
value["heatTitle"].setScale(0.8)
value["progressbar"] = bridge.addGradientBox(10,10+offset2 + posStart,100,7,0x66ccff,7,0x000033,0.7,1)
value["progressbar"].setZ(10)
–value["progressbar"].setGradient(1)
–value["progressbar"].setColor2(0x66ccff)
value["progressbarmarker"] = bridge.addGradientBox(10,11+offset2 + posStart,1,7,0xFFFFFF,1,colBar,0.7,1)
value["progressbarmarker"].setZ(11)
–value["progressbarmarker"].setGradient(1)–these need rewritten for new openp
–value["progressbarmarker"].setColor2(0xFFFFFF)
value["capTitle"] = bridge.addText(26,11+offset2 + posStart," 0/0",0x33FF33)
value["capTitle"].setScale(0.5)
offset2 = offset2 + 18
end
end
boxName = bridge.addBox(2, 2+posStart, 111, offset2, 0x262626, 0.2)
boxName2 = bridge.addText(5,5+posStart,BoxName,0x66CCFF)
boxName2.setScale(0.7)
end
function ClearBridge(array1)
for i=1, #array1 do
for key,value in pairs(array1) do
value["label"].delete()
value["proc"].delete()
value["heatTitle"].delete()
value["progressbar"].delete()
value["progressbarmarker"].delete()
value["capTitle"].delete()
end
end
boxName.delete()
boxName2.delete()
end
function upBridgeDis(arrayNames,arrayNumber,capa1,stor1,currBOX,colBr,addtext1,newtext)
for i=#arrayNames,1,-1 do
for j=#arrayNames,1,-1 do
storage1 = arrayNames[j]
if storage1["id"] == arrayNumber then
curStored = widthBR / capa1 * stor1
– storage1["progressbarmarker"].setColor(colBr) <————- This is throwing an error on return works if texted out but bars are stacking
storage1["progressbarmarker"].setWidth(curStored)
if addtext1 then
storage1["textadd"].setText(newtext)
end
curStoredE = round1(curStored)
if curStoredE <= 29 then
storage1["proc"].setColor(0xFF0000)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 30 and curStoredE <= 79 then
storage1["proc"].setColor(0xFFFF00)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 80 and curStoredE <= 99 then
storage1["proc"].setColor(0x009900)
storage1["proc"].setText("FILL: "..curStoredE.."%")
elseif curStoredE >= 100 then
storage1["proc"].setColor(0x66CCFF)
storage1["proc"].setText("FULL")
end
disSmalCAP= enu.dot(stor1).."/"..enu.dot(capa1)
storage1["capTitle"].setX(writeCenter(disSmalCAP,100)+11)
storage1["capTitle"].setText(disSmalCAP)
storage1["heatTitle"].setText(tostring(currBOX))
end
end
end
end
Edited on 23 February 2014 - 03:10 PM