oUF_Phanx different text sizes for health values?
Hey guys. I'm trying to do a few things with the health text in this layout, but I'm not having any luck. I want the player, target, and focus frames to have a larger font size than the rest of the layout, but when I add a simple if statement to make the change, the addon doesn't load anymore. I've attached the original code, and the code with my modifications. What am I doing wrong? Is this even possible?
Thanks! Original Code:
local health = ns.CreateStatusBar(self, 16, "RIGHT", true) Code:
if unit == "player" or unit == "focus" or unit == "target" then |
1. Whenever you are writing/modifying code, make sure you have Lua errors turned on. "Not loading" or "not working" means an error is occurring. If you can't see the error, you're basically working in the dark.
2. Your problem is that you are defining "local health" inside the scope of the "if/else/end" check, so once the "if/else/end" block is done, the "health" variable no longer exists, so the following lines that try to do something with the "health" variable don't have anything to work with, and trigger errors about attempting to index nil values. Change: Code:
if unit == "player" or unit == "focus" or unit == "target" then Code:
local health Code:
local health = ns.CreateStatusBar(self, (unit == "player" or unit == "focus" or unit == "target") and 16 or 8, "RIGHT", true) |
Quote:
|
All times are GMT -6. The time now is 10:02 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI