diff --git a/TitanClassicRegen/TitanClassicRegen.lua b/TitanClassicRegen/TitanClassicRegen.lua index 3b3b913..0a8dc26 100644 --- a/TitanClassicRegen/TitanClassicRegen.lua +++ b/TitanClassicRegen/TitanClassicRegen.lua @@ -42,18 +42,18 @@ local function TitanRegenTemp_GetColoredTextRGB(text, r, g, b) end -- ************************************************************************** --- NAME : TitanPanelTitanRegenButton_OnLoad() +-- NAME : TitanPanelRegenButton_OnLoad() -- DESC : Registers the plugin upon it loading -- ************************************************************************** -function TitanPanelTitanRegenButton_OnLoad(self) +function TitanPanelRegenButton_OnLoad(self) self.registry = { id = TITAN_REGEN_ID, category = "Built-ins", version = TITAN_VERSION, menuText = L["TITAN_REGEN_MENU_TEXT"], - buttonTextFunction = "TitanPanelTitanRegenButton_GetButtonText", + buttonTextFunction = "TitanPanelRegenButton_GetButtonText", tooltipTitle = L["TITAN_REGEN_MENU_TOOLTIP_TITLE"], - tooltipTextFunction = "TitanPanelTitanRegenButton_GetTooltipText", + tooltipTextFunction = "TitanPanelRegenButton_GetTooltipText", controlVariables = { ShowIcon = false, ShowLabelText = true, @@ -81,7 +81,7 @@ end -- NAME : TitanPanelXPButton_OnEvent -- DESC : Parse events registered to addon and act on them -- ************************************************************************** -function TitanPanelTitanRegenButton_OnEvent(self, event, ...) +function TitanPanelRegenButton_OnEvent(self, event, ...) if ( event == "PLAYER_ENTERING_WORLD") then if (UnitPowerMax("player") == 0) then TitanSetVar(TITAN_REGEN_ID, "ShowMPRegen", 0); @@ -121,7 +121,7 @@ function TitanPanelTitanRegenButton_OnEvent(self, event, ...) if (TitanGetVar(TITAN_REGEN_ID,"ShowMPRegen") == 1) then if ( event == "UNIT_MANA" and a1 == "player" ) then - currMana = UnitMana("player"); + currMana = UnitPower("player"); runUpdate = 1; if ( currMana > TITAN_RegenCurrMana and TITAN_RegenCurrMana ~= 0 ) then TITAN_RegenMP = currMana-TITAN_RegenCurrMana; @@ -147,11 +147,11 @@ function TitanPanelTitanRegenButton_OnEvent(self, event, ...) end -- ************************************************************************** --- NAME : TitanPanelTitanRegenButton_GetButtonText(id) +-- NAME : TitanPanelRegenButton_GetButtonText(id) -- DESC : Calculate regeneration logic for button text -- VARS : id = button ID -- ************************************************************************** -function TitanPanelTitanRegenButton_GetButtonText(id) +function TitanPanelRegenButton_GetButtonText(id) local labelTextHP = ""; local valueTextHP = ""; local labelTextMP = ""; @@ -161,7 +161,7 @@ function TitanPanelTitanRegenButton_GetButtonText(id) if UnitHealth("player") == UnitHealthMax("player") then TITAN_RegenHP = 0; end - if UnitMana("player") == UnitPowerMax("player") then + if UnitPower("player") == UnitPowerMax("player") then TITAN_RegenMP = 0; end @@ -203,10 +203,10 @@ function TitanPanelTitanRegenButton_GetButtonText(id) end -- ************************************************************************** --- NAME : TitanPanelTitanRegenButton_GetTooltipText() +-- NAME : TitanPanelRegenButton_GetTooltipText() -- DESC : Display tooltip text -- ************************************************************************** -function TitanPanelTitanRegenButton_GetTooltipText() +function TitanPanelRegenButton_GetTooltipText() local minHP = TITAN_RegenMinHPRate; local minMP = TITAN_RegenMinMPRate; @@ -220,7 +220,7 @@ function TitanPanelTitanRegenButton_GetTooltipText() return "".. format(L["TITAN_REGEN_TOOLTIP1"], UnitHealth("player"),UnitHealthMax("player"),UnitHealthMax("player")-UnitHealth("player")).."\n".. - format(L["TITAN_REGEN_TOOLTIP2"], UnitMana("player"),UnitPowerMax("player"),UnitPowerMax("player")-UnitMana("player")).."\n".. + format(L["TITAN_REGEN_TOOLTIP2"], UnitPower("player"),UnitPowerMax("player"),UnitPowerMax("player")-UnitPower("player")).."\n".. format(L["TITAN_REGEN_TOOLTIP3"], TITAN_RegenMaxHPRate).."\n".. format(L["TITAN_REGEN_TOOLTIP4"], minHP).."\n".. format(L["TITAN_REGEN_TOOLTIP5"], TITAN_RegenMaxMPRate).."\n".. diff --git a/TitanClassicRegen/TitanClassicRegen.xml b/TitanClassicRegen/TitanClassicRegen.xml index 0501095..6abb1c9 100644 --- a/TitanClassicRegen/TitanClassicRegen.xml +++ b/TitanClassicRegen/TitanClassicRegen.xml @@ -6,11 +6,11 @@ <Button name="TitanPanelRegenButton" inherits="TitanPanelTextTemplate" frameStrata="FULLSCREEN" toplevel="true"> <Scripts> <OnLoad> - TitanPanelTitanRegenButton_OnLoad(self); + TitanPanelRegenButton_OnLoad(self); TitanPanelButton_OnLoad(self); </OnLoad> <OnEvent> - TitanPanelTitanRegenButton_OnEvent(self, event, ...); + TitanPanelRegenButton_OnEvent(self, event, ...); </OnEvent> </Scripts> </Button>