Mercurial > wow > hotcorners
diff HotCorners.lua @ 3:be6f5d3e0a95
- Added Summary Panel.
author | tercio |
---|---|
date | Sun, 31 Aug 2014 21:23:10 -0300 |
parents | a6fb0ff113b1 |
children | d8a463c5ef5a |
line wrap: on
line diff
--- a/HotCorners.lua Sat Aug 23 18:56:28 2014 -0300 +++ b/HotCorners.lua Sun Aug 31 21:23:10 2014 -0300 @@ -1,7 +1,3 @@ - --- fazer ele fechar apenas com o HotCornersBackgroundFrame. --- assim vai dar + estabilidade sabendo exatamente quando ele esta aberto ou fechado. - LibHotCorners = LibStub ("AceAddon-3.0"):NewAddon ("HotCorners", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0") _G.HotCorners = LibHotCorners local LibHotCorners = LibHotCorners @@ -501,6 +497,41 @@ --item frame LibHotCorners:RefereshItems (self) + self.AnimOnShow:Play() + HotCornersInfosFrame:Show() + HotCornersInfosFrame:SetAlpha (0) + HotCornersInfosFrame.AnimOnShow:Play() + + --update repair + local percent, items = 0, 0 + for i = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do + local durability, maxdurability = GetInventoryItemDurability (i) + if (durability and maxdurability) then + local p = durability / maxdurability * 100 + percent = percent + p + items = items + 1 + end + end + + if (items == 0) then + HotCornersInfosFrame.repairText:SetText ("-- %") + end + + percent = percent / items + HotCornersInfosFrame.repairText:SetText (math.floor (percent) .. "%") + + --update date + HotCornersInfosFrame.clockText:SetText (date ("%H:%M")) + HotCornersInfosFrame.dayText:SetText (date ("%A\n%B %d")) + + --update money + local money = GetMoney() + HotCornersInfosFrame.goldText:SetText (math.floor (money / 100 / 100)) + HotCornersInfosFrame.silverText:SetText (math.floor ((money / 100) % 100)) + HotCornersInfosFrame.bronzeText:SetText (math.floor (money % 100)) + + --HotCornersInfosFrame.clockText:SetText (date ("%A %B %d %H:%M:%S %Y")) + end function LibHotCorners:RefereshItems (self) @@ -597,6 +628,7 @@ OptionsButton:Hide() self.item_frame:Hide() + HotCornersInfosFrame:Hide() end --> quick corner on click