Code: Select all
--Creates our 'stats' bar, located at the top of the screen
function statbarStartup()
--Health
createLabel( "healthBack", 300, 0, 132, 20, 1)
setBackgroundColor("healthBack", 225,0,0,100)
createLabel("healthFront", 310, 0, 132,20,0)
setBackgroundColor("healthFront", 0,0,0, 0)
setFgColor("healthFront", 200,200,200)
--Mana
createLabel( "manaBack", 432, 0, 132, 20, 1)
setBackgroundColor("manaBack", 0,0,225,100)
createLabel("manaFront", 442, 0, 132,20,0)
setBackgroundColor("manaFront", 0,0,0, 0)
setFgColor("manaFront", 200,200,200)
--Experience
createLabel( "expBack", 564, 0, 132, 20, 1)
setBackgroundColor("expBack", 0,225,0,100)
createLabel("expFront", 574, 0, 132,20,0)
setBackgroundColor("expFront", 0,0,0, 0)
setFgColor("expFront", 200,200,200)
--Balance
createLabel( "essFront", 706, 0, 132, 20, 1)
setFgColor("essFront", 200,200,200)
--Target
createLabel("targetFront", 838, 0, 118, 20, 1)
setFgColor("targetFront", 200,200,200)
if table.keyFind(globals, "target") then
echoUserWindow("targetFront", "Target: " .. globals["target"])
end
end
function updateStatsBar()
clearUserWindow("healthFront")
echoUserWindow("healthFront", "Health: " .. globals["health"] .. "%")
if globals["health"] >= 100 then tempInt = 1 else tempInt = globals["health"]/100 end
resizeWindow("healthBack", tempInt * 132, 20)
clearUserWindow("manaFront")
echoUserWindow("manaFront", "Mana: " .. globals["mana"] .. "%")
if globals["mana"] >= 100 then tempInt = 1 else tempInt = globals["mana"]/100 end
resizeWindow("manaBack", tempInt * 132, 20)
--resizeWindow("manaFront", 132, 20)
clearUserWindow("expFront")
echoUserWindow("expFront", "XP: " .. globals["experience"] .. "%")
if globals["experience"] >= 100 then tempInt = 1 else tempInt = globals["experience"]/100 end
resizeWindow("expBack", tempInt * 132, 20)
clearUserWindow("essFront")
echoUserWindow("essFront", "Ess: " .. globals["essence"] .. "%")
clearUserWindow("targetFront")
if table.keyFind(globals, "target") then
clearUserWindow("targetFront")
echoUserWindow("targetFront", "Target: " .. globals["target"])
else
echoUserWindow("targetFront", "No target!")
end
end
At the moment, only the "health" portion displays correctly -- all the others are missing their text. I can get the text to display by commenting out each of the resizeWindow() lines, however that kind of defeats the purpose
I've checked each of the corresponding variables, and they all exist as numbers so I'm really at a loss. I guess it could be some kind of refresh issue?
Thanks, though.