HOWTO: Change PerfectRaid's Visual Layout
Since I've gotten this question a bunch of times, but have not had the opportunity to get everything I'd like done with PerfectRaid, I wanted to post a quick tutorial on how the visual style of PerfectRaid is coded, and give you all an idea of how you can alter it to customize the visual style.
The layout is all done in module functions called UpdateButtonLayout, with the initial layout being done in PerfectRaid.lua. This function is called with the unit frame, which contains a number of member frames: * button - the unit frame * button.leftbox - A bounding box on the left-hand side of the frame. This is by default 70 pixels wide * button.rightbox - A bounding box on the right-hand side of the frame. This is by default 70 pixels wide * button.healthbar - The health bar, anchored in between the two bounding boxes.. so this will be the frame size - 140. * button.manabar - The mana bar, anchored to the bottom of the health bar * button.status - The "DEAD, GHOST and HPMISSING" text.. this is always anchored to the right of the health bar. * button.name - The unit's name. This is anchored to one of the bounding boxes, depending on the "ALIGN RIGHT" option. * button.aura - Defined in PerfectRaid_Buffs.lua, this is the "buffs" text that appears by default next to the right-hand side of the health bar. That's all the stuff in PerfectRaid.lua, everythign else is provided by a module. Here's how you would change some common things: How do I make the overall frame larger This unfortunately is done by the secure templates, and needs to be changed outside the LayoutButton function. On PerfectRaid.lua:625 and PerfectRaid.lua:626 you will see lines: Code:
button:SetAttribute("initial-width", 225) How do I put the name inside the health bar? This one is pretty easy, actually but will take some tweaking to get it to look just right. First off, remember that the frame looks like this by default: [leftbox][healthbar][rightbox] and in default mode, the rightbox contains the buff text, and the leftbox contains the name. What you can do to experiment is, change the leftbox to 1 pixel width, and then anchor the name. Do this: PerfectRaid.lua:697 - Change to button.leftbox:SetPoint("BOTTOMRIGHT", button, "BOTTOMLEFT", 1, 0) PerfectRaid.lua:729/730 - Change these two lines to: Code:
button.name:SetPoint("LEFT", button.healthbar, "LEFT", 0, 0) How do I alter the code to allow dragging the frame off-screen In PerfectRaid.lua, lines 340 and 670, the ClampedToScreen setting is set on both the button, and the header (if you don't understand these, it doesn't matter all that much). Simply comment those lines out by adding a -- at the start of them, and you should be able to drag PerfectRaid without having it dock to the screen. I will likely add an option for this relatively soon, when I have a spare moment. Buff text The buff text is layed out in PerfectRaid_Buffs.lua (in the Buffs:UpdateButtonLayout() function). In addition to handling the buff text, this also handles the setting and resetting of the highlight backdrops. This is done here, since those highlights are triggered from this module (also note, there is no PerfectRaid_Highlight.lua file, that options pane is defined in this file. That's really it. What I could do, is provide a separate file that can be used to code layouts in Lua by providing a new master UpdateButtonLayout() function. This way, people could share their customizations on the PerfectRaid visual style. Would that be interesting to anyone? |
Quote:
Quote:
Code:
button.name:SetJustifyH("LEFT") With this change Manabar is on top of the name, so the bigger the manabar the less you see of the name. Is there a possibilty to change this behaviour? |
Using the latest version of PRaid I have managed to get the name over the bar with the following changes:
Code:
Line 557 |
Isn't there an option for that? Disable the checkbox that colors names by class.
|
Im either blind (a good possibility) or the only option for class color is the bar.
|
You are probably correct. There's a function called PerfectRaid:GetColoredName(). Simply change that to have it return a white name instead of the class colored name.
|
I know absolutely nothing about lua code.
That said I did get this to work. I just don't know what to change about the PerfectRaid:GetColoredName() in order to get the names to show up white. XD |
Change
return string.format("%s|cFF%02x%02x%02x%s|r", group, color.r*255, color.g*255, color.b*255, UnitName(unit) or "Unknown") to return string.format("%s|cFFFFFF%s|r", group, UnitName(unit) or "Unknown") |
Quote:
|
i think it needs another set of FF's
|cFFFFFFFF |
That fixed it, thanks.
|
Sorry, I'm kind of new to editing LUA and want to change the names to be over the health bars. What program do you use to edit the lua files? I tried notepad/wordpad but they dont list the lines. I than downloaded WoW UI Designer but the lines dont seem to match up with the directions you provided.
Thanks in advance |
I used to use Scite on windows. The line numbers will not match precisely, they have changed.
|
Just thought I'd share this here, it took ages for me to get this part :)
I wanted to change the colors of the bars (when it's not class colored), to white, shifting to red when the HP decreases. I did this by changing the Dongle.Utils.GerSeverity(perc,class) function in PerfectRaid_Utils.lua (around line 64). It now looks like this: Code:
function DongleUtils.GetHPSeverity(perc, class) |
Great, thanks =)
|
Me and my sexy undead priest love praid for years it seems and the only 2 things i came across, which irritate me:
- slightly more accurate (large) backdrop frame, cause first/last healthbars are not covered fully and beginnning of long names either... - disabled mouseover or mouseclick activity between healthbars, cause sometimes i get tooltips when i hover between healthbars, if there is some raidmember there ^^. I got all tooltips disabled in combat due to that disadvantage, but even seconds before pull, when im still out of combat it irritates (tooltip i mean). What to say about sudden targeting of random guy... Thanks in advance for implementing such options/fixes or for the way how to edit code to get it working. P.S.: Ur addon is best ever! <3 |
Is there a way to prevent player names from being shortened with a triple dot?
I looked into the .lua files but I can't seem to find it... :confused: |
Not trivially, no.
|
All times are GMT -6. The time now is 07:59 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI