Go to Page... |
Thread Tools | Display Modes |
02-14-13, 05:50 PM | #1 |
[WIP] Adjusting bunitframes to my taste and needs, help required!
Hey there,
I am currently on my journey into addons in WoW again I have come decently far by using my little actuall lua knowledge but depend highly on just thinking about what i am seeing in the code and adjusting it to what i understand will do stuff that i want to change. So in total my actuall knowledge if about nonexistence but with logically thinking i get somewhat far. I want to try to adjust bunitframes to my likings and hope you may help me with that and maybe i may learn alot from that. But please keep it simple and clear so even someone like me - a totally noob - may understand why and what you are doing. So my first few things i want to have happen are the followings: 1) remove total health value only from playerframe and remove total power value only from target frame: I have done a very simple solution by just moving these values out of the way as my out commenting on the parts i did screwed up everything. As i do not like such "bad code" in my addons i'd like to fix it "cleanly" by removing the parts i do not like instead of moving them out of my screen. I have done: Code:
if self.panel then self.health.value = self.health.value or self.health:CreateFontString(fname..'healthbarvalue', 'OVERLAY', 'GameFontNormal') self.health.value:SetFont(defaultfont, (NATIVE_FONT_SIZE-1) * frameScale) if self.panel then if self.unit =='player' then self.health.value:SetPoint('LEFT', self.panel, 'LEFT', gap*2, 5000) -- 5000 was 0 elseif self.unit == 'target' then self.health.value:SetPoint('RIGHT', self.panel, 'RIGHT', -gap*2, 0) else self.health.value:SetPoint('RIGHT', self.panel, 'RIGHT', -gap*2, 0) end else self.health.value:SetPoint('TOPLEFT', gap*2, 0) self.health.value:SetPoint('BOTTOMRIGHT', -gap*2, 0) self.health.value:SetJustifyH('RIGHT') end end Code:
if self.panel then self.power.value = self.power.value or self.power:CreateFontString(fname..'powerbarvalue', 'OVERLAY', 'GameFontNormal') self.power.value:SetFont(defaultfont, NATIVE_FONT_SIZE * frameScale) if self:GetHeight() > 30 then if self.panel then self.power.value:SetFont(defaultfont, (NATIVE_FONT_SIZE-1) * frameScale) if self.unit =='player' then self.power.value:SetPoint('RIGHT', self.panel, 'RIGHT', -gap*2, 0) elseif self.unit == 'target' then self.power.value:SetPoint('RIGHT', self.health.value, 'LEFT', -gap*2, 5000) -- 5000 was 0 else self.power.value:SetPoint('RIGHT', self.health.value, 'LEFT', -gap*2, 0) end else self.power.value:SetPoint('TOPLEFT', gap*2, 0) self.power.value:SetPoint('BOTTOMRIGHT', -gap*2, 1) self.power.value:SetJustifyH('RIGHT') end end end I have done: Code:
if self.orbs == nil or self.orbs[vmax] == nil then self.orbs = self.orbs or CreateFrame('frame', 'bOrbs', self) local class_color = bUnitFrames.colors.class[class] self.orbs:SetSize(14*vmax, 16) for i=1, vmax do local fname = 'bOrbs'..i self.orbs[i] = self.orbs[i] or self.orbs:CreateTexture(fname..'tex', 'OVERLAY') self.orbs[i]:SetTexture('Interface\\FriendsFrame\\StatusIcon-Offline') self.orbs[i]:SetBlendMode('ADD') self.orbs[i]:SetVertexColor(class_color.r, class_color.g, class_color.b) if class == 'WARLOCK' then local c_color = bUnitFrames.colors.WarlockPower[spec] self.orbs[i]:SetVertexColor(c_color.r*1.3, c_color.g*1.3, c_color.b*1.3) end self.orbs[i]:SetSize(16, 16) self.orbs[i].bg = self.orbs[i].bg or self.orbs:CreateTexture(fname..'texbg', 'OVERLAY') self.orbs[i].bg:SetTexture('Interface\\FriendsFrame\\StatusIcon-Offline') self.orbs[i].bg:SetVertexColor(.1,.1,.1) self.orbs[i].bg:SetSize(16, 16) if i==1 then self.orbs[i]:SetPoint('LEFT') self.orbs[i].bg:SetPoint('LEFT') else self.orbs[i]:SetPoint('LEFT', self.orbs[i-1], 'RIGHT', -2, 4) -- defaultvalue = -2, 0 self.orbs[i].bg:SetPoint('LEFT', self.orbs[i-1].bg, 'RIGHT', -2, 4) -- defaultvalue = -2, 0 end self.orbs[i].bg:SetDrawLayer('OVERLAY', 6) self.orbs[i]:SetDrawLayer('OVERLAY', 7) end self.orbs:SetPoint('CENTER', self.power, 'TOP') end And i do not know why. I want to change more stuff but this will take some time so please keep checking back from time to time if you are willing to help me Thx alot I appreciate your help immensly!
__________________
Balance is, when everyone is unhappy. Last edited by Syliha : 02-14-13 at 05:53 PM. |
|
02-14-13, 07:32 PM | #2 |
Your health and power issues should be fixable by setting their text to nothing.
Code:
self.health.value:SetText(' ') self.power.value:SetText(' ') As for your orb issues.. Code:
self.orbs[i]:SetPoint('LEFT', self.orbs[i-1], 'RIGHT', -2, 4) -- defaultvalue = -2, 0 self.orbs[i].bg:SetPoint('LEFT', self.orbs[i-1].bg, 'RIGHT', -2, 4) -- defaultvalue = -2, 0
__________________
AddOns: Tim @ WoWInterface Battle Tag: Mysterio#11164 Current PC Setup: PCPartPicker List |
|
02-15-13, 04:12 AM | #3 | ||
sorry for the silence. my answers are short, because I do not write very well in english
lua Code:
|
|||
02-15-13, 05:48 AM | #4 |
Hey u 2 :)
Thx alout for your help everything worked and I have understood why so I will remember it (and if not i can still look up the thread :D). So I have 3 more questions: 1) I want to color the target debuffs so they display an appropriated color (magic = blue, harmstring = red etc.) I have tried setting: debuffFrame.icon:SetBorder(1,1,1) just as a test to get at least one color around alld ebuffs, which did not work. Also i tried to change: Code:
self.debuffFrames[1].border:Hide() Code:
self.debuffFrames[1].border = ('0.66,0.44,0.33') I have googled and read some pages, but alot of these changes they made there are either very complex or with other addons (e.g. ouf) and newly created layouts. As is there is a border / Backdrop used right now which i need to CHANGE and not ADD anything new. I hope i am right with that? So how can i achieve my goal here? I either (cause that's the easiest way) want to color my debuffs with a red border or (which would be perfect) color them depending on their type (magic, physical etc.). 2) I want to adjust the size of the manabar of the targetstarget by about 1-2px. At the moment it looks like this (ignore the circle^^): http://img4.picload.org/image/adddor...nshot_0210.jpg That means that the manabar for the target is about 1-2px smaller than for the player and targetframe which kinda looks bad. I have scanned thorugh all "targettarget" lines i could find but did not find anything which i could adjust like for the orbs function or anything like that. I am totally in the dark here :/ 3) I have hidden all my bars (including playerbar) with ouf barfader till i got into combat or was not at 100% health. As i do not know if and how it works here and wildbreath alread told me to "modify a statedriver values [combat]show;hide". But I have no idea how and what to do, so that's kinda up to you guys :/ Dunno if ouf_barfader is of any use here. I was using this in my old (~1year) old UI Pack but there is no way for me to really compare the code as the ouf layout is no longer supported etc. :/ Additionally I have hidden the minimap button by setting its size to 0,0 could this cause ony problemes? Also i very sorry to not give you guys that are not having experience with this addon any more code but i just do not know where to look and what could help you - deeply sorry for that :/ I really hope you could help me out with that as well as that would be almost everything i need to complete my interface once again :) Again: Much appreciation for your time! (:
__________________
Balance is, when everyone is unhappy. |
|
02-15-13, 06:06 AM | #5 |
look for updateAuraButton function
lua Code:
lua Code:
lua Code:
Last edited by Wildbreath : 02-15-13 at 06:14 AM. |
|
02-15-13, 06:47 AM | #6 |
Hi!
The debuff thingy worked thx alot! Will try the hidingcode next. I noticed a thing which i am not sure if it is cause of my changes or a general bug: The Deathknightrunes are not indicating if they are usable or not. I noticed if i am out of runes they show the same colors as if i have them available. I also noticed that they glow (as if an action button ability is ready again after a cooldown time) but the "shadow overlay" is missing (that what normaly is on the action bars). They look exactly the same if used or not. Any ideas? Also any idea about the manabar on the target? Love your support thx sooo much Edit: I've pasted your hiding script between these two lines: Code:
bUnitFrames.Layout = function(self) local frameScale = min(self:GetHeight() / 36, self:GetWidth() / 72)
__________________
Balance is, when everyone is unhappy. Last edited by Syliha : 02-15-13 at 07:05 AM. |
|
02-15-13, 07:18 AM | #7 |
will test and post all soon from home, on job now
|
|
02-15-13, 08:09 AM | #8 |
Alright thx alot
I have another issue: http://picload.org/image/adcowwi/wowscrnshot_0215.jpg As you can see here all manabars have different heights (I've edited the default values, to prevent resize errors), my values are: Code:
['player'] = { a = 'CENTER', p = 'UIParent', pa = 'BOTTOM', x = -120, y = 160, width = 150, height = 45, panel = 1, castbar = 1 }, ['target'] = { a = 'CENTER', p = 'UIParent', pa = 'BOTTOM', x = 120, y = 160, width = 150, height = 45, panel = 1, castbar = 1 }, ['targettarget'] = { a = 'CENTER', p = 'UIParent', pa = 'BOTTOM', x = 240, y = 166, width = 80, height = 33 }, Edit: Also there seems to be a conflicht with the addon "cooldowns": http://www.wowinterface.com/download...11871#comments Edit2: Sorry for discovering so many problems :O I get a cooldwon displayed by bunitframes for Consecration: http://picload.org/image/adclgdc/wowscrnshot_0215.jpg It is definitly bunitframes, as every other addon is turned off. Edit3: Also i get huge errorspams in Alteracvalley e.g.: Code:
Message: Interface\FrameXML\CompactUnitFrame.lua:858: attempt to call method 'SetVertexColor' (a nil value) Time: 02/15/13 15:52:20 Count: 1 Stack: Interface\FrameXML\CompactUnitFrame.lua:858: in function <Interface\FrameXML\CompactUnitFrame.lua:826> [C]: in function `CompactUnitFrame_UtilSetDebuff' Interface\AddOns\bUnitFrames\bUnitFrames.lua:876: in function `UpdateDebuffs' Interface\AddOns\bUnitFrames\bUnitFrames.lua:1688: in function `updateAuras' Interface\AddOns\bUnitFrames\bUnitFrames.lua:2229: in function `updateUnit' Interface\AddOns\bUnitFrames\bUnitFrames.lua:2708: in function <Interface\AddOns\bUnitFrames\bUnitFrames.lua:2635> [C]: in function `SetAttribute' Interface\FrameXML\SecureGroupHeaders.lua:195: in function <Interface\FrameXML\SecureGroupHeaders.lua:115> Interface\FrameXML\SecureGroupHeaders.lua:458: in function `SecureGroupHeader_Update' Interface\FrameXML\SecureGroupHeaders.lua:48: in function <Interface\FrameXML\SecureGroupHeaders.lua:46> Locals: debuffFrame = bRaidUnitButton30Debuff { 0 = <userdata> _SetSize = <function> defined =[C]:-1 parent = bRaidUnitButton30 { } border = "0.66,0.44,0.33" count = bRaidUnitButton30DebuffCount { } unstable = false SetSize = <function> defined @Interface\AddOns\bUnitFrames\bUnitFrames.lua:75 cooldown = bRaidUnitButton30DebuffCooldown { } icon = bRaidUnitButton30DebuffIcon { } } unit = "raid30" index = 1 filter = nil isBossAura = nil isBossBuff = nil name = "Chilled" rank = "" icon = "Interface\Icons\Spell_Frost_FrostArmor02" count = 1 debuffType = "Magic" duration = 0 expirationTime = 0 unitCaster = nil canStealOrPurge = nil shouldConsolidate = nil spellId = 7321 color = <table> { b = 1 g = 0.6 r = 0.2 } (*temporary) = nil (*temporary) = "0.66,0.44,0.33" (*temporary) = 0.2 (*temporary) = 0.6 (*temporary) = 1 (*temporary) = "attempt to call method 'SetVertexColor' (a nil value)"
__________________
Balance is, when everyone is unhappy. Last edited by Syliha : 02-15-13 at 08:55 AM. |
|
02-15-13, 10:44 AM | #9 |
about last error - seems you modify code and it tryes to edit raid debuffs, but raid debuffs not have a color border.
about show/hide - Lua Code:
Lua Code:
|
|
02-15-13, 11:34 AM | #10 | |
Your code produces this error: Code:
Message: Interface\AddOns\bUnitFrames\bUnitFrames.lua:1214: attempt to call global 'UnitMaxHealth' (a nil value) Time: 02/15/13 18:33:42 Count: 5785 Stack: Interface\AddOns\bUnitFrames\bUnitFrames.lua:1214: in function <Interface\AddOns\bUnitFrames\bUnitFrames.lua:1209> Locals: ss = bplayerUnitFrame { 0 = <userdata> shadow = bplayerUnitFrameshadow { } combat = bplayerUnitFrameiconcombat { } SmoothBar = <function> defined @Interface\AddOns\bUnitFrames\bUnitFrames.lua:1027 elapsed = 49.708002308384 pvptimer = playerPVPTimer { } unit = "player" resize = bplayerUnitFrameResizeButton { } panel = bplayerUnitFramepanel { } threat = bplayerUnitFramethreat { } power = bplayerUnitFramepowerbar { } st = 49.708002308384 uf = <unnamed> { } smooted = true castbar = <unnamed> { } menu = <function> defined @Interface\AddOns\bUnitFrames\bUnitFrames.lua:2430 portrait = bplayerUnitFrameportrait { } name = bplayerUnitFrameunitnamestring { } isCastbar = <unnamed> { } title = <unnamed> { } health = bplayerUnitFramehealthbar { } } elapsed = 0.0080000003799796 (*temporary) = 4350 (*temporary) = nil (*temporary) = "player" (*temporary) = "attempt to call global 'UnitMaxHealth' (a nil value)" UnitHealth = <function> defined =[C]:-1 UnitAffectingCombat = <function> defined =[C]:-1 No errors anymore in alterac valley, sorry for my mistake.
__________________
Balance is, when everyone is unhappy. Last edited by Syliha : 02-15-13 at 03:09 PM. |
||
02-16-13, 03:35 AM | #11 |
UnitMaxHealth is wrong, my bad, replace to UnitHealthMax
|
|
02-17-13, 04:19 AM | #12 |
Hey me again^^
I've got almost everything the way I want it to be and therefore are finishing the UI off Thx alot for helping me, would not be possible without your help! So there are three things left: 1) The Hiding of the playerframe gives 2 Problemes: First it does not hide the pet frame (and i suppose it does not hide the focus and focus target as well) which i need to be hidden as well (I do not want to show anything while not in combat or at 100% HP). Also your code gives me "100" in the chat like 3x in 1 Second (so i get a chat locking like this Code:
100 100 100 100 [TRADE]: XYBLAH 1000gold 100 100 100 100 EDIT: Also I need to show the playerframe if I have a target EDIT END Secondly I still have no clue why the powerbar for the targetframe is about 1px bigger than for the playerframes even though they both have the exact same settings. Your hiding code for the HP on the playerframe worked really well Thirdly I still get the Cooldown for my paladin spell which is kinda weird and overlaps all my buttons placed there, so that really needs a fix, too. I really hope i do not annoy you and am really, really glad that you find the time for hepling me. Also if anyone else knows why I am having these issues, please feel free to join the discussion, thx!
__________________
Balance is, when everyone is unhappy. |
|
02-18-13, 06:29 AM | #13 |
ouch, remove print(perc) from code, added it for testing only
for other unit frames you should modify a unit UnitAffectingCombat('target') UnitAffectingCombat('focus') & etc |
|
02-20-13, 09:31 AM | #14 |
Hey
I have achieved everything i wanted now and am really thankful for your support thanks! Only things left are: 1) Powerbar on the target is bigger than everywhere else 2) CD Showing as Paladin. But these are little things that i can overlook in favor of nice and lightweighted unitframes and a supportive author, thanks again! Though you maybe should look into that CD-Problem as Paladin. Cheers!
__________________
Balance is, when everyone is unhappy. |
|
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » [WIP] Adjusting bunitframes to my taste and needs, help required! |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|