From d21631f9949daa617347e51ad601f07f48e714e8 Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Tue, 7 Jul 2009 19:00:03 +0000 Subject: [PATCH] - added WeaponEnchantExpires condition - bug fix: icons were always visible on startup even when option were set to hide them git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@87 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- Condition.lua | 26 +++++++++++++++++++++++++- Ovale.lua | 2 +- Ovale.toc | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Condition.lua b/Condition.lua index 8d16200..59dbb81 100644 --- a/Condition.lua +++ b/Condition.lua @@ -594,5 +594,29 @@ Ovale.conditions= else return timeLeft end - end + end, + WeaponEnchantExpires = function(condition) + local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges = GetWeaponEnchantInfo() + if (condition[1] == "mainhand") then + if (not hasMainHandEnchant) then + return 0 + end + mainHandExpiration = mainHandExpiration/1000 + if (condition[2] >= mainHandExpiration) then + return 0 + else + return mainHandExpiration - condition[2] + end + else + if (not hasOffHandEnchant) then + return 0 + end + offHandExpiration = offHandExpiration/1000 + if (condition[2] >= offHandExpiration) then + return 0 + else + return offHandExpiration - condition[2] + end + end + end, } \ No newline at end of file diff --git a/Ovale.lua b/Ovale.lua index 08ed82b..00a4940 100644 --- a/Ovale.lua +++ b/Ovale.lua @@ -443,7 +443,7 @@ function Ovale:OnEnable() self:FirstInit() end self:UNIT_AURA("","player") - self.frame:Show() + self:UpdateVisibility() end function Ovale:PLAYER_REGEN_ENABLED() diff --git a/Ovale.toc b/Ovale.toc index 6284228..602cdf0 100644 --- a/Ovale.toc +++ b/Ovale.toc @@ -3,7 +3,7 @@ ## Notes: Show the icon of the next spell to cast ## Notes-frFR: Affiche l'icône du prochain sort à lancer ## Author: Sidoine -## Version: 3.1.17 +## Version: 3.1.18 ## OptionalDeps: Ace3, ButtonFacade ## SavedVariables: OvaleDB ## SavedVariablesPerCharacter: OvaleDBPC -- 1.7.9.5