From 4f6019fd0c5ace657c391eeffd6cd48e2d2b2cfe Mon Sep 17 00:00:00 2001 From: Sidoine De Wispelaere Date: Sun, 13 Nov 2011 16:43:45 +0000 Subject: [PATCH] test git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@431 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleFrame.lua | 87 +++++++++++++++++++++++++++++++------------------------- OvaleIcone.lua | 20 ++++++++++++- 2 files changed, 67 insertions(+), 40 deletions(-) diff --git a/OvaleFrame.lua b/OvaleFrame.lua index 89b7e62..13e28bf 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -169,52 +169,60 @@ do Ovale:Log("CalculerMeilleureAction start = "..start) end local action = self.actions[k] - - local actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, - actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, actionTarget, noRed = Ovale:GetActionInfo(element) - if noRed then - start = actionCooldownStart + actionCooldownDuration - if start < Ovale.currentTime then - start = Ovale.currentTime + Ovale:Log("node.params.type = " .. node.params.type) + if node.params.type == "value" then + local actionTexture + if node.params.texture then + actionTexture = GetSpellTexture(node.params.texture) end - end - - -- Dans le cas de canStopChannelling, on risque de demander d'interrompre le channelling courant, ce qui est stupide - if start and Ovale.currentSpellId and Ovale.attenteFinCast and spellId == Ovale.currentSpellId and start1 then - top = 1 + + -- Dans le cas de canStopChannelling, on risque de demander d'interrompre le channelling courant, ce qui est stupide + if start and Ovale.currentSpellId and Ovale.attenteFinCast and spellId == Ovale.currentSpellId and start1 then + top = 1 + end + action.icons[1]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + top*action.dx)/action.scale,(action.top - top*action.dy)/action.scale) + if action.icons[2] then + action.icons[2]:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + (top+1)*action.dx)/action.scale,(action.top - (top+1)*action.dy)/action.scale) + end end end - if (node.params.size ~= "small" and not node.params.nocd and Ovale.db.profile.apparence.predictif) then + if (node.params.size ~= "small" and not node.params.nocd and Ovale.db.profile.apparence.predictif and node.params.type ~= "value") then if start then local castTime=0 if spellId then @@ -331,6 +339,7 @@ do icon:SetPoint("TOPLEFT",self.frame,"TOPLEFT",(action.left + (l-1)*action.dx)/scale,(action.top - (l-1)*action.dy)/scale) icon:SetScale(scale) icon:SetFontScale(Ovale.db.profile.apparence.fontScale) + icon:SetParams(node.params) icon:SetHelp(node.params.help) icon:SetRangeIndicator(Ovale.db.profile.apparence.targetText) icon:EnableMouse(not Ovale.db.profile.apparence.clickThru) diff --git a/OvaleIcone.lua b/OvaleIcone.lua index 1841dbc..b37ba38 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -1,6 +1,18 @@ local LBF = LibStub("LibButtonFacade", true) local L = LibStub("AceLocale-3.0"):GetLocale("Ovale") +local function SetValue(self, value, actionTexture) + self.icone:Show() + self.icone:SetTexture(actionTexture); + self.icone:SetAlpha(1.0) + self.cd:Hide() + self.aPortee:Hide() + self.shortcut:Hide() + self.remains:SetText("TOTO") --string.format("%.1f", value)) + self.remains:Show() + self:Show() +end + local function Update(self, element, minAttente, actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, actionTarget) @@ -88,7 +100,7 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a end -- Le temps restant - if (Ovale.db.profile.apparence.numeric and minAttente > Ovale.maintenant) then + if ((Ovale.db.profile.apparence.numeric or self.params.text == "always") and minAttente > Ovale.maintenant) then self.remains:SetText(string.format("%.1f", minAttente - Ovale.maintenant)) self.remains:Show() else @@ -164,6 +176,10 @@ local function SetHelp(self, help) self.help = help end +local function SetParams(self, params) + self.params = params +end + local function SetFontScale(self, scale) self.fontScale = scale self.shortcut:SetFont(self.fontName, self.fontHeight * self.fontScale, self.fontFlags) @@ -227,8 +243,10 @@ function OvaleIcone_OnLoad(self) self.Update = Update self.SetSize = SetSize self.SetHelp = SetHelp + self.SetParams = SetParams self.SetFontScale = SetFontScale self.SetRangeIndicator = SetRangeIndicator + self.SetValue = SetValue self.cdShown = true if Ovale.db.profile.clickThru then self:EnableMouse(false) -- 1.7.9.5