-- if not (self:GetParent():GetName()=='oUF_Party' or unit:find('partypet%d')) then
if not unit:match('^party') then -- New line
self.Power.value = self.Power:CreateFontString(nil, 'OVERLAY')
self.Power.value:SetFont(font, fSize)
self.Power.value:SetPoint('RIGHT', -2, 0)
end
and hope than I can finaly merge the lauouts.
Moonie, once that is done could you be so nice and look trouh the code, and let me know if there are things that could be inproved
local function menu(self)
local cunit = self.unit:gsub('(.)', string.upper, 1)
if(_G[cunit..'FrameDropDown']) then
ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], 'cursor')
elseif(self.unit:match('^party')) then
ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor')
elseif(self.unit:match('^raid')) then
self.name = unit
RaidGroupButton_ShowMenu(self)
end
end
give cred for this, used many hours looking through lua files finding it
P3lim, I will :) Editted with code strip. :) That's how it'll look in all my layouts. Thanks again.
---------------------------------------------------------------------
-- Right click party AND RAID menu
-- Big thanks to P3lim for going through all the troubles to get this menu to support raids as well.
---------------------------------------------------------------------
local function menu(self)
local cunit = self.unit:gsub('(.)', string.upper, 1)
if(_G[cunit..'FrameDropDown']) then
ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], 'cursor')
elseif(self.unit:match('^party')) then
ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor')
elseif(self.unit:match('^raid')) then
self.name = unit
RaidGroupButton_ShowMenu(self)
end
end
Caellian, you can add me to msn, or pm with with the pastey link :)
*cough* github makes forking and sending pull requests very simple *cough*
Github, and Git in general, would be a whole lot more appealing to me if there were a decent Windows client available. The icon overlays in TortoiseSVN are just too handy.
Quote from Caellian »
doesn't unit:match('^party') match both party and party pet ?
Yes. Any unit which begins with the string "party" will be matched by that: partyN, partypetN, partytargetN, partypettargetN, etc.
local function menu(self)
local cunit = self.unit:gsub('(.)', string.upper, 1)
if(_G[cunit..'FrameDropDown']) then
ToggleDropDownMenu(1, nil, _G[cunit..'FrameDropDown'], 'cursor')
elseif(self.unit:match('^party')) then
ToggleDropDownMenu(1, nil, _G['PartyMemberFrame'..self.id..'DropDown'], 'cursor')
elseif(self.unit:match('^raid')) then
self.name = unit
RaidGroupButton_ShowMenu(self)
end
end
give cred for this, used many hours looking through lua files finding it
Me and Caellian tested it, we were very far appart, but no menu popped up for neither of us.
Could one of you be kind enough to tell me how this works?
self.Health:SetWidth(unit and 200 or 100)
What's with the unit and part?
It's a conditional expression. Basically: If unit exists (not nil or false), return 200. Otherwise, return 100. Conditional expressions in Lua only work if the first return value is not nil or false - which in this case is true (200).
It assumes that "unit" is a variable that was set earlier in the code (probably passed as an argument into the function). If you didn't set the variable "unit" anywhere, it will always be nil, and you'll always get a width of 100.
See, I am trying to shorten some of my code, and so far it's working, but I am baffled at the "how do I give my frames per unit a different height/width without the metatables before the spawns". And this little thing with the unit and just stumped me. Because I just think that everything we do in oUF is a unit. Or rather, these are unit frames, so yes - there will be a unit...
And this little thing with the unit and just stumped me. Because I just think that everything we do in oUF is a unit. Or rather, these are unit frames, so yes - there will be a unit...
party and raid are headers, not unit. i think thats pretty much the only exeptions.
Edit: still working on the unit:match("^raid") thing to add raid frames to my oUF. But I may end up discarding it totally and work on a seperate raid layout.
Edit. Sadly, the reason I answered Cold, was why I got errors. Once and for all, Moon, L2REMEMBER PARTY & RAID ~= UNIT
Edit: still working on the unit:match("^raid") thing to add raid frames to my oUF. But I may end up discarding it totally and work on a seperate raid layout.
I use
if(self:GetParent():GetName():match"oUF_Raid") then
I'm having an error with my updateName function, it doesn't happen very often, sometimes when joining a new raid/group, sometimes everything's fine. I can't see what's wrong there, could you guys take a quick look plz
Interface\AddOns\oUF_Caellian\oUF_Caellian.lua:114: bad argument #1 to 'unpack' (table expected, got nil)
Github, and Git in general, would be a whole lot more appealing to me if there were a decent Windows client available. The icon overlays in TortoiseSVN are just too handy.
Yes. Any unit which begins with the string "party" will be matched by that: partyN, partypetN, partytargetN, partypettargetN, etc.
while there are not those handy icon overlays like tortoisesvn has (and which are not always working on larger project) .. the windows msysgit installer can add two menu entrys in your right click menu on direcories ("Open Git Bash here" and "Open Git Gui here"). This gui is mainly for doing commits, but you can also use it to pull from different sources to your repository or push your changes to other repositorys like curseforge, the new wowace or github .)
Interface\AddOns\oUF_AI\oUF_AIcom.lua:291: attempt to index local 'unit' (a nil value)
[C]: ?
Interface\AddOns\oUF_AI\oUF_AIcom.lua:291: in function `style'
Interface\AddOns\oUF\ouf.lua:200: in function `configFunction'
Interface\FrameXML\SecureTemplates.lua:675: in function <Interface\FrameXML\SecureTemplates.lua:672>
[C]: in function `securecall'
Interface\FrameXML\SecureTemplates.lua:682: in function `SetupUnitButtonConfiguration'
Interface\FrameXML\SecureTemplates.lua:760: in function <Interface\FrameXML\SecureTemplates.lua:715>
Interface\FrameXML\SecureTemplates.lua:1008: in function `SecureGroupHeader_Update'
[string "*:OnShow"]:1: in function <[string "*:OnShow"]:1>
[C]: in function `Show'
Interface\AddOns\oUF_AI\oUF_AIcom.lua:667: in function <Interface\AddOns\oUF_AI\oUF_AIcom.lua:655>
the peace of code it's in
if not unit:match('^party') then -- THIS LINE
self.Power.value = self.Power:CreateFontString(nil, 'OVERLAY')
self.Power.value:SetFont(font, fSize)
self.Power.value:SetPoint('RIGHT', -2, 0)
end
when swaping the faulty line for
if not (self:GetParent():GetName()=='oUF_Party' or unit:find('partypet%d')) then -- attempt to index local 'unit' (a nil value)
I'd like my oUF castbar to not only show the current casting time but also the total casting time of the spell currently cast. So I tried this in my oUF layout:
local _,_,_,_,startTime,endTime = UnitCastingInfo(unit)
if not (endTime==nil) then
local ctime = endTime/1000 - startTime/1000
self.Castbar.Time:SetText(self.Castbar.Time:GetText() .. " | " .. ctime)
end
It doesn't pop errors but doesn't change anything in the casttime display either. What's wrong?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I dont spawn party pets so I wouldnt know
Btw, Ive made raid rightclick menues.
wtb!
and hope than I can finaly merge the lauouts.
Moonie, once that is done could you be so nice and look trouh the code, and let me know if there are things that could be inproved
give cred for this, used many hours looking through lua files finding it
Caellian, you can add me to msn, or pm with with the pastey link :)
Github, and Git in general, would be a whole lot more appealing to me if there were a decent Windows client available. The icon overlays in TortoiseSVN are just too handy.
Yes. Any unit which begins with the string "party" will be matched by that: partyN, partypetN, partytargetN, partypettargetN, etc.
That's funny, considering I figured it out in 30 seconds.
Me and Caellian tested it, we were very far appart, but no menu popped up for neither of us.
self.Health:SetWidth(unit and 200 or 100)
What's with the unit and part?
It's a conditional expression. Basically: If unit exists (not nil or false), return 200. Otherwise, return 100. Conditional expressions in Lua only work if the first return value is not nil or false - which in this case is true (200).
party and raid are headers, not unit. i think thats pretty much the only exeptions.
Edit: still working on the unit:match("^raid") thing to add raid frames to my oUF. But I may end up discarding it totally and work on a seperate raid layout.
Edit. Sadly, the reason I answered Cold, was why I got errors. Once and for all, Moon, L2REMEMBER PARTY & RAID ~= UNIT
I use
To manage my raid frames within my layout.
Its when someone joins a raid/group and the server doesnt give their class, use t = table or { 1, 1, 1 } or something to makesure unpack gets a table
while there are not those handy icon overlays like tortoisesvn has (and which are not always working on larger project) .. the windows msysgit installer can add two menu entrys in your right click menu on direcories ("Open Git Bash here" and "Open Git Gui here"). This gui is mainly for doing commits, but you can also use it to pull from different sources to your repository or push your changes to other repositorys like curseforge, the new wowace or github .)
the peace of code it's in
when swaping the faulty line for
give the same error
It doesn't pop errors but doesn't change anything in the casttime display either. What's wrong?