WoWInterface SVN BrokerFactions

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 53 to Rev 54
    Reverse comparison

Rev 53 → Rev 54

trunk/Broker_Factions/Broker_Factions.lua
4,7 → 4,7
 
-- Embeds & stuff, create DO etc...
local BRFaction = CreateFrame("Frame", "Broker_Factions")
local tooltip = LibStub("LibQTipClick-1.1")
local tooltip = LibStub("LibQTip-1.0")
local L = LibStub("AceLocale-3.0"):GetLocale("Broker_Factions", true)
BRFaction.obj = LibStub:GetLibrary("LibDataBroker-1.1"):NewDataObject("Broker_Factions", {type = "data source", label = "Broker Factions", icon = "Interface\\Icons\\INV_Misc_TabardPVP_03", text = "|cffffff9a"..L["No Faction"].."|r"})
LibStub("AceTimer-3.0"):Embed(BRFaction)
418,7 → 418,7
end
end
 
function BRFaction:ClickHandlerFunc(event, cell, arg1, button)
local function ClickHandlerFunc(cell, arg1, button)
-- Obligatory sanity checks
if not arg1 or type(arg1)~= "table" then return end
if not arg1[1] or not arg1[2] or not arg1[3] or not arg1[4] or not arg1[5] then return end
431,7 → 431,7
-- Handlers
if button == "LeftButton" and (Header == 0 or (Header == 1 and Rep == 1)) and not IsControlKeyDown() and not IsShiftKeyDown() then
Broker_FactionsConfig.MonitoredFaction = FactionName
self:Update()
BRFaction:Update()
elseif button == "LeftButton" and (Header == 0 or (Header == 1 and Rep == 1)) and not Broker_FactionsConfig.UseBlizzMonitor and IsControlKeyDown() then
-- toggle Blizzard watched faction according to our watched faction
local watched = GetWatchedFactionInfo()
443,8 → 443,7
elseif button == "LeftButton" and (Header == 0 or (Header == 1 and Rep == 1)) and IsShiftKeyDown() then
if ChatFrameEditBox:IsVisible() then
-- construct proper faction label from name
local factionlabel = nil
factionlabel = self:CreateFactionLabel(IndexID)
local factionlabel = BRFaction:CreateFactionLabel(IndexID)
if not factionlabel then return end -- safeguard: something went horribly wrong and the faction label was never created
-- remove color codes *sigh*
local tmpstr, line, normalized
470,7 → 469,7
ExpandFactionHeader(IndexID)
end
tt:Clear()
self:Drawtooltip()
BRFaction:Drawtooltip()
end
end
 
679,10 → 678,10
 
-- Draw tooltip
local colcount = tt:GetColumnCount()
local templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, _G["HIGHLIGHT_FONT_COLOR_CODE"].."Broker Factions", nil, "CENTER", colcount)
tt:AddNormalLine(" ")
tt:AddNormalHeader(unpack(headers,1,colcount))
local templine = tt:AddLine("")
tt:SetCell(templine, 1, _G["HIGHLIGHT_FONT_COLOR_CODE"].."Broker Factions", nil, "CENTER", colcount)
tt:AddLine(" ")
tt:AddHeader(unpack(headers,1,colcount))
 
-- Iterate through faction index
for i = 1, num do
712,7 → 711,7
else
display[colnum] = "|cffffffff"..name.."|r"
end
tt:AddNormalLine(" ")
tt:AddLine(" ")
end
 
-- insert empty column so that the actual 2nd column isn't too near faction names
760,7 → 759,7
display[colnum] = _G["NORMAL_FONT_COLOR_CODE"].." "..string.format("%s", barMax - barValue)
end
 
templine = tt:AddLine()
templine = tt:AddLine(unpack(display, 1, colcount))
-- Construct the return table here
-- Structure: returnarg = { <Faction Name>, <isHeader>, <hasRep>, <isCollapsed>, <IndexID>}
-- Faction Name : string, eg "Kirin Tor"
774,20 → 773,15
if hasRep then returnarg[3] = 1 else returnarg[3] = 0 end
if isCollapsed then returnarg[4] = 1 else returnarg[4] = 0 end
returnarg[5] = i
tt:SetCell(templine, 1, display[1], returnarg)
if colcount > 1 then
for j = 2, colcount do
tt:SetNormalCell(templine, j, display[j])
end
end
tt:SetCellScript(templine, 1, "OnMouseDown", ClickHandlerFunc , returnarg)
nonheaderset = true
end
else
-- We have a header folks !
if not isCollapsed then
tt:AddNormalLine(" ")
tt:AddLine(" ")
HeaderLine = "|cffffffff"..name.."|r"
templine = tt:AddLine()
templine = tt:AddLine(HeaderLine)
-- Construct the return table here
returnarg = {}
returnarg[1] = name
795,15 → 789,15
if hasRep then returnarg[3] = 1 else returnarg[3] = 0 end
if isCollapsed then returnarg[4] = 1 else returnarg[4] = 0 end
returnarg[5] = i
tt:SetCell(templine, 1, HeaderLine, returnarg)
tt:SetCellScript(templine, 1, "OnMouseDown", ClickHandlerFunc , returnarg)
elseif isCollapsed and Broker_FactionsConfig.ShowCollapsedHeadersTip then
tt:AddNormalLine(" ")
tt:AddLine(" ")
if Broker_FactionsConfig.ShowCollapsedSuffixTip then
HeaderLine = "|cffffffff"..name.."|r".." ".._G["RED_FONT_COLOR_CODE"].."(+)".."|r"
else
HeaderLine = "|cffffffff"..name.."|r"
end
templine = tt:AddLine()
templine = tt:AddLine(HeaderLine)
-- Construct the return table here
returnarg = {}
returnarg[1] = name
811,31 → 805,31
if hasRep then returnarg[3] = 1 else returnarg[3] = 0 end
if isCollapsed then returnarg[4] = 1 else returnarg[4] = 0 end
returnarg[5] = i
tt:SetCell(templine, 1, HeaderLine, returnarg)
tt:SetCellScript(templine, 1, "OnMouseDown", ClickHandlerFunc , returnarg)
end
end
end
-- Tooltip Hint
if not Broker_FactionsConfig.HideHintTip then
tt:AddNormalLine(" ")
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on plugin to open Blizzard's Reputation tab."], nil, "LEFT", colcount)
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on faction name to watch on the button/block."], nil, "LEFT", colcount)
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on plugin to open Configuration Menu."], nil, "LEFT", colcount)
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on faction header to expand or collapse it."], nil, "LEFT", colcount)
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fShift+Left Click|r |cff19ff19to paste Reputation info into chat."], nil, "LEFT", colcount)
templine = tt:AddNormalLine("")
tt:SetNormalCell(templine, 1, L["|cffeda55fCtrl+Left Click|r |cff19ff19to toggle Reputation bar watch."], nil, "LEFT", colcount)
tt:AddLine(" ")
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on plugin to open Blizzard's Reputation tab."], nil, "LEFT", colcount)
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fLeft Click|r |cff19ff19on faction name to watch on the button/block."], nil, "LEFT", colcount)
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on plugin to open Configuration Menu."], nil, "LEFT", colcount)
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fRight Click|r |cff19ff19on faction header to expand or collapse it."], nil, "LEFT", colcount)
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fShift+Left Click|r |cff19ff19to paste Reputation info into chat."], nil, "LEFT", colcount)
templine = tt:AddLine("")
tt:SetCell(templine, 1, L["|cffeda55fCtrl+Left Click|r |cff19ff19to toggle Reputation bar watch."], nil, "LEFT", colcount)
end
 
if not nonheaderset then
-- hide column header titles since we have no real faction data
for i=1, colcount do
tt:SetNormalCell(3, i, "")
tt:SetCell(3, i, "")
end
end
 
899,9 → 893,8
tt:SmartAnchorTo(self)
tt:Clear()
tt:SetScale(Broker_FactionsConfig.ToolTipScale or 1)
tt.SetCallback(BRFaction, "OnMouseDown", "ClickHandlerFunc")
BRFaction:Drawtooltip()
tt:SetBackdropBorderColor(1, 1, 1, 1)
BRFaction:Drawtooltip()
tt:Show()
end
 
trunk/Broker_Factions/Broker_Factions.toc
2,9 → 2,9
## Title: Broker [Factions]
## Author: Tristanian
## Notes: Minimalistic LDB plugin that allows faction reputation monitoring.
## OptionalDeps: Ace3, LibQTip-1.0, LibQTipClick-1.1
## OptionalDeps: Ace3, LibQTip-1.0
## SavedVariablesPerCharacter: Broker_FactionsConfig
## X-Embeds: Ace3, LibQTip-1.0, LibQTipClick-1.1
## X-Embeds: Ace3, LibQTip-1.0
## X-Category: Miscellaneous
## Version: 3.1
## X-WoWI-ID: 11020
trunk/Broker_Factions/embeds.xml
9,5 → 9,4
<Include file="libs\AceHook-3.0\AceHook-3.0.xml"/>
<Include file="libs\AceTimer-3.0\AceTimer-3.0.xml"/>
<Script file="libs\LibQTip-1.0\LibQTip-1.0.lua"/>
<Script file="libs\LibQTipClick-1.1\LibQTipClick-1.1.lua"/>
</Ui>
\ No newline at end of file