Mercurial > wow > hotcorners
comparison HotCorners.lua @ 3:be6f5d3e0a95
- Added Summary Panel.
| author | tercio |
|---|---|
| date | Sun, 31 Aug 2014 21:23:10 -0300 |
| parents | a6fb0ff113b1 |
| children | d8a463c5ef5a |
comparison
equal
deleted
inserted
replaced
| 2:a6fb0ff113b1 | 3:be6f5d3e0a95 |
|---|---|
| 1 | |
| 2 -- fazer ele fechar apenas com o HotCornersBackgroundFrame. | |
| 3 -- assim vai dar + estabilidade sabendo exatamente quando ele esta aberto ou fechado. | |
| 4 | |
| 5 LibHotCorners = LibStub ("AceAddon-3.0"):NewAddon ("HotCorners", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0") | 1 LibHotCorners = LibStub ("AceAddon-3.0"):NewAddon ("HotCorners", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0") |
| 6 _G.HotCorners = LibHotCorners | 2 _G.HotCorners = LibHotCorners |
| 7 local LibHotCorners = LibHotCorners | 3 local LibHotCorners = LibHotCorners |
| 8 | 4 |
| 9 local LBD = LibStub ("LibDataBroker-1.1") | 5 local LBD = LibStub ("LibDataBroker-1.1") |
| 499 OptionsButton:Show() | 495 OptionsButton:Show() |
| 500 | 496 |
| 501 --item frame | 497 --item frame |
| 502 LibHotCorners:RefereshItems (self) | 498 LibHotCorners:RefereshItems (self) |
| 503 | 499 |
| 500 self.AnimOnShow:Play() | |
| 501 HotCornersInfosFrame:Show() | |
| 502 HotCornersInfosFrame:SetAlpha (0) | |
| 503 HotCornersInfosFrame.AnimOnShow:Play() | |
| 504 | |
| 505 --update repair | |
| 506 local percent, items = 0, 0 | |
| 507 for i = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do | |
| 508 local durability, maxdurability = GetInventoryItemDurability (i) | |
| 509 if (durability and maxdurability) then | |
| 510 local p = durability / maxdurability * 100 | |
| 511 percent = percent + p | |
| 512 items = items + 1 | |
| 513 end | |
| 514 end | |
| 515 | |
| 516 if (items == 0) then | |
| 517 HotCornersInfosFrame.repairText:SetText ("-- %") | |
| 518 end | |
| 519 | |
| 520 percent = percent / items | |
| 521 HotCornersInfosFrame.repairText:SetText (math.floor (percent) .. "%") | |
| 522 | |
| 523 --update date | |
| 524 HotCornersInfosFrame.clockText:SetText (date ("%H:%M")) | |
| 525 HotCornersInfosFrame.dayText:SetText (date ("%A\n%B %d")) | |
| 526 | |
| 527 --update money | |
| 528 local money = GetMoney() | |
| 529 HotCornersInfosFrame.goldText:SetText (math.floor (money / 100 / 100)) | |
| 530 HotCornersInfosFrame.silverText:SetText (math.floor ((money / 100) % 100)) | |
| 531 HotCornersInfosFrame.bronzeText:SetText (math.floor (money % 100)) | |
| 532 | |
| 533 --HotCornersInfosFrame.clockText:SetText (date ("%A %B %d %H:%M:%S %Y")) | |
| 534 | |
| 504 end | 535 end |
| 505 | 536 |
| 506 function LibHotCorners:RefereshItems (self) | 537 function LibHotCorners:RefereshItems (self) |
| 507 | 538 |
| 508 if (not self) then | 539 if (not self) then |
| 595 | 626 |
| 596 local OptionsButton = LibHotCorners [self.position].optionsbutton | 627 local OptionsButton = LibHotCorners [self.position].optionsbutton |
| 597 OptionsButton:Hide() | 628 OptionsButton:Hide() |
| 598 | 629 |
| 599 self.item_frame:Hide() | 630 self.item_frame:Hide() |
| 631 HotCornersInfosFrame:Hide() | |
| 600 end | 632 end |
| 601 | 633 |
| 602 --> quick corner on click | 634 --> quick corner on click |
| 603 function HotCornersOnQuickClick (self, button) | 635 function HotCornersOnQuickClick (self, button) |
| 604 local parent_position = self:GetParent().position | 636 local parent_position = self:GetParent().position |
