Combo Points (and related class powers)
For days, I've been working on creating class class power (specifically combo points) bars. I'm working off some code from another layout. I've tried modifying it numerous ways, but I just can't get any result. I'm not getting any errors, it's just displaying nothing. Can anyone help me find a good sample, or solution to my problem?
Current code: --The function lib.genCPoints being called by my TargetStyle function, obviously. Code:
do |
Erm, I have no idea why you're defining that ComboDisplay function and using it as an element Override, when it's functionally identical to oUF's standard combo point update function, but contains a lot of unnecessary redundancy. You set the alpha to 15% and then hide the frame, instead of just hiding it, for example. Try getting rid of the Override and see if it works then.
I also don't understand what you're trying to do with the bars.FrameBackdrop section at the end of the block you posted. It's just an extra frame, attached to the bars frame, with no visible anything, since you call SetBackdrop on bars instead of bars.FrameBackdrop, and anyway you're setting the same backdrop that you already set on bars, so even if you did set it on the bars.FrameBackdrop frame, you'd only see 1 pixel of it around the edges since the frames are stacked on top of each other. I'd suggest just getting rid of the whole thing. If you want a 1px border on the bars frame, just change its backdrop to include a 1px border, eg: Lua Code:
Finally, your genCPoints function parents bars to self, but anchors it to oUF_Player. If multiple frames call genCpoints, you'll end up with multiple objects piled on top of each other. I'd also suggest combo points be attached to the target frame, rather than the player frame. Not only does that give you more room on the player frame for class powers, but combo points also logically belong on the target, at least for druids, who can have different numbers of combo points on different targets at the same time. Try this: Lua Code:
|
It works great! The original was a rough copy of "oUF_Qulight", hence the redundancy and misfit calls and functions.
As always, thank you Phanx, for you are the reason my UI works. I'm sure you'll be all over the credits :) |
After hours of coding, I am more confused than I was to begin with. (Trying to create Warlock Power Bars).
What I wrote for soul shards seems to work: Lua Code:
I tried doing the same thing for burning embers, but with no success. Does this function only work because self.SoulShards is predefined in oUF elements? Does this mean I need to write a new element for Embers/Fury/ShadowOrbs/Monks etc? |
You must be working with an old version of oUF... get the current one from Haste's GitHub repo:
https://github.com/haste/oUF There aren't separate elements for Soul Shards, Holy Power, etc. anymore. Instead, all of the class powers that are displayed like combo points are combined into the ClassIcons element. It covers Harmony Orbs (chi), Holy Power, Shadow Orbs, and Soul Shards. If you look at the top of the classicons.lua element file, you'll see an example. You shouldn't need to change much; mainly changing the name of the element from SoulShards to ClassIcons, getting rid of your separate HolyPower element if you have one, and if your layout uses custom textures, add a class check when you're setting up the ClassIcons element to set the appropriate textures. Here's the ClassIcons example from the oUF/elements/classicons.lua file: Code:
local ClassIcons = {} The other warlock powers -- Burning Embers and Demonic Fury -- are not yet supported by oUF itself, but Haste is working on a ClassBars element that will cover those plus all other class powers that have fill values or durations. If you want to support them in the meantime, you'll have to either write your own element, or use Tukz' oUF Warlock Spec Bars plugin. If you're writing your own, feel free to look at the WarlockPower.lua file in oUF Phanx for an example. |
Yep. Mine was outdated; I'll get the new one. Great info as always!
p.s. I'm very close to finished with my oUF Layout. I'll be sure to post the finished product, then I can start contributing to the other lua newbs! Edit: Dun broke the entire addon... where to start... Edit 2: Seems like everything's working except "oUF.TagEvents", know what's up with that? Seems like the change from Code:
oUF.Tags = tags Code:
oUF.Tags = { Edit 3: Nevermind, figured it out! oUF.Tags.Methods and oUF.Tags.Events. Hope this helps anyone else reading! |
Okay -- I finally had a chance to look this over and this was my result for holy power (not working):
lua Code:
I feel like it's still over complicated, but I'm not sure where to put the frame options in the example given. I must be functionally retarded. How do!? |
I'm not sure what "frame options" you mean, but there are a couple issues with your code.
For one, oUF expects 5 objects, not 3, so you should be getting errors from that. Paladins start out with a max of 3 holy power, but gain an additional 2 (for a total of 5) from the Boundless Conviction passive ability at level 85. oUF will automatically hide the ones that aren't currently in use. Also, oUF will try to call :SetVertexColor on your objects; since StatusBar objects don't have this method, this should trigger another error unless you remap it to SetStatusBarColor (if you want oUF to color your objects) or a dummy function (if you don't). Make sure you have BugSack or Swatter or something running when you're working on addons; it will make your life a lot easier. Try this. It will make sure the last holy power is always the one with the different color, and stop oUF from setting its own holy power color. Code:
local noop = function() return end Code:
Icon.SetVertexColor = noop Code:
Icon.SetVertexColor = Icon.SetStatusBarColor |
So I got BugSack, which is fairly more informative than the regular lua error reports. Anyway, I seem to have a circle of errors with this function:
Code:
lib.genHoly = function(self) |
Quote:
Quote:
|
Quote:
|
Odd, I've always had that problem with custom error handlers :P.
|
BugSack is able to capture loading errors, because it uses a separate module (!BugGrabber) that is loaded ahead of other addons (! precedes A-Z).
|
Addons are not always loaded alphabetically as far as I know. I depends on the operating system and on what dependencies the individual .toc files contain. WoW just loads addons starting with ! prior to others.
|
Addons are loaded alphabetically on NTFS filesystems, which, as the filesystem used by Windows, covers the vast majority of users.
I don't know what the Mac filesystem does, or Linux filesystems... |
World of Warcraft Programming (Second Edition), p. 141, 6a:
Quote:
|
Okay... let me be more precise.
I'm getting the error, "CreateFrame: Couldn't find "this" in parent object" on this line. However, if I change it, I get the error, "attempt to index field "?" (a nil value)" here. Code:
lib.genHoly = function(self) |
The parent frame must actually be a frame. You are currently passing ClassIcons, which is a table, not a frame. Similarly, you cannot use SetPoint to position things relative to a table, because a table does not have any position or of the other "physical" attributes a frame has.
The easiest solution would be to make ClassIcons a frame, like the combo point holder is: Code:
local noop = function() return end |
Thanks so much Phanx, it's working again! I made a couple modifications. Also got rid of the post update entirely.
Code:
lib.genHoly = function(self) |
thank you Phanx, you solved my problem too.
|
All times are GMT -6. The time now is 09:27 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI