Hello everyone,
I seeking advice in improving the default Blizzard UI. What I achieved until now is the following:
- Set a specific in-game tooltip position
- Set a specific in-game player and target frame position
- Set a specific in-game player cast bar position
- Hide various frames
- Class colour frames
- Style chat
What I would like to implement is:
- Hide server from names in raid frames
- Hide group number from raid frames
The current code (which isn't working) is the following:
hooksecurefunc("CompactUnitFrame_UpdateName",function(frame)
if frame and not frame:IsForbidden() then
local frame_name = frame:GetName()
if frame_name and frame_name:match("^CompactRaidFrame%d") and frame.unit and frame.name then
local unit_name = GetUnitName(frame.unit,true)
if unit_name then
frame.name:SetText(unit_name:match("[^-]+"))
end
end
end
end)
hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
if ShouldShowName(frame) then
if frame.optionTable.colorNameBySelection then
frame.name:SetText(GetUnitName(frame.unit))
end
end
end)
Can you help me in doing this?
Thanks in advance and sorry for my english :)
hooksecurefunc("CompactUnitFrame_UpdateName",function(frame)
if frame.optionTable.displayName then
frame.name:SetText(GetUnitName(frame.unit,true):match("[^-]+"))
frame.name:Show()end end)
This will hide the server names, unsure about the group number you're talking about, you can always just uncheck "Keep Groups Together" and you wont see any numbers?
Thanks for the advice, I've tried but I get this error:
Message: Interface\AddOns\HamUI\core.lua:18: attempt to index a nil value
Time: Sun Nov 4 18:41:59 2018
Count: 4
Stack: Interface\AddOns\HamUI\core.lua:18: attempt to index a nil value
Interface\AddOns\HamUI\core.lua:18: in function <Interface\AddOns\HamUI\core.lua:16>
[C]: in function `CompactUnitFrame_UpdateName'
Interface\FrameXML\CompactUnitFrame.lua:61: in function <Interface\FrameXML\CompactUnitFrame.lua:53>
[C]: in function `CameraOrSelectOrMoveStop'
[string "CAMERAORSELECTORMOVE"]:4: in function <[string "CAMERAORSELECTORMOVE"]:1>
Locals: frame = CompactPartyFrameMember5 {
0 = <userdata>
debuffFrames = <table> {
}
maxDispelDebuffs = 3
inVehicle = false
background = CompactPartyFrameMember5Background {
}
powerBar = CompactPartyFrameMember5PowerBar {
}
healthBar = CompactPartyFrameMember5HealthBar {
}
overAbsorbGlow = CompactPartyFrameMember5OverAbsorbGlow {
}
horizTopBorder = CompactPartyFrameMember5HorizTopBorder {
}
vertRightBorder = CompactPartyFrameMember5VertRightBorder {
}
myHealPrediction = CompactPartyFrameMember5MyHealPrediction {
}
aggroHighlight = CompactPartyFrameMember5AggroHighlight {
}
myHealAbsorbRightShadow = CompactPartyFrameMember5MyHealAbsorbRightShadow {
}
overHealAbsorbGlow = CompactPartyFrameMember5OverHealAbsorbGlow {
}
selectionHighlight = CompactPartyFrameMember5SelectionHighlight {
}
myHealAbsorbLeftShadow = CompactPartyFrameMember5MyHealAbsorbLeftShadow {
}
totalAbsorbOverlay = CompactPartyFrameMember5TotalAbsorbOverlay {
}
unit = "party4"
unitExists = false
updateAllEvent = "GROUP_ROSTER_UPDATE"
statusText = CompactPartyFrameMember5StatusText {
}
horizDivider = CompactPartyFrameMember5HorizDivider {
}
displayedUnit = "party4"
roleIcon = CompactPartyFrameMember5RoleIcon {
}
menu = <function> defined @Interface\FrameXML\CompactUnitFrame.lua:252
optionTable = <table> {
}
otherHealPrediction = CompactPartyFrameMember5OtherHealPrediction {
}
dispelDebuffFrames = <table> {
}
buffFrames = <table> {
}
maxDebuffs = 3
centerStatusIcon = CompactPartyFrameMember5CenterStatusIcon {
}
dropDown = CompactPartyFrameMember5DropDown {
}
myHealAbsorb = CompactPartyFrameMember5MyHealAbsorb {
}
maxBuffs = 3
vertLeftBorder = CompactPartyFrameMember5VertLeftBorder {
}
horizBottomBorder = CompactPartyFrameMember5HorizBottomBorder {
}
name = CompactPartyFrameMember5Name {
}
readyCheckIcon = CompactPartyFrameMember5ReadyCheckIcon {
}
totalAbsorb = CompactPartyFrameMember5TotalAbsorb {
}
}
(*temporary) = <function> defined =[C]:-1
(*temporary) = CompactPartyFrameMember5Name {
0 = <userdata>
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = true
(*temporary) = "attempt to index a nil value"