From aa475ac8a84343a986ba2b97f612a1d92c6cea70 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Thu, 8 May 2014 17:27:32 +0000 Subject: [PATCH] Allow actions to set their own help text via help=Text parameter. This allows Texture() actions to have a useful help text. The text must have no spaces as that is not yet supported by the compiler. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1408 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleIcone.lua | 22 ++++++++++++++-------- scripts/ovale_druid.lua | 6 +++--- scripts/ovale_hunter_spells.lua | 2 +- scripts/ovale_paladin.lua | 8 ++++---- scripts/ovale_rogue.lua | 2 +- scripts/ovale_warlock_spells.lua | 4 ++-- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/OvaleIcone.lua b/OvaleIcone.lua index 2bd2032..18d399e 100644 --- a/OvaleIcone.lua +++ b/OvaleIcone.lua @@ -38,6 +38,7 @@ local function SetValue(self, value, actionTexture) self.shortcut:Hide() if value then self.actionType = "value" + self.actionHelp = nil self.value = value if value < 10 then self.remains:SetFormattedText("%.1f", value) @@ -114,6 +115,8 @@ local function Update(self, element, minAttente, actionTexture, actionInRange, a --self.cd:Hide() --end + self.actionHelp = element.params.help + if element.params.sound and not self.lastSound then local delay = element.params.soundtime or 0.5 if now>=minAttente - delay then @@ -249,15 +252,17 @@ function OvaleIcone_OnEnter(self) GameTooltip:SetText(L[self.help]) end if self.actionType then - local text - if self.actionType == "spell" then - text = OvaleSpellBook:GetSpellName(self.actionId) - elseif self.actionType == "value" then - text = (self.value < math.huge) and tostring(self.value) or "infinity" - else - text = format("%s %s", self.actionType, tostring(self.actionId)) + local actionHelp = self.actionHelp + if not actionHelp then + if self.actionType == "spell" then + actionHelp = OvaleSpellBook:GetSpellName(self.actionId) + elseif self.actionType == "value" then + actionHelp = (self.value < math.huge) and tostring(self.value) or "infinity" + else + actionHelp = format("%s %s", self.actionType, tostring(self.actionId)) + end end - GameTooltip:AddLine(text, 0.5, 1, 0.75) + GameTooltip:AddLine(actionHelp, 0.5, 1, 0.75) end if next(Ovale.casesACocher) or next(Ovale.listes) then GameTooltip:AddLine(L["Cliquer pour afficher/cacher les options"], 1, 1, 1) @@ -303,6 +308,7 @@ function OvaleIcone_OnLoad(self) self.actionButton = false self.actionType = nil self.actionId = nil + self.actionHelp = nil -- self:SetScript("OnMouseUp", OvaleIcone_OnMouseUp) diff --git a/scripts/ovale_druid.lua b/scripts/ovale_druid.lua index 721b1b6..c9c321a 100644 --- a/scripts/ovale_druid.lua +++ b/scripts/ovale_druid.lua @@ -597,7 +597,7 @@ AddIcon mastery=feral size=small checkboxon=opt_icons_left AddIcon mastery=feral help=main { if InCombat(no) FeralPrecombatActions() - if not target.InRange(mangle_cat) Texture(ability_druid_catformattack) + if not target.InRange(mangle_cat) Texture(ability_druid_catformattack help=NotInMeleeRange) if List(opt_feral_rotation basic) FeralBasicActions() if List(opt_feral_rotation advanced) FeralAdvancedActions() } @@ -605,7 +605,7 @@ AddIcon mastery=feral help=main AddIcon mastery=feral help=main { if InCombat(no) FeralPrecombatActions() - if not target.InRange(mangle_cat) Texture(ability_druid_catformattack) + if not target.InRange(mangle_cat) Texture(ability_druid_catformattack help=NotInMeleeRange) if List(opt_feral_rotation basic) FeralBasicPredictiveActions() if List(opt_feral_rotation advanced) FeralAdvancedPredictiveActions() } @@ -762,7 +762,7 @@ AddIcon mastery=guardian size=small checkboxon=opt_icons_right # AddFunction Swiftmend { - if not SpellCooldown(swiftmend) > 0 Texture(inv_relics_idolofrejuvenation) + if not SpellCooldown(swiftmend) > 0 Texture(inv_relics_idolofrejuvenation help=Swiftmend) } AddFunction RestorationMainActions diff --git a/scripts/ovale_hunter_spells.lua b/scripts/ovale_hunter_spells.lua index 01611d4..46031fc 100644 --- a/scripts/ovale_hunter_spells.lua +++ b/scripts/ovale_hunter_spells.lua @@ -163,7 +163,7 @@ AddFunction Interrupt AddFunction SummonPet { - if pet.Present(no) Texture(ability_hunter_beastcall) + if pet.Present(no) Texture(ability_hunter_beastcall help=SummonPet) if pet.IsDead() Spell(revive_pet) } ]] diff --git a/scripts/ovale_paladin.lua b/scripts/ovale_paladin.lua index 3807ec1..fc74696 100644 --- a/scripts/ovale_paladin.lua +++ b/scripts/ovale_paladin.lua @@ -79,7 +79,7 @@ AddIcon mastery=holy help=mana size=small checkboxon=opt_icons_left if ManaPercent() <98 Spell(arcane_torrent_mana) if ManaPercent() <88 Spell(divine_plea) # Show "dash" icon if not in melee range. - if target.IsFriend(no) and not target.InRange(crusader_strike) Texture(ability_druid_dash) + if target.IsFriend(no) and not target.InRange(crusader_strike) Texture(ability_druid_dash help=NotInMeleeRange) } AddIcon mastery=holy help=shortcd @@ -114,7 +114,7 @@ AddIcon mastery=holy help=cd AddIcon mastery=holy size=small checkboxon=opt_icons_right { - if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury) + if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury help=RighteousFuryIsActive) } AddIcon mastery=holy size=small checkboxon=opt_icons_right @@ -274,7 +274,7 @@ AddIcon mastery=protection help=cd AddIcon mastery=protection size=small checkboxon=opt_icons_right { - if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury) + if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury help=RighteousFuryIsActive) } AddIcon mastery=protection size=small checkboxon=opt_icons_right @@ -472,7 +472,7 @@ AddIcon mastery=retribution size=small checkboxon=opt_icons_right { #seal_of_righteousness,if=active_enemies>=4 if Enemies() >= 4 and not Stance(paladin_seal_of_righteousness) Spell(seal_of_righteousness) - if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury) + if BuffPresent(righteous_fury) Texture(spell_holy_sealoffury help=RighteousFuryIsActive) } AddIcon mastery=retribution size=small checkboxon=opt_icons_right diff --git a/scripts/ovale_rogue.lua b/scripts/ovale_rogue.lua index 2b8f144..c0ad77c 100644 --- a/scripts/ovale_rogue.lua +++ b/scripts/ovale_rogue.lua @@ -349,7 +349,7 @@ AddIcon mastery=combat size=small checkboxon=opt_icons_left AddIcon mastery=combat size=small checkboxon=opt_icons_left { - if BuffPresent(blade_flurry_buff) Texture(ability_warrior_punishingblow) + if BuffPresent(blade_flurry_buff) Texture(ability_warrior_punishingblow help=BladeFlurryIsActive) Spell(redirect) } diff --git a/scripts/ovale_warlock_spells.lua b/scripts/ovale_warlock_spells.lua index 10e0484..7f49ada 100644 --- a/scripts/ovale_warlock_spells.lua +++ b/scripts/ovale_warlock_spells.lua @@ -184,12 +184,12 @@ Define(wrathguard_wrathstorm_buff 89751) AddFunction SummonPet { - if pet.Present(no) Texture(spell_nature_removecurse) + if pet.Present(no) Texture(spell_nature_removecurse help=SummonPet) } AddFunction ServicePet { - if TalentPoints(grimoire_of_service_talent) and Spell(grimoire_of_service) Texture(spell_nature_removecurse) + if TalentPoints(grimoire_of_service_talent) and Spell(grimoire_of_service) Texture(spell_nature_removecurse help=ServicePet) } AddFunction AfflictionMasteryDamageMultiplier asValue=1 { 1 + MasteryEffect() / 100 } -- 1.7.9.5