Beginner LF help
2 Attachment(s)
Hey im at the very begining when it comes to lua and addons overall. However I did quite enjoy my recent attempts to create my own addons in Classic, but some questions popped in my head and I cant find answers on my own. I would be very happy if someone could help answer any (or all :) ) of these
My first addon attempt was to show HP&mana text on target and party frames. Its working fine more or less besides this part of code (which I had to replace for manualy written partyframes 1-4). Code:
_G["HealthFrame_party"..i] = CreateFrame("Frame", "HBar_party"..i, UIParent) Code:
local HP_fontstring = _G["Health_TEXT_" .. unitToken]; Next question is regarding to the _G["string"]. After I used it about 100x times, I gained understanding that it changes string to global variable. Is that correct? In general, should I avoid using too many global variables when making an addon? Would adding local before declaring them help? Next question is about CreateFontString() and SetFont(). Is there a function that would combine these two lines together? i wanted to use font FRIZQT__.TTF", 10, "OUTLINE" So I checked all the game fonts that looks the same and from which my CreateFontString() could inherit from, but I couldnt find one. It either was wrong size, outline or different colour than I wanted. My second (current) addon attemp is to permanently show buffs on party member frames. While I got the main part somewhat working (time will show). I havent figured out any other way to do this than making 4*16 frames for each buff slot on each party member, which is probably wasteful approach to do it? Code:
for m = 1, 4 do Im very thankful for any advice! |
All times are GMT -6. The time now is 07:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI