From f7fccc38fa70b0e54b9fa4e74e72d0c824d37e7c Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 2 Dec 2016 20:06:00 +0100 Subject: [PATCH] nameplates: add option to show spellname --- modules/config.lua | 1 + modules/gui.lua | 1 + modules/nameplates.lua | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/modules/config.lua b/modules/config.lua index 5d251670..06c1a92a 100644 --- a/modules/config.lua +++ b/modules/config.lua @@ -90,6 +90,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("chat", "global", "bgcolor", ".2,.2,.2") pfUI:UpdateConfig("chat", "global", "bgtransp", ".5") pfUI:UpdateConfig("nameplates", nil, "showcastbar", "1") + pfUI:UpdateConfig("nameplates", nil, "spellname", "0") pfUI:UpdateConfig("nameplates", nil, "showdebuffs", "0") pfUI:UpdateConfig("nameplates", nil, "clickthrough", "0") pfUI:UpdateConfig("nameplates", nil, "raidiconsize", "16") diff --git a/modules/gui.lua b/modules/gui.lua index 24b63e60..60b2f557 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -725,6 +725,7 @@ pfUI:RegisterModule("gui", function () -- nameplates pfUI.gui.nameplates = pfUI.gui:CreateConfigTab("Nameplates") pfUI.gui:CreateConfig(pfUI.gui.nameplates, "Show castbars:", pfUI_config.nameplates, "showcastbar", "checkbox") + pfUI.gui:CreateConfig(pfUI.gui.nameplates, "Show spellname:", pfUI_config.nameplates, "spellname", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.nameplates, "Show debuffs:", pfUI_config.nameplates, "showdebuffs", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.nameplates, "Enable Clickthrough:", pfUI_config.nameplates, "clickthrough", "checkbox") pfUI.gui:CreateConfig(pfUI.gui.nameplates, "Raidicon size:", pfUI_config.nameplates, "raidiconsize") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 2df3f92a..50126e30 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -224,6 +224,15 @@ pfUI:RegisterModule("nameplates", function () healthbar.castbar.text:SetFont(STANDARD_TEXT_FONT, 10, "OUTLINE") end + if healthbar.castbar.spell == nil then + healthbar.castbar.spell = healthbar.castbar:CreateFontString("Status", "DIALOG", "GameFontNormal") + healthbar.castbar.spell:SetPoint("CENTER", healthbar.castbar, "CENTER") + healthbar.castbar.spell:SetNonSpaceWrap(false) + healthbar.castbar.spell:SetFontObject(GameFontWhite) + healthbar.castbar.spell:SetTextColor(1,1,1,1) + healthbar.castbar.text:SetFont(STANDARD_TEXT_FONT, 10, "OUTLINE") + end + if healthbar.castbar.icon == nil then healthbar.castbar.icon = healthbar.castbar:CreateTexture(nil, "BORDER") healthbar.castbar.icon:ClearAllPoints() @@ -249,6 +258,13 @@ pfUI:RegisterModule("nameplates", function () healthbar.castbar:SetMinMaxValues(0, pfUI.castbar.target.casterDB[name:GetText()]["casttime"]) healthbar.castbar:SetValue(GetTime() - pfUI.castbar.target.casterDB[name:GetText()]["starttime"]) healthbar.castbar.text:SetText(round( pfUI.castbar.target.casterDB[name:GetText()]["starttime"] + pfUI.castbar.target.casterDB[name:GetText()]["casttime"] - GetTime(),1)) + if healthbar.castbar.spell then + if pfUI_config.nameplates.spellname == "1" then + healthbar.castbar.spell:SetText(pfUI.castbar.target.casterDB[name:GetText()]["cast"]) + else + healthbar.castbar.spell:SetText("") + end + end healthbar.castbar:Show() if pfUI.castbar.target.casterDB[name:GetText()]["icon"] then