Thread Tools Display Modes
08-26-16, 02:17 AM   #1
Priscilla
A Murloc Raider
Join Date: Mar 2008
Posts: 4
Durability InfoLine

Hi, great UI!

I have a question regarding the durability icon on the info line.
I would like to toggle it to show permanently, but i do not write lua (or anything else) my self...

I assume I would have to change something here?

Code:
local DurabilityAlert
local function Durability_Low(self, dura)
    if not DurabilityAlert then
        DurabilityAlert = _G.CreateFrame("Frame", nil, self, "MicroButtonAlertTemplate")
    end
    if not dura then
        DurabilityAlert:Hide()
    elseif (not DurabilityAlert.isHidden) then
        DurabilityAlert:SetSize(125, DurabilityAlert.Text:GetHeight()+42)
        DurabilityAlert.Arrow:SetPoint("TOP", DurabilityAlert, "BOTTOM", 0, 4)
        DurabilityAlert:SetPoint("BOTTOM", self, "TOP", 0, 18)
        DurabilityAlert.CloseButton:SetScript("OnClick", function(btn)
            DurabilityAlert:Hide()
            DurabilityAlert.isHidden = true
        end)
        DurabilityAlert.Text:SetFormattedText("%s %d%%", _G.DURABILITY, dura)
        DurabilityAlert.Text:SetWidth(100)
        DurabilityAlert:Show()
        DurabilityAlert.isHidden = false
    end
end
  Reply With Quote
08-27-16, 06:33 PM   #2
baberg
A Murloc Raider
Join Date: Aug 2014
Posts: 5
The code you want is a little bit further down from there. Look for this block:

Code:
    -- Info Text
    if minVal <= 95 then
        self.hidden = false
        self.text:SetFormattedText("|cff%s %d÷|r", TextColorNormal, minVal)
    else
        self.hidden = true
        self.text:SetText("")
    end
The easiest way to change this is to change the "95" to "100". This code checks the minimum durability (in percentage) of all worn items, and if you have an item that's less than 95% durability then it will show (self.hidden = false). Change 95 to 100 and it should show all the time.

EDIT: I have not tested this. Something could break because it may be expecting 2 digits and not 3 but I think it should be fine.

Last edited by baberg : 08-27-16 at 06:35 PM.
  Reply With Quote
08-28-16, 02:37 PM   #3
Priscilla
A Murloc Raider
Join Date: Mar 2008
Posts: 4
Thanks a lot!
  Reply With Quote

WoWInterface » Featured Projects » RealUI » Durability InfoLine


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off