07-14-14, 09:33 AM | #21 |
Alright!
The unit frames are taking more and more shape every hour Even started to make the basic UI around them, not sure tho if I will ever upload the entire UI Might just only upload the unit frames Got any ideas what more I should add to the unit frames? I feel quite satisfied with them atm ^^ |
|
07-14-14, 01:26 PM | #22 |
- Your power bar text is using a different font than the rest of the fontstrings on the frames.
- I don't think there are two fontstrings with the same font size anywhere on the frames... I'd suggest picking two sizes, and stick to them, with important stuff using the larger size, and everything else using the smaller size. Having everything in a different size makes it look more cluttered than it really is. - You've also got a bunch of different fonts throughout your UI. Again, picking one or two fonts (eg. a more decorative one for short text on unit frames and cast bars, and a more readable one for the chat frame) and sticking to them will make the whole thing look more like a cohesive UI, rather than a collection of random stuff that happen to be on the same screen at the same time. - Give your poor pet a real name already!
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
07-15-14, 05:09 AM | #23 | ||||
http://imgur.com/a/Lqf39 Two screens, one out of combat and one in combat |
|||||
07-25-14, 02:08 AM | #24 |
SUF's tag system is actually heavily based on oUF's
__________________
「貴方は1人じゃないよ」 |
|
08-01-14, 02:38 PM | #25 |
I've been thinking for a while now that I've been using these unitframes, how difficult would it be to add Aurabars to player and target frame? For trinkets, pots and other short (<30sec) buffs on the player and debuffs on the target casted by the player (such as Rake, Rip, Serpent Sting etc)
Would it be possible to achive this without needing to define all the spell id's? Something like this, or is this completely wrong? Lua Code:
Last edited by Kygo : 08-01-14 at 02:42 PM. |
|
08-01-14, 07:56 PM | #26 | |
Main chunk: Code:
local function bar_OnUpdate(self, elapsed) local t = self.timeLeft - elapsed self:SetValue(t > 0 and t or 0) self.timeLeft = t end local function auras_PostCreateIcon(self, icon) local frame = self.__owner local bar = CreateFrame("StatusBar", nil, icon) bar:SetPoint("LEFT", icon, "RIGHT") bar:SetWidth(frame:GetWidth() - BUFF_HEIGHT) bar:SetHeight(BUFF_HEIGHT) bar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar") bar:SetStatusBarColor(0, 0.6, 0) local bg = bar:CreateTexture(nil, "BACKGROUND") bg:SetAllPoints(true) bg:SetTexture("Interface\\TargetingFrame\\UI-StatusBar") bg:SetVertexColor(0, 0.2, 0) bar.bg = bg bar.timeLeft = 0 icon.bar = bar end Code:
if unit == "player" or unit == "target" then local BUFF_HEIGHT = 20 local Auras = CreateFrame("Frame", nil, self) Auras:SetPoint("BOTTOMLEFT", self, "TOPLEFT", 0, 10) Auras:SetWidth(BUFF_HEIGHT) -- no, Width/HEIGHT is not a mistake Auras["initialAnchor"] = "BOTTOMLEFT" Auras["growth-y"] = "UP" Auras["spacing-y"] = 1 -- 1px gap between bars, adjust as desired Auras["num"] = 10 -- limit to showing 5 bars, adjust as desired Auras["size"] = BUFF_HEIGHT Auras.PostCreateIcon = auras_PostCreateIcon if unit == "player" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if duration < 30 then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end self.Buffs = Auras elseif unit == "target" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if canApplyAura then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end self.Debuffs = Auras end end
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
08-02-14, 06:22 AM | #27 | |
Never encountered a error like this so I don't really know what to do to fix it, did open oUF\elements\aura.lua as stated in the error to see if I can make any sense but it didn't. Had to swap out your "self" into frame because I don't have "self" defined anywhere. Full code updated today is found here > http://pastebin.com/pkVwFrn5 By the looks of the code it seems to be way out of my knowledge |
||
08-02-14, 09:53 AM | #28 | |
"Self" doesn't need to be defined because it's a parameter of the function. I'm not great at explaining things so it's probably best just to read this to understand why you use "self". |
||
08-02-14, 10:56 PM | #29 | ||||
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|||||
08-03-14, 05:06 AM | #30 |
No more errors!
But it does not "generate" or what to call it any bars. I'm very confused Been looking through the code over and over but can't seem the find the missing element. How it looks right now: Above the spawn function. Code:
-- Aura Bars local BUFF_HEIGHT = 20 local function bar_OnUpdate(frame, elapsed) local t = frame.timeLeft - elapsed frame:SetValue(t > 0 and t or 0) frame.timeLeft = t end local function auras_PostCreateIcon(frame, icon) local frame = frame.__owner local bar = CreateFrame("StatusBar", nil, icon) bar:SetPoint("LEFT", icon, "RIGHT") bar:SetWidth(frame:GetWidth() - BUFF_HEIGHT) bar:SetHeight(BUFF_HEIGHT) bar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar") bar:SetStatusBarColor(0, 0.6, 0) local bg = bar:CreateTexture(nil, "BACKGROUND") bg:SetAllPoints(true) bg:SetTexture("Interface\\TargetingFrame\\UI-StatusBar") bg:SetVertexColor(0, 0.2, 0) bar.bg = bg bar.timeLeft = 0 icon.bar = bar end -- Below the spawn function. (Below CPoints in my code) And the second block: The "icon.bar" segments I don't really get, there are no functions called "icon" in my code? Does it grab that from oUF it self or how does that work? Did try to add "local icon = CreateIcon("Icon", nil, frame)" without success. I think I did bite off more than I can chew on this one. Code:
--------------------------------- -- Aurabars -- --------------------------------- if unit == "player" or unit == "target" then local Auras = CreateFrame("Frame", nil, frame) Auras:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 10) Auras:SetWidth(BUFF_HEIGHT) -- no, Width/HEIGHT is not a mistake Auras["initialAnchor"] = "BOTTOMLEFT" Auras["growth-y"] = "UP" Auras["spacing-y"] = 1 -- 1px gap between bars, adjust as desired Auras["num"] = 10 -- limit to showing 5 bars, adjust as desired Auras["size"] = BUFF_HEIGHT Auras.PostCreateIcon = auras_PostCreateIcon if unit == "player" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if duration < 30 then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Buffs = Auras elseif unit == "target" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if canApplyAura then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Debuffs = Auras end end |
|
08-03-14, 01:19 PM | #31 | |
new icon created -> PostCreateIcon callback -> create bar -> Filter callback -> do stuff with bar As for why it's not working, do you have BugSack running? If not, go fix that now. If so, does it report any errors? If so, what are they? I'll try to test it myself later, but no guarantees.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
08-03-14, 02:07 PM | #32 | |
And yea, I have BugSack running Got a few errors, but nothing that the aurabars did generate after the local BUFF_HEIGHT issue. Only errors BugSack did pickup was some failures I did attempt with (like the "local icon = CreateIcon thing) and making a new tag. |
||
08-10-14, 12:48 PM | #33 |
Been trying to figure out why the aurabars dosent show up (or generate any errors) for the last couple of days, soon ready to give up on them.
Meanwhile, I have managed to add some other (pretty irrelevant, but still quite usefull) features to the unit frame/s. Such as resting icon, leader icon etc.. Features left to be added: Readycheck icon on player frame and on party1-5 frames. Boss frames with seperate code segment for various variables and settings. (In progress) Working aurabars (if someone is able to give me a hand on this one, Phanx's code I'm using are a few posts up) Might think of more usefull features down the road. Code is available to be seen here |
|
08-11-14, 02:48 AM | #34 |
You're never setting the OnUpdate script on the bars. Not sure if this was missing in my original code or not since I'm too lazy to go look, but this should fix that:
Code:
bar.timeLeft = 0 bar:SetMinMaxValues(0, 1) bar:SetScript("OnUpdate", bar_OnUpdate) icon.bar = bar Code:
local function auras_PostCreateIcon(frame, icon) local frame = frame.__owner Code:
local function auras_PostCreateIcon(element, icon) local frame = element.__owner
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-11-14, 04:40 AM | #35 | |
Not sure if I have overlooked any frame references in the code , did what I knew to it (which is not a whole lot..) Would it be easier for me and others who look through my code if it was using "self" over "frame"? Updated code (today 11/8-14) is found here |
||
08-11-14, 05:19 AM | #36 | |
But if you see "frame" at the top of a function, and then jump down 10 lines inside the same function and see "frame" again, it would be insane to assume it referred to something other than what the first "frame" referred to. And if you're looking at a unit frame addon and you see a variable named "frame" it's kind of automatic to assume it's referring to a unit frame, which is why I suggested "element" as an alternative here.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
||
08-11-14, 06:03 AM | #37 | |
Did change the "frame" in the bar_OnUpdate function to element , no diffrence. I have no clue how to continue with this now With the changes you posted: Part above the Spawn function. Code:
-- Aura Bars local BUFF_HEIGHT = 20 local function bar_OnUpdate(frame, elapsed) local t = frame.timeLeft - elapsed frame:SetValue(t > 0 and t or 0) frame.timeLeft = t end local function auras_PostCreateIcon(element, icon) local frame = element.__owner local bar = CreateFrame("StatusBar", nil, icon) bar:SetPoint("LEFT", icon, "RIGHT") bar:SetWidth(frame:GetWidth() - BUFF_HEIGHT) bar:SetHeight(BUFF_HEIGHT) bar:SetStatusBarTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal") bar:SetStatusBarColor(0, 0.6, 0) local bg = bar:CreateTexture(nil, "BACKGROUND") bg:SetAllPoints(true) bg:SetTexture("Interface\\AddOns\\oUF_Kygo\\Media\\Neal") bg:SetVertexColor(0, 0.2, 0) bar.bg = bg bar.timeLeft = 0 bar:SetMinMaxValues(0, 1) bar:SetScript("OnUpdate", bar_OnUpdate) icon.bar = bar end Did try to change "frame.Buffs = Auras" to "element.buffs = Auras" and same with the "Debuffs = Auras" only to see if it threw the "nil" error I expected. Code:
--------------------------------- -- Aurabars -- --------------------------------- if unit == "player" or unit == "target" then local Auras = CreateFrame("Frame", nil, element) Auras:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 10) Auras:SetWidth(BUFF_HEIGHT) -- no, Width/HEIGHT is not a mistake Auras["initialAnchor"] = "BOTTOMLEFT" Auras["growth-y"] = "UP" Auras["spacing-y"] = 1 -- 1px gap between bars, adjust as desired Auras["num"] = 10 -- limit to showing 5 bars, adjust as desired Auras["size"] = BUFF_HEIGHT Auras.PostCreateIcon = auras_PostCreateIcon if unit == "player" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if duration < 30 then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Buffs = Auras elseif unit == "target" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if canApplyAura then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Debuffs = Auras end end |
||
08-11-14, 01:52 PM | #38 |
Your variable renaming the Spawn callback will not work; there is no variable "element" defined in that scope. The third value passed to CreateFrame needs to be a reference to (or the global name of) the desired parent frame. You're effectively passing nil, causing the created frame to have no parent. You want that frame to parented to the unit frame, so the previous "frame" was appropriate there, since in that scope, the variable "frame" points to the unit frame.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
08-12-14, 08:45 AM | #39 |
The code is know back to it's original state (except the "self" stuff). On this I did definitely bite off more than I can chew.
For some of you (or most of you) this is a piece of cake to handle, but for me this is really hard. Call me a rookie and I would agree to 100%. I am a extreme rookie when it comes to this type of stuff. First part of the code (Above the Style function) Code:
-- Aura Bars local BUFF_HEIGHT = 20 local function bar_OnUpdate(frame, elapsed) local t = frame.timeLeft - elapsed frame:SetValue(t > 0 and t or 0) frame.timeLeft = t end local function auras_PostCreateIcon(element, icon) local frame = element.__owner local bar = CreateFrame("StatusBar", nil, frame) --anchor the StatusBar to frame bar:SetPoint("LEFT", icon, "RIGHT") bar:SetWidth(frame:GetWidth() - BUFF_HEIGHT) --It fetches the width of the created frame bar:SetHeight(BUFF_HEIGHT) bar:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar") bar:SetStatusBarColor(0, 0.6, 0) local bg = bar:CreateTexture(nil, "BACKGROUND") bg:SetAllPoints(true) bg:SetTexture("Interface\\TargetingFrame\\UI-StatusBar") bg:SetVertexColor(0, 0.2, 0) bar.bg = bg bar.timeLeft = 0 bar:SetMinMaxValues(0, 1) bar:SetScript("OnUpdate", bar_OnUpdate) icon.bar = bar end Second part (near the end of the code, just above the out-commented "Misc PvE Stuff") Code:
--------------------------------- -- Aurabars -- --------------------------------- if unit == "player" or unit == "target" then local Auras = CreateFrame("Frame",nil ,frame) --anchor the Frame to frame Auras:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 10) --Where the anchors should be Auras:SetWidth(BUFF_HEIGHT) -- no, Width/HEIGHT is not a mistake Auras["initialAnchor"] = "BOTTOMLEFT" Auras["growth-y"] = "UP" Auras["spacing-y"] = 1 -- 1px gap between bars, adjust as desired Auras["num"] = 10 -- limit to showing 5 bars, adjust as desired Auras["size"] = BUFF_HEIGHT Auras.PostCreateIcon = auras_PostCreateIcon if unit == "player" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if duration < 30 then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Buffs = Auras elseif unit == "target" then function Auras:CustomFilter(unit, icon, name, rank, texture, count, debuffType, duration, timeLeft, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff) if canApplyAura then icon.bar.timeLeft = timeLeft icon.bar:SetMinMaxValues(0, duration) icon.bar:SetValue(timeLeft) return true end end frame.Debuffs = Auras end end |
|
08-16-14, 06:02 AM | #40 |
Ok, I have put that project to add aurabars directly into the code on the side. What I've done instead (for now) is added support for oUF_AuraBars which I've setup to my liking on the unit frames (player + target).
(Support for oUF_Smooth and oUF_SpellRange is also added.) The code I wrote in Frames.lua: Code:
-------------------- -- oUF_AuraBars -- -------------------- if IsAddOnLoaded("oUF_AuraBars") then if unit == "player" or unit == "target" then frame.AuraBars = CreateFrame("Frame", nil, frame) frame.AuraBars:SetHeight(1) frame.AuraBars:SetWidth(143) frame.AuraBars:SetPoint("TOP", 0, -4) frame.AuraBars:SetPoint("RIGHT", -4, 0) frame.AuraBars.auraBarHeight = 10 frame.AuraBars.spellNameSize = 5 frame.AuraBars.spellTimeSize = 5 frame.AuraBars.sort = 1 frame.AuraBars.auraBarTexture = "Interface\\AddOns\\oUF_Kygo\\Media\\Neal" frame.AuraBars.filter = function(name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, canApplyAura, isBossDebuff) if(unitCaster == "player") and duration > 1 and duration < 300 then return true end end end end My code for the LFDRole icons: Code:
local LFDRole = health:CreateTexture(nil, "OVERLAY") LFDRole:SetSize(32, 32) --Larger size temp. for easier viewing. LFDRole:SetPoint("LEFT", health) LFDRole:SetTexture[[Interface\LFGFrame\UI-LFG-ICON-PORTRAITROLES]] health.LFDRole = LFDRole And yes, the frame is off by a few pixles in height compared to the portrait. On a scale 1-10, how difficult would it be to add element files to the code? I.e for Runes, Soul Shards, Holy power and eclipsebar. Or would it just be easier to add code directly to the main file doing the same things? Last edited by Kygo : 08-16-14 at 06:07 AM. |
|
WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF_Kygo, a few tips wanted |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|