Initial commit.
Initial commit.

--- /dev/null
+++ b/SolaceBuffDisplay.toc
@@ -1,1 +1,12 @@
+## Interface: 70200

+## Title: SolaceBuffDisplay

+## Notes: Configurable buff and debuff display for the default Party Frames, and other options.

+## Version: 7.2.0

+## Author: Hallithron

+## SavedVariablesPerCharacter: SolacePartyBuffs.Options, SolaceTargetFrame.options

+## OptionalDeps: SolaceLib

+## X-Compatible-With: 70200

+

+SolaceLib\SolaceLib.lua

+SolaceBuffDisplay.xml

 

--- /dev/null
+++ b/SolaceBuffDisplay.xml
@@ -1,1 +1,120 @@
-
+<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">

+	<Script file="SolacePartyBuffs.lua" />

+	<Script file="SolacePartyBuffsLocal.lua" />

+	<Script file="SolaceTargetFrame.lua" />

+	<Script file="SolaceTargetFrameLocal.lua" />

+	

+	<Button name="SolacePartyDebuffButtonTemplate" virtual="true">

+		<Size>

+			<AbsDimension x="15" y="15"/>

+		</Size>

+		<Layers>

+			<Layer level="ARTWORK">

+				<Texture name="$parentIcon" setAllPoints="true"/>

+			</Layer>

+			<Layer level="OVERLAY">

+				<Texture name="$parentBorder" file="Interface\Buttons\UI-Debuff-Overlays">

+					<Size>

+						<AbsDimension x="17" y="17"/>

+					</Size>

+					<Anchors>

+						<Anchor point="CENTER">

+							<Offset>

+								<AbsDimension x="0" y="0"/>

+							</Offset>

+						</Anchor>

+					</Anchors>

+					<TexCoords left="0.296875" right="0.5703125" top="0" bottom="0.515625"/>

+				</Texture>

+				<FontString name="$parentCount" inherits="NumberFontNormalSmall">

+					<Anchors>

+						<Anchor point="BOTTOMRIGHT">

+							<Offset>

+								<AbsDimension x="-1" y="0"/>

+							</Offset>

+						</Anchor>

+					</Anchors>

+				</FontString>

+			</Layer>

+		</Layers>

+		<Frames>

+			<Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate" reverse="true" hidden="true">

+				<Anchors>

+					<Anchor point="CENTER">

+						<Offset>

+							<AbsDimension x="0" y="-1"/>

+						</Offset>

+					</Anchor>

+				</Anchors>

+			</Cooldown>

+		</Frames>

+		<Scripts>

+			<OnEnter>

+				GameTooltip:SetOwner(self, "ANCHOR_RIGHT");

+				GameTooltip:SetUnitDebuff("party"..self:GetParent():GetID(), self:GetID());

+			</OnEnter>

+			<OnLeave>

+				GameTooltip:Hide();

+			</OnLeave>

+		</Scripts>

+	</Button>

+   

+	<Button name="SolacePartyBuffButtonTemplate" virtual="true">

+		<Size>

+			<AbsDimension x="15" y="15"/>

+		</Size>

+		<Layers>

+			<Layer level="ARTWORK">

+				<Texture name="$parentIcon" setAllPoints="true"/>

+			</Layer>

+			<Layer level="OVERLAY">

+				<FontString name="$parentCount" inherits="NumberFontNormalSmall">

+					<Anchors>

+						<Anchor point="BOTTOMRIGHT">

+							<Offset>

+								<AbsDimension x="2" y="0"/>

+							</Offset>

+						</Anchor>

+					</Anchors>

+				</FontString>

+			</Layer>

+		</Layers>

+		<Frames>

+			<Cooldown name="$parentCooldown" inherits="CooldownFrameTemplate" reverse="true">

+				<Anchors>

+					<Anchor point="CENTER">

+						<Offset>

+							<AbsDimension x="0" y="-1"/>

+						</Offset>

+					</Anchor>

+				</Anchors>

+			</Cooldown>

+		</Frames>

+		<Scripts>

+			<OnEnter>

+				GameTooltip:SetOwner(self, "ANCHOR_RIGHT");

+				GameTooltip:SetUnitBuff("party"..self:GetParent():GetID(), self:GetID());

+			</OnEnter>

+			<OnLeave>

+				GameTooltip:Hide();

+			</OnLeave>

+		</Scripts>

+	</Button>

+	

+	<Button name="SolacePartyMemberFrameTemplate" hidden="false" virtual="true">

+		<Size>

+			<AbsDimension x="70" y="50"/>

+		</Size>

+		<Anchors>

+			<Anchor point="TOPLEFT">

+				<Offset>

+					<AbsDimension x="48" y="-32"/>

+				</Offset>

+			</Anchor>

+		</Anchors>

+	</Button>

+	<Button name="SolacePartyBuffFrame1" hidden="false" inherits="SolacePartyMemberFrameTemplate" parent="PartyMemberFrame1" id="1"/>

+	<Button name="SolacePartyBuffFrame2" hidden="false" inherits="SolacePartyMemberFrameTemplate" parent="PartyMemberFrame2" id="2"/>

+	<Button name="SolacePartyBuffFrame3" hidden="false" inherits="SolacePartyMemberFrameTemplate" parent="PartyMemberFrame3" id="3"/>

+	<Button name="SolacePartyBuffFrame4" hidden="false" inherits="SolacePartyMemberFrameTemplate" parent="PartyMemberFrame4" id="4"/>

+</Ui>

--- /dev/null
+++ b/SolacePartyBuffs.lua
@@ -1,1 +1,406 @@
+local SPBMJR, SPBVER = "SolacePartyBuffs", "7.2.0"

+

+local SolaceLib = _G["SolaceLib"]

+

+SolacePartyBuffs = CreateFrame("Frame")

+SolacePartyBuffs:RegisterEvent("UNIT_AURA")

+SolacePartyBuffs:RegisterEvent("VARIABLES_LOADED")

+SolacePartyBuffs:RegisterEvent("PARTY_MEMBERS_CHANGED")

+SolacePartyBuffs:RegisterEvent("PLAYER_ENTERING_WORLD")

+SolacePartyBuffs:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")

+SolacePartyBuffs:RegisterEvent("PLAYER_TALENT_UPDATE")

+SolacePartyBuffs.version = SPBVER

+

+SolacePartyBuffs.Options = {

+	["max_party_buffs"] = 32,

+	["max_party_debuffs"] = 40,

+	["filter_castable"] = true

+}

+

+SolacePartyBuffs.CanDispel = {

+	DRUID = {

+		Curse = true,

+		Poison = true

+	},

+	MONK = {

+		Poison = true,

+		Disease = true

+	},

+	PALADIN = {

+		Poison = true,

+		Disease = true

+	},

+	PRIEST = {

+		Disease = true

+	},

+	SHAMAN = {

+		Curse = true

+	}

+}

+

+SolacePartyBuffs.frameref = {

+	["party1"] = "SolacePartyBuffFrame1",

+	["party2"] = "SolacePartyBuffFrame2",

+	["party3"] = "SolacePartyBuffFrame3",

+	["party4"] = "SolacePartyBuffFrame4"

+}

+

+SolacePartyBuffs.blizzframes = {

+	["party1"] = "PartyMemberFrame1",

+	["party2"] = "PartyMemberFrame2",

+	["party3"] = "PartyMemberFrame3",

+	["party4"] = "PartyMemberFrame4"

+}

+

+function SolacePartyBuffs:ErrorMsg(name, index)

+	DEFAULT_CHAT_FRAME:AddMessage("/solace"..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+	DEFAULT_CHAT_FRAME:AddMessage(SPB_CURRENT..SolacePartyBuffs.Options[name])

+end

+

+function SolacePartyBuffs:buffshandler(msg, index)

+	if msg then

+		msg = tonumber(msg)

+		if ( msg > 0 and msg < 33 ) then

+			if ( msg < SolacePartyBuffs.Options.max_party_buffs ) then

+				for j = 1, GetNumPartyMembers() do

+					local frame = "SolacePartyBuffFrame"..j

+					for i = msg, SolacePartyBuffs.Options.max_party_buffs do

+						local button = _G[frame.."Buff"..i]

+						if button then

+							button:Hide()

+						end

+					end

+				end

+			end

+			SolacePartyBuffs.Options.max_party_buffs = msg

+			for i = 1, GetNumPartyMembers() do

+				SolacePartyBuffs:UpdateBuffs("party"..i)

+			end

+			

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_PBUFFS_CHANGED..msg)

+		else

+			SolacePartyBuffs:ErrorMsg("max_party_debuffs", index)

+		end

+	else

+		SolacePartyBuffs:ErrorMsg("max_party_buffs",index)

+	end

+end

+

+function SolacePartyBuffs:debuffshandler(msg, index)

+	if msg then

+		msg = tonumber(msg)

+		if ( msg > 0 and msg < 33 ) then

+			if ( msg < SolacePartyBuffs.Options.max_party_debuffs ) then

+				for j = 1, GetNumPartyMembers() do

+					local frame = "SolacePartyDebuffFrame"..j

+					for i = msg, SolacePartyBuffs.Options.max_party_debuffs do

+						local button = _G[frame.."Debuff"..i]

+						if button then

+							button:Hide()

+						end

+					end

+				end

+			end

+			SolacePartyBuffs.Options.max_party_debuffs = msg

+			for i = 1, GetNumPartyMembers() do

+				SolacePartyBuffs:UpdateBuffs("party"..i)

+			end

+			

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_PDEBUFFS_CHANGED..msg)

+		else

+			SolacePartyBuffs:ErrorMsg("max_party_debuffs", index)

+		end

+	else

+		SolacePartyBuffs:ErrorMsg("max_party_debuffs",index)

+	end

+end

+

+function SolacePartyBuffs:filterhandler(msg, index)

+	if msg then

+		if ( msg == "on" ) then

+			SolacePartyBuffs.Options.filter_castable = true

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_PFILTER_CHANGED..SPB_ENABLED)

+		elseif ( msg == "off" ) then

+			SolacePartyBuffs.Options.filter_castable = false

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_PFILTER_CHANGED..SPB_DISABLED)

+		else

+			DEFAULT_CHAT_FRAME:AddMessage("/solace"..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+			if ( SolacePartyBuffs.Options.filter_castable == true ) then

+				DEFAULT_CHAT_FRAME:AddMessage(SPB_CURRENT..SPB_ENABLED)

+			else

+				DEFAULT_CHAT_FRAME:AddMessage(SPB_CURRENT..SPB_DISABLED)

+			end

+		end

+		for i = 1, GetNumPartyMembers() do

+			SolacePartyBuffs:UpdateBuffs("party"..i)

+		end

+	else

+		DEFAULT_CHAT_FRAME:AddMessage("/solace"..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+		if ( SolacePartyBuffs.Options.filter_castable == true ) then

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_CURRENT..SPB_ENABLED)

+		else

+			DEFAULT_CHAT_FRAME:AddMessage(SPB_CURRENT..SPB_DISABLED)

+		end

+	end

+end

+

+function SolacePartyBuffs:onEvent(event, ...)

+	SolaceTargetFrame:onEvent(event, ...)

+	local arg1 = ...

+	if ( event == "VARIABLES_LOADED" ) then

+		self["commandsInit"] = SolaceLib["commandsInit"]

+		self:commandsInit("maxpartybuffs", SPB_MAXPARTYBUFFS, "buffshandler")

+		self:commandsInit("maxpartydebuffs", SPB_MAXPARTYDEBUFFS, "debuffshandler")

+		self:commandsInit("partyaurafilter", SPB_FILTERDEBUFFS, "filterhandler")

+		DEFAULT_CHAT_FRAME:AddMessage(SPB_LOADED)

+	end

+	if ( event == "UNIT_AURA" ) then

+		for k, v in pairs(SolacePartyBuffs.frameref) do

+			if ( arg1 == k ) then

+				SolacePartyBuffs:UpdateBuffs(arg1)

+				return

+			end

+		end

+	end

+	if ( event == "PARTY_MEMBERS_CHANGED" or event == "PLAYER_ENTERING_WORLD" ) then

+		for i = 1, GetNumPartyMembers() do

+			self:UpdateBuffs("party"..i)

+		end

+	end

+	if ( event == "PLAYER_TALENT_UPDATE" or event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_ENTERING_WORLD" ) then

+		local _, eClass = UnitClass("player")

+		if ( self.CanDispel[eClass] ) then

+			self:TalentDetect(eClass)

+		end

+	end

+end

+

+SolacePartyBuffs:SetScript("OnEvent", SolacePartyBuffs["onEvent"])

+

+function SolacePartyBuffs:UpdateBuffs(unit)

+--~ 	DEFAULT_CHAT_FRAME:AddMessage("UpdateBuffs called for unit "..unit)

+--~ 	Hide the Blizzard debuffs.

+	for i = 1, 4 do

+		_G[self.blizzframes[unit].."Debuff"..i]:Hide()

+	end

+	

+	local frame = self.frameref[unit]

+	local button, buttonname

+	local name, rank, icon, count, duration, expirationTime

+	local buffCount

+	local cooldown, startCooldownTime

+	local filter_castable = nil

+	

+	if SolacePartyBuffs.Options.filter_castable then filter_castable = "PLAYER" end

+	

+	local i = 1

+	while ( i <= SolacePartyBuffs.Options.max_party_buffs ) do

+		name, rank, icon, count, debuffType, duration, expirationTime = UnitBuff(unit, i, filter_castable)

+		buttonname = frame.."Buff"..i

+		button = _G[buttonname]

+		

+		if ( not button ) then

+			if ( not icon ) then

+				break

+			else

+				button = CreateFrame("Button", buttonname, _G[frame], "SolacePartyBuffButtonTemplate")

+			end

+		end

+		

+		if ( icon ) then

+			_G[buttonname.."Icon"]:SetTexture(icon)

+			buffCount = _G[buttonname.."Count"]

+			

+			if (count > 1) then

+				buffCount:SetText(count)

+				buffCount:Show()

+			else

+				buffCount:Hide()

+			end

+			

+			cooldown = _G[buttonname.."Cooldown"]

+			if ( duration ) then

+				if ( duration > 0 ) then

+					cooldown:Show()

+					CooldownFrame_SetTimer(cooldown, expirationTime - duration, duration, 1)

+				else

+					cooldown:Hide()

+				end

+			else

+				cooldown:Hide()

+			end

+			

+			button:SetID(i)

+			

+			button:ClearAllPoints()

+			self:PositionButtons(frame.."Buff", i, frame, "Buff")

+			

+			button:Show()

+		else

+			button:Hide()

+		end

+		i = i + 1

+	end

+	

+	local debuffType, color

+	local debuffCount, debuffBorder

+	local buttonname, button

+	local debuffIdx = 0

+	

+	i = 1

+	while ( i <= SolacePartyBuffs.Options.max_party_debuffs ) do

+		

+		name, rank, icon, count, debuffType, duration, expirationTime, i = SolacePartyBuffs:UnitDebuff(unit, i)

+		

+		debuffIdx = debuffIdx + 1

+		buttonname = frame.."Debuff"..debuffIdx

+		button = _G[buttonname]

+		

+		if ( not button ) then

+			if ( not icon ) then

+				break

+			else

+				button = CreateFrame("Button", buttonname, _G[frame], "SolacePartyDebuffButtonTemplate")

+			end

+		end

+		

+		if ( icon ) then

+			debuffBorder = _G[buttonname.."Border"]

+			

+			_G[buttonname.."Icon"]:SetTexture(icon)

+			debuffCount = _G[buttonname.."Count"]

+			

+			if ( debuffType ) then

+				color = DebuffTypeColor[debuffType]

+			else

+				color = DebuffTypeColor["none"]

+			end

+			

+			if (count > 1) then

+				debuffCount:SetText(count)

+				debuffCount:Show()

+			else

+				debuffCount:Hide()

+			end

+			

+			cooldown = _G[buttonname.."Cooldown"]

+			if ( duration ) then

+				if ( duration > 0 ) then

+					cooldown:Show()

+					CooldownFrame_SetTimer(cooldown, expirationTime - duration, duration, 1)

+				else

+					cooldown:Hide()

+				end

+			else

+				cooldown:Hide()

+			end

+			

+			debuffBorder:SetVertexColor(color.r, color.g, color.b)

+			

+			button:SetID(debuffIdx)

+			

+			button:ClearAllPoints()

+			self:PositionButtons(frame.."Debuff", debuffIdx, frame, "Debuff")

+			

+			button:Show()

+		else

+			button:Hide()

+		end

+		i = i + 1

+	end

+end

+

+function SolacePartyBuffs:PositionButtons(name, index, frame, btype)

+	local button = _G[name..index]

+	local debuffBorder = _G[name..index.."Border"]

+	if ( btype == "Buff" ) then

+		if ( index == 1 ) then

+			button:SetPoint("TOPLEFT", _G[frame], "TOPLEFT", 0, 0)

+		elseif ( index == 17 ) then

+			button:SetPoint("TOPLEFT", _G[name.."3"], "BOTTOM", 0, -2)

+		else

+			button:SetPoint("TOPLEFT", _G[name..(index - 1)], "TOPRIGHT", 2, 0)

+		end

+	else

+		if ( index == 1 ) then

+			debuffBorder:Hide()

+			button:SetPoint("TOPLEFT", _G[frame], "TOPLEFT", 75, 38)

+			debuffBorder:SetPoint("CENTER", button, "CENTER", 0, 0)

+			debuffBorder:Show()

+		else

+			button:SetPoint("TOPLEFT", _G[name..(index - 1)], "TOPRIGHT", 2, 0)

+		end

+	end

+end

+

+function SolacePartyBuffs:UnitDebuff(unit,id)

+if not unit then return end

+	local name, rank, icon, count, debuffType, duration, timeLeft = UnitDebuff(unit,id)

+

+	if self.Options.filter_castable then

+		local _, eClass = UnitClass("player")

+		while ( ( id <= self.Options.max_party_debuffs ) and not ( ( self.CanDispel[eClass] and ( self.CanDispel[eClass][debuffType] == true ) ) or ( eClass == "PRIEST" and aura == "Interface\\Icons\\Spell_Holy_AshesToAshes" ) ) ) do

+			id=id+1

+			name, rank, icon, count, debuffType, duration, timeLeft = UnitDebuff(unit,id)

+		end

+		return name, rank, icon, count or 0, debuffType, duration, timeLeft, id

+	else

+		return name, rank, icon, count or 0, debuffType, duration, timeLeft, id

+	end

+end

+

+function SolacePartyBuffs:TalentDetect(eClass)

+	-- local findTalents = function(tab, searchval)

+	-- 	for i = 1, GetNumTalents(tab, false, false) do

+	-- 		local name, _, _, _, rank, _ = GetTalentInfo(tab, i, false, false, nil)

+	-- 		if ( rank > 0 and name == searchval ) then

+	-- 			return true

+	-- 		end

+	-- 	end

+	-- 	return false

+	-- end

+	local _, _, _, _, _, role, _ = GetSpecializationInfo(GetSpecialization())

+

+	if ( eClass == "DRUID" ) then

+		if ( role == "HEALER" ) then

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = true

+		else

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = false

+		end

+	elseif ( eClass == "MONK" ) then

+		if ( role == "HEALER" ) then

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = true

+		else

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = false

+		end

+	elseif ( eClass == "PALADIN" ) then

+		if ( role == "HEALER" ) then

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = true

+		else

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = false

+		end

+	elseif ( eClass == "PRIEST" ) then

+		if ( role == "HEALER" ) then

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = true

+		else

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = false

+		end

+	elseif ( eClass == "SHAMAN" ) then

+		if ( role == "HEALER" ) then

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = true

+		else

+			SolacePartyBuffs.CanDispel[eClass]["Magic"] = false

+		end

+	end

+end

+

+local oldPartyMemberBuffTooltip_Update = PartyMemberBuffTooltip_Update

+local function newPartyMemberBuffTooltip_Update(self)

+	oldPartyMemberBuffTooltip_Update(self)    

+	if (not string.find(self.unit,"pet")) then

+		PartyMemberBuffTooltip:Hide()

+	end

+end

+PartyMemberBuffTooltip_Update = newPartyMemberBuffTooltip_Update

+

 

--- /dev/null
+++ b/SolacePartyBuffsLocal.lua
@@ -1,1 +1,26 @@
+SPB_MAXPARTYBUFFS = "Sets the number of buffs (0 to 32) displayed beneath members of your party."
+SPB_MAXPARTYDEBUFFS = "Sets the number of debuffs (0 to 40) displayed beside members of your party."
+SPB_FILTERDEBUFFS = "Sets the filtering of buffs and debuffs shown for members of your party by what you can cast/cure (on | off)."
+SPB_CURRENT = "Currently "
+SPB_PBUFFS_CHANGED = "Party buffs shown set to "
+SPB_PDEBUFFS_CHANGED = "Party debuffs shown set to "
+SPB_PFILTER_CHANGED = "Party buff and debuff filtering "
+SPB_ENABLED = "enabled."
+SPB_DISABLED = "disabled."
+SPB_LOADED = "SBD::SolacePartyBuffs-".._G["SolacePartyBuffs"].version.." loaded.  Type /solace for help."
+SPB_NATURES_CURE = "Nature's Cure"
+SPB_IMP_CLEANSE_SPI = "Improved Cleanse Spirit"
+SPB_SACRED_CLEANSING = "Sacred Cleansing"
 
+if ( GetLocale() == "zhTW" ) then
+	SPB_MAXPARTYBUFFS = "設定隊友可顯示的BUFF數量. ( 0-32 )."
+	SPB_MAXPARTYDEBUFFS = "設定隊友可顯示的DEBUFF數量. ( 0-40 )."
+	SPB_FILTERDEBUFFS = "設定是否過濾隊友的BUFF/DEBUFF (on | off)."
+	SPB_CURRENT = "目前 "
+	SPB_PBUFFS_CHANGED = "隊友可顯示的BUFF數量設定為 "
+	SPB_PDEBUFFS_CHANGED = "隊友可顯示的DEBUFF數量設定為 "
+	SPB_PFILTER_CHANGED = "隊友的BUFF/DEBUFF過濾 "
+	SPB_ENABLED = "啟用."
+	SPB_DISABLED = "關閉."
+	SPB_LOADED = "SBD::SolacePartyBuffs-"..SPB_VER.." 已載入.  輸入 /solace 顯示說明."
+end

--- /dev/null
+++ b/SolaceTargetFrame.lua
@@ -1,1 +1,86 @@
+local STFMJR, STFVER = "SolaceTargetFrame", "4.0.1"

+local SolaceTargetFrame = _G[STFMJR] or { version = STFVER }

+_G[STFMJR] = SolaceTargetFrame

+

+SolaceTargetFrame.options = {

+	["maxbuffs"] = 32,

+	["maxdebuffs"] = 40,

+	["showownbig"] = "off"

+}

+

+function SolaceTargetFrame:onEvent(event, ...)

+	if ( ( event == "VARIABLES_LOADED" ) ) then

+		self["commandsInit"] = SolaceLib["commandsInit"]

+		self:commandsInit("showbuffs",SOLACE_SHOWBUFFS_HELP,"showbuffsHandler")

+		self:commandsInit("showdebuffs",SOLACE_SHOWDEBUFFS_HELP,"showdebuffsHandler")

+		self:commandsInit("showownbig",SOLACE_SHOWOWN_HELP,"showownHandler")

+		

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACETARGETFRAME_WELCOME)

+		

+		self:showownHandler(SolaceTargetFrame.options.showownbig,SolaceLib:getCmdindex("showownbig"))

+		self:showbuffsHandler(SolaceTargetFrame.options.maxbuffs,SolaceLib:getCmdindex("showbuffs"))

+		self:showdebuffsHandler(SolaceTargetFrame.options.maxdebuffs,SolaceLib:getCmdindex("showdebuffs"))

+	end

+end

+

+function SolaceTargetFrame:showbuffsHandler(msg,index)

+	if msg then

+		msg = tonumber(msg)

+		if ( SolaceTargetFrame.options.maxbuffs > msg ) then

+			local button

+			for i = msg+1, SolaceTargetFrame.options.maxbuffs do

+				button = _G["TargetFrameBuff"..i]

+				if ( button ) then

+					button:Hide()

+				end

+			end

+		end

+		MAX_TARGET_BUFFS = msg

+		SolaceTargetFrame.options.maxbuffs = msg

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWBUFFS..MAX_TARGET_BUFFS)

+		TargetFrame_UpdateAuras(_G["TargetFrame"])

+	else

+		DEFAULT_CHAT_FRAME:AddMessage("/solace "..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWBUFFS..MAX_TARGET_BUFFS)

+	end

+end

+

+function SolaceTargetFrame:showdebuffsHandler(msg,index)

+	if msg then

+		msg = tonumber(msg)

+		if ( SolaceTargetFrame.options.maxdebuffs > msg ) then

+			local button

+			for i = msg+1, SolaceTargetFrame.options.maxdebuffs do

+				button = _G["TargetFrameDebuff"..i]

+				if ( button ) then

+					button:Hide()

+				end

+			end

+		end

+		MAX_TARGET_DEBUFFS = msg

+		SolaceTargetFrame.options.maxdebuffs = msg

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWDEBUFFS..MAX_TARGET_DEBUFFS)

+		TargetFrame_UpdateAuras(_G["TargetFrame"])

+	else

+		DEFAULT_CHAT_FRAME:AddMessage("/solace "..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWDEBUFFS..MAX_TARGET_DEBUFFS)

+	end

+end

+

+function SolaceTargetFrame:showownHandler(msg,index)

+	if ( msg == "on" ) then

+		LARGE_BUFF_SIZE = 21

+		LARGE_BUFF_FRAME_SIZE = 23

+		SolaceTargetFrame.options.showownbig = msg

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWOWNON)

+	elseif ( msg == "off" ) then

+		LARGE_BUFF_SIZE = 17

+		LARGE_BUFF_FRAME_SIZE = 19

+		SolaceTargetFrame.options.showownbig = msg

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWOWNOFF)

+	else

+		DEFAULT_CHAT_FRAME:AddMessage("/solace "..SolaceLib.commands[index].cmd..": "..SolaceLib.commands[index].desc)

+		DEFAULT_CHAT_FRAME:AddMessage(SOLACE_SHOWOWNCURRENT..SolaceTargetFrame.options.showownbig)

+	end

+end

 

--- /dev/null
+++ b/SolaceTargetFrameLocal.lua
@@ -1,1 +1,33 @@
-
+SOLACE_SHOWBUFFS_HELP="Sets the number of buffs to show on your target.  Valid numbers are 0-32.";

+SOLACE_SHOWBUFFS="Visible buffs now set to ";

+SOLACE_SHOWDEBUFFS_HELP="Sets the number of debuffs to show on your target.  Valid numbers are 0-40.";

+SOLACE_SHOWDEBUFFS="Visible debuffs now set to ";

+SOLACE_SHOWOWNON="Player-cast buffs and debuffs are shown bigger than those cast by others."

+SOLACE_SHOWOWNOFF="Player-cast buffs and debuffs are shown the same size as those cast by others."

+SOLACE_SHOWOWN_HELP="Toggles whether player-cast buffs are shown bigger than those cast by others. ( on | off)";

+SOLACE_NUMROW="Number of buffs or debuffs in a full row set to ";

+SOLACE_NUMROW_HELP="Sets the number of buffs or debuffs should appear in a full row.  Valid numbers are 1-32."

+SOLACE_SHOWOWNCURRENT="Currently ";

+SOLACETARGETFRAME_WELCOME="SBD::SolaceTargetFrame-".._G["SolaceTargetFrame"].version.." loaded.  Type /solace for help.";

+

+if ( GetLocale() == "zhTW" ) then

+	SOLACE_SHOWBUFFS_HELP="設定目標可顯示的BUFF數量. ( 0-32 )";

+	SOLACE_SHOWBUFFS="可顯示的BUFF數量設定為 ";

+	SOLACE_SHOWDEBUFFS_HELP="設定目標可顯示的DEBUFF數量. ( 0-40 )";

+	SOLACE_SHOWDEBUFFS="可顯示的DEBUFF數量設定為 ";

+	SOLACE_SHOWOWNON="放大自己施放的BUFF/DEBUFF圖示."

+	SOLACE_SHOWOWNOFF="不放大自己施放的BUFF/DEBUFF圖示."

+	SOLACE_SHOWOWN_HELP="設定是否放大顯示自己施放的BUFF/DEBUFF. ( on | off)";

+	SOLACE_NUMROW="設定可顯示BUFF/DEBUFF的數量為 ";

+	SOLACE_NUMROW_HELP="設定可顯示的BUFF/DEBUFF數量.  ( 1-32 )"

+	SOLACE_SHOWOWNCURRENT="目前 ";

+	SOLACETARGETFRAME_WELCOME="SBD::SolaceTargetFrame 已載入.  輸入 /solace 顯示說明.";

+end

+

+if ( GetLocale() == "frFR" ) then

+	--Please add localizations for the variables above if you speak French!

+elseif ( GetLocale() == "deDE" ) then

+	--Please add localizations for the variables above if you speak German!

+elseif ( GetLocale() == "esES" ) then

+	--Please add localizations for the variables above if you speak Spanish!

+end