Log:
RaidAgent:
- Added the file for the Special column, only warrior atm
Added:
trunk/RaidAgent/common/Census.lua
Modified:
trunk/RaidAgent/RaidAgent.lua
trunk/RaidAgent/RaidAgent.toc
trunk/RaidAgent/common/Console.lua
trunk/RaidAgent/common/FuBarHandling.lua
trunk/RaidAgent/common/Localization.lua
trunk/RaidAgent/common/Toolbox.lua
Modified: trunk/RaidAgent/RaidAgent.lua
==============================================================================
--- trunk/RaidAgent/RaidAgent.lua (original)
+++ trunk/RaidAgent/RaidAgent.lua Sun Dec 24 22:37:00 2006
@@ -7,7 +7,8 @@
RaidAgent.tConsole = true
RaidAgent.tFubar = true
-RaidAgent.tTitleIcon = "Interface\\Icons\\Spell_Holy_SummonLightwell"
+--RaidAgent.tTitleIcon = "Interface\\Icons\\Spell_Holy_SummonLightwell"
+RaidAgent.tTitleIcon = "Interface\\Icons\\Spell_Shadow_UnstableAffliction_3"
RaidAgent.tAddFuToTitle = false
RaidAgent.tAuthorInDD = true
RaidAgent.tVersionInDD = true
@@ -18,12 +19,31 @@
_, _, self.revision = string.find("$Revision: 7 $", "([0-9]+)")
_, _, self.majorVersion, self.minorVersion, self.revisionVersion = string.find(self.version, "(%d+)%.(%d+)%.(%d+)")
- --[[ Register chat commands ]]
+ --[[ Register chat commands ]]
self.options = self:BuildOptions()
if (self.tConsole) then self:RegisterChatCommand(L["consolecommands"], self.options) end
--[[ Tell user we have loaded ]]
self:Print((string.gsub(string.gsub(string.gsub(L["load_message"], "{FancyName}", self:FancyName()), "{Version}", self.version), "{Translator}", L["translator"])))
+
+ self:CheckOnInit()
+end
+
+function RaidAgent:CheckOnInit()
+ self.raidRank = 0
+ if (self:PlayerInRaid()) then
+ for raidIndex=1, GetNumRaidMembers() do
+ local name, rank = GetRaidRosterInfo(raidIndex)
+ if (name == UnitName("player")) then
+ self.raidRank = rank
+ self:Print("Logged into a raid with rank: "..self.RaidRankStrings[rank])
+ break
+ end
+ end
+ end
+
+ if (not self.census) then self.census = { } end
+ if (self.censusActive) then self:Ping() end
end
function RaidAgent:OnEnable()
@@ -34,6 +54,10 @@
self:RegisterEvent("RAID_ROSTER_UPDATE")
self:RegisterEvent("PARTY_LOOT_METHOD_CHANGED")
self:RegisterEvent("CHAT_MSG_SYSTEM")
+ self:RegisterEvent("CHAT_MSG_ADDON")
+ self:RegisterEvent("LEARNED_SPELL_IN_TAB")
+
+ if (self.censusActive) then self:ScheduleEvent("ping", self.Ping, 300, self) end
end
function RaidAgent:OnDisable()
@@ -54,6 +78,18 @@
function RaidAgent:RAID_ROSTER_UPDATE()
self.FuBar:Update()
+ --[[ Find out my rank ]]
+ local newRank = -1
+ for raidIndex=1, GetNumRaidMembers() do
+ local name, rank = GetRaidRosterInfo(raidIndex)
+ if (name == UnitName("player")) then
+ if (rank ~= self.raidRank) then
+ self:Print("New rank in raid: "..self.RaidRankStrings[rank])
+ self.raidRank = rank
+ end
+ break
+ end
+ end
end
function RaidAgent:PARTY_LOOT_METHOD_CHANGED()
@@ -73,9 +109,28 @@
self.knowledgeBase = { } -- Clear knowledge base
self.FuBar:Update()
end
+
+ if (arg1 == ERR_RAID_YOU_JOINED) then
+ if (self.censusActive) then self:ScheduleEvent("ping", self.Ping, 300, self) end
+ end
+end
+
+function RaidAgent:CHAT_MSG_ADDON(prefix, message, distributionType, sender)
+ if (arg1 == "RaidAgent") then
+ -- self:Print(message)
+ self.census[sender] = message
+ self:UpdateCensusInfo(message)
+ end
+end
+
+function RaidAgent:LEARNED_SPELL_IN_TAB()
+ if (self.censusActive) then self:UpdateOwnCensusData() end
+ if (self.censusActive) then self:Ping() end
end
--[[ FUNCTIONS ]]
function RaidAgent:ExampleFunction()
self:Print("An Example")
-end
\ No newline at end of file
+end
+
+-- SendAddonMessage("prefix", "text", "PARTY|RAID|GUILD|BATTLEGROUND")
\ No newline at end of file
Modified: trunk/RaidAgent/RaidAgent.toc
==============================================================================
--- trunk/RaidAgent/RaidAgent.toc (original)
+++ trunk/RaidAgent/RaidAgent.toc Sun Dec 24 22:37:00 2006
@@ -33,9 +33,9 @@
common\Localization.lua
RaidAgent.lua
+common\Census.lua
common\Toolbox.lua
common\Console.lua
common\FuBarShell.lua
common\FuBarHandling.lua
-common\RaidStrength.lua
-common\PlayerKnowledgeBase.lua
\ No newline at end of file
+common\RaidStrength.lua
\ No newline at end of file
Added: trunk/RaidAgent/common/Census.lua
==============================================================================
--- (empty file)
+++ trunk/RaidAgent/common/Census.lua Sun Dec 24 22:37:00 2006
@@ -0,0 +1,156 @@
+--[[ WORK IN PROGRESS, PLEASE DO NOT ALTER FILES YET ]]
+local self = RaidAgent
+local L = AceLibrary("AceLocale-2.2"):new("RaidAgent")
+self.censusActive = true
+
+function RaidAgent:Ping()
+ if (not self.censusData) then self:UpdateOwnCensusData() end
+ SendAddonMessage("RaidAgent", self.censusData, "RAID")
+ --SendAddonMessage("prefix", "text", "PARTY|RAID|GUILD|BATTLEGROUND")
+end
+
+function RaidAgent:UpdateOwnCensusData()
+ local localizedClass, englishClass = UnitClass("player")
+ self.censusData = englishClass..";"..self:CreateCensusString(englishClass)
+end
+
+function RaidAgent:CreateCensusString(theClass)
+ local rVal = ""
+ if (theClass == "WARRIOR") then
+ rVal = rVal..self:CensusGetTalentInfo(3, 13, "WR_ISW")..":" -- First value for warrior is Shield Wall
+ rVal = rVal..self:CensusGetTalentInfo(3, 6, "WR_LaS")..":" -- Second value for warrior is Last Stand
+ rVal = rVal..self:CensusGetTalentInfo(3, 9, "WR_Def")..":" -- Third value for warrior is Defiance (3)
+ rVal = rVal..self:CensusGetTalentInfo(3, 18, "WR_IDS")..":" -- Fourth value for warrior is Improved Defensive Stance (3)
+ rVal = rVal..self:CensusGetTalentInfo(3, 21, "WR_Vit")..":" -- Fifth value for warrior is Vitality (5)
+ end
+ return self:CensusTrim(rVal)
+end
+
+function RaidAgent:UpdateCensusInfo(censusInfo)
+ local censusData, censusClass = RaidAgent:ReadCensusString(censusInfo)
+
+ -- Empty Census Options
+ if (not self.db.profile.censusOptions) then self.db.profile.censusOptions = { } end
+
+ if (not self.db.profile.censusOptions[censusClass]) then
+ -- New Class for Census Options \o/
+ self.db.profile.censusOptions[censusClass] = { }
+ local locClass = censusClass
+ if (L:HasTranslation(censusClass)) then locClass = L[censusClass] end
+ self:Print("Learned new class: "..locClass)
+ self.options = self:BuildOptions()
+ self.FuBar.OnMenuRequest = self:BuildOptions()
+ if (self.tConsole) then self:RegisterChatCommand(L["consolecommands"], self.options) end
+ end
+
+ for talentKey, talentTable in pairs(censusData) do
+ if (not self.db.profile.censusOptions[censusClass][talentKey]) then
+ -- New talent \o/
+ if (L:HasTranslation(talentKey)) then
+ self.db.profile.censusOptions[censusClass][talentKey] = L[talentKey]
+ self:Print("Learned a new talent: "..L[talentKey])
+ self.options = self:BuildOptions()
+ self.FuBar.OnMenuRequest = self:BuildOptions()
+ if (self.tConsole) then self:RegisterChatCommand(L["consolecommands"], self.options) end
+ else
+ self:Print("No translation for talent with ID: "..talentKey.." (Are you running latest version)")
+ end
+ end
+ end
+end
+
+function RaidAgent:ReadCensusString(censusInfo)
+ local rVal = { }
+ local classValues = self:CensusSplit(censusInfo, "%;")
+ local englishClass = classValues[1]
+ for _, RawTalents in ipairs(self:CensusSplit(classValues[2], "%:")) do
+ local talentValues = self:CensusSplit(RawTalents, "%.")
+
+ if (L:HasTranslation(talentValues[1])) then
+ rVal[talentValues[1]] = { }
+ rVal[talentValues[1]]["raw"] = RawTalents
+ rVal[talentValues[1]]["rank"] = tonumber(talentValues[2])
+ rVal[talentValues[1]]["maxRank"] = tonumber(talentValues[3])
+ rVal[talentValues[1]]["isMaxed"] = (talentValues[2] == talentValues[3])
+ end
+ end
+ return rVal, englishClass
+end
+
+function RaidAgent:CensusGetTalentInfo(tabIndex, talentIndex, talentKey)
+ local isMaxed = "false"
+ local nameTalent, _, _, _, currentRank, maxRank, _, _ = GetTalentInfo(tabIndex, talentIndex)
+ if (currentRank == maxRank) then isMaxed = "true" end
+ return talentKey.."."..currentRank.."."..maxRank
+end
+
+function RaidAgent:CensusSplit(text, delimiter)
+ local list = {}
+ local pos = 1
+
+ if strfind("", delimiter, 1) then -- this would result in endless loops
+ error("delimiter matches empty string!")
+ end
+ while 1 do
+ local first, last = strfind(text, delimiter, pos)
+ if first then -- found?
+ tinsert(list, strsub(text, pos, first-1))
+ pos = last+1
+ else
+ tinsert(list, strsub(text, pos))
+ break
+ end
+ end
+ return list
+end
+
+function RaidAgent:CensusTalentStatus(text)
+
+end
+
+function RaidAgent:CensusTrim(s)
+ local l = 1
+ while strsub(s,l,l) == ":" do
+ l = l+1
+ end
+ local r = strlen(s)
+ while strsub(s,r,r) == ":" do
+ r = r-1
+ end
+ return strsub(s,l,r)
+end
+
+function RaidAgent:GetCensusStringForClass(censusData, censusClass)
+ if (not self:HaveClass(censusClass)) then return "Class not in census" end
+ if (not L:HasTranslation(self:ShowForClass(censusClass))) then return "Spellkey not found" end
+
+ if (censusData[self:ShowForClass(censusClass)].maxRank == 1) then
+ -- Talent buys a skill (Shield Wall for example)
+ if (censusData[self:ShowForClass(censusClass)].rank == censusData[self:ShowForClass(censusClass)].maxRank) then
+ return L[self:ShowForClass(censusClass)]
+ else
+ return "NO ("..L[self:ShowForClass(censusClass)]..")"
+ end
+ else
+ return L[self:ShowForClass(censusClass)].." "..censusData[self:ShowForClass(censusClass)].rank.."/"..censusData[self:ShowForClass(censusClass)].maxRank
+ end
+
+ specialString = tostring(censusData[self:ShowForClass(censusClass)].isMaxed)
+end
+
+function RaidAgent:HaveClass(englishClass)
+ if (not self.db.profile.censusShow) then self.db.profile.censusShow = { } end
+ return self.db.profile.censusShow[englishClass]
+end
+
+function RaidAgent:ShowForClass(englishClass)
+ if (not self.db.profile.censusShow) then self.db.profile.censusShow = { } end
+ if (not self.db.profile.censusShow[englishClass]) then self.db.profile.censusShow[englishClass] = "" end
+ return self.db.profile.censusShow[englishClass]
+end
+
+function RaidAgent:SetShowForClass(englishClass, value)
+ if (not self.db.profile.censusShow) then self.db.profile.censusShow = { } end
+ if (not self.db.profile.censusShow[englishClass]) then self.db.profile.censusShow[englishClass] = "" end
+ self.db.profile.censusShow[englishClass] = value
+end
\ No newline at end of file
Modified: trunk/RaidAgent/common/Console.lua
==============================================================================
--- trunk/RaidAgent/common/Console.lua (original)
+++ trunk/RaidAgent/common/Console.lua Sun Dec 24 22:37:00 2006
@@ -26,9 +26,6 @@
headerAuthor = {
type = "header",
name = self:HexColor("e6cc80", L["Author: $"]..self.author),
- textR = 1,
- textG = 1,
- textB = 1,
order = 2,
},
headerVersion = {
@@ -46,10 +43,45 @@
desc = L["RaidStrength_desc"],
get = function() return self.db.profile.RaidStrength end,
set = function() self.db.profile.RaidStrength = not self.db.profile.RaidStrength end,
- order = 5
- }
+ order = 5,
+ },
+ raidstrengthspacer = {
+ type = "header",
+ order = 6,
+ },
+ display = {
+ type = "group",
+ name = L["display_name"],
+ desc = L["display_desc"],
+ args = {
+ },
+ order = 7,
+ },
},
}
+
+ if (not self.db.profile.censusOptions) then self.db.profile.censusOptions = { } end
+ for englishClass, classTable in pairs(self.db.profile.censusOptions) do
+ displayClass = englishClass
+ if (L:HasTranslation(englishClass)) then displayClass = L[englishClass] end
+ rVal.args.display.args[englishClass] = {
+ type = "text",
+ name = displayClass,
+ desc = displayClass,
+ get = function() return self:ShowForClass(englishClass) end,
+ set = function(arg1) self:SetShowForClass(englishClass, arg1) end,
+ }
+
+ local haveData = false
+ for talentKey, talentName in pairs(classTable) do
+ rVal.args.display.args[englishClass].validate = classTable
+ haveData = true
+ end
+
+ if (not haveData) then
+ rVal.args.display.args[englishClass] = nil
+ end
+ end
if (not self.tAuthorInDD) then rVal.args.headerAuthor = nil end
if (not self.tVersionInDD) then rVal.args.headerVersion = nil end
Modified: trunk/RaidAgent/common/FuBarHandling.lua
==============================================================================
--- trunk/RaidAgent/common/FuBarHandling.lua (original)
+++ trunk/RaidAgent/common/FuBarHandling.lua Sun Dec 24 22:37:00 2006
@@ -4,6 +4,7 @@
local L = AceLibrary("AceLocale-2.2"):new("RaidAgent")
local Tablet = AceLibrary("Tablet-2.0")
+local TabletCat = nil
local PC = AceLibrary("PaintChips-2.0")
function RaidAgent:FuOnInitialize(...)
@@ -47,60 +48,26 @@
self.FuBar:SetText(fuText)
end
-
function RaidAgent:FuOnTooltipUpdate(...)
Tablet:SetTitle(self:FuName())
Tablet:SetTitleColor(163/255, 53/255, 238/255) -- Epic for the right feeling
- local _, textR, textG, textB = PC:GetRGBPercent("green")
-
- local cat = Tablet:AddCategory(
- 'columns', 1
- )
+ self:TabletSetColorJustifyCheck("ItemQuality6", "LEFT", true)
+
+ local cat = Tablet:AddCategory('columns', 1)
if ((not self:PlayerInRaid()) and self:PlayerInParty()) then
- cat:AddLine(
- 'text', "Hint: Click to Convert to raid",
- 'justify', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
+ self:TabletExtraHint("Click to Convert to raid")
elseif (self:PlayerInRaid() and IsRaidLeader()) then
- cat:AddLine(
- 'text', "Hint: Click to do ready check",
- 'justify', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
+ self:TabletExtraHint("Click to do ready check")
end
- cat:AddLine(
- 'text', "Hint: Shift click to leave group (works on bugged group too)",
- 'justify', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
+ self:TabletExtraHint("Shift click to leave group (works on bugged group too)")
if (self:PlayerInRaid()) then
- _, textR, textG, textB = PC:GetRGBPercent("ItemQuality0")
- cat = Tablet:AddCategory(
- 'columns', 2
- )
- cat:AddLine(
- 'text', "Type",
- 'text2', "Amount",
- 'justify', "LEFT",
- 'justify2', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB,
- 'textR2', textR,
- 'textG2', textG,
- 'textB2', textB,
- 'hasCheck', true,
- 'checked', false
- )
+ self:NewTabletCategory('columns', 2)
+ self:NewTabletLine(
+ "Type"
+ , "Amount"
+ )
local classArray = { }
local typeArray = { }
@@ -131,7 +98,7 @@
typeArray[class2typeArray[fileName]] = typeArray[class2typeArray[fileName]] + 1
- if (self.db.profile.RaidStrength) then
+ if ((self.db.profile.RaidStrength) and (online)) then
for key, value in pairs(self:RaidStrengthValues(fileName)) do
if (not raidStrengthValues[key]) then raidStrengthValues[key] = 0 end
raidStrengthValues[key] = raidStrengthValues[key] + value
@@ -140,103 +107,43 @@
end
end
- _, textR, textG, textB = PC:GetRGBPercent("orange")
+ self:TabletSetColorJustifyCheck("orange", nil, nil)
for key, value in pairs(typeArray) do
- cat:AddLine(
- 'text', key,
- 'text2', value,
- 'func', function() RaidAgent:RaidMsg("Currently "..value.." "..key.." in raid") end,
- 'justify', "LEFT",
- 'justify2', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB,
- 'textR2', textR,
- 'textG2', textG,
- 'textB2', textB,
- 'hasCheck', true,
- 'checked', (myType == key)
- )
+ self:NewTabletLine(
+ key
+ , value
+ , function() RaidAgent:RaidMsg("Currently "..value.." "..key.." in raid") end
+ , (myType == key)
+ )
end
- cat:AddLine(
- 'text', "",
- 'text2', "",
- 'hasCheck', true,
- 'checked', (myType == key)
- )
+ self:NewTabletLine(
+ ""
+ )
for key, value in pairs(classArray) do
- _, textR, textG, textB = PC:GetRGBPercent(key)
- cat:AddLine(
- 'text', classArray[key].class,
- 'text2', classArray[key].count,
- 'func', function() RaidAgent:RaidMsg("Currently "..classArray[key].count.." "..classArray[key].class.." in raid") end,
- 'justify', "LEFT",
- 'justify2', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB,
- 'textR2', textR,
- 'textG2', textG,
- 'textB2', textB,
- 'hasCheck', true,
- 'checked', (myClass == classArray[key].class)
- )
+ self:TabletSetColorJustifyCheck(key, nil, nil)
+ self:NewTabletLine(
+ classArray[key].class
+ , classArray[key].count
+ , function() RaidAgent:RaidMsg("Currently "..classArray[key].count.." "..classArray[key].class.." in raid") end
+ , (myClass == classArray[key].class)
+ )
end
- _, textR, textG, textB = PC:GetRGBPercent("green")
-
- cat = Tablet:AddCategory(
- 'columns', 1,
- 'hideBlankLine', true
- )
- cat:AddLine(
- 'text', "Hint: Click to report in raid, Shift-Click to report in Officer",
- 'justify', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
+ self:TabletExtraHint("Click to report in raid, Shift-Click to report in Officer")
- _, textR, textG, textB = PC:GetRGBPercent("ItemQuality0")
- cat = Tablet:AddCategory(
- 'columns', 6
- )
- cat:AddLine(
- 'text', "Name",
- 'text2', "Group",
- 'text3', "Level",
- 'text4', "Class",
- 'text5', "Special",
- 'text6', "Zone",
- 'justify', "LEFT",
- 'justify2', "LEFT",
- 'justify3', "LEFT",
- 'justify4', "LEFT",
- 'justify5', "LEFT",
- 'justify6', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB,
- 'textR2', textR,
- 'textG2', textG,
- 'textB2', textB,
- 'textR3', textR,
- 'textG3', textG,
- 'textB3', textB,
- 'textR4', textR,
- 'textG4', textG,
- 'textB4', textB,
- 'textR5', textR,
- 'textG5', textG,
- 'textB5', textB,
- 'textR6', textR,
- 'textG6', textG,
- 'textB6', textB,
- 'hasCheck', true,
- 'checked', false
- )
+ self:NewTabletCategory('columns', 6)
+ self:TabletSetColorJustifyCheck("ItemQuality6", nil, nil)
+ self:NewTabletLine(
+ "Name"
+ , "Group"
+ , "Level"
+ , "Class"
+ , "Special"
+ , "Zone"
+ )
+
for raidIndex=1, GetNumRaidMembers() do
local name, rank, subgroup, level, class, fileName, zone, online, isDead = GetRaidRosterInfo(raidIndex)
local rankSuffix = ""
@@ -252,119 +159,86 @@
rankSuffix = rankSuffix.."*"
end
- -- Class Colors
- local _, textR, textG, textB = PC:GetRGBPercent(fileName)
+ local specialString = "module not loaded"
+ if (self.censusActive) then
+ if (not self.census[name]) then
+ specialString = "Not Synced"
+ else
+ specialString = self:GetCensusStringForClass(self:ReadCensusString(self.census[name]))
+ if (censusData) then
+ specialString = "Class ("..censusClass..") not found"
+ if (self:HaveClass(censusClass)) then
+ if L:HasTranslation(self:ShowForClass(censusClass)) then
+ specialString = tostring(censusData[self:ShowForClass(censusClass)].isMaxed)
+ else
+ specialString = "Skillkey ("..self:ShowForClass(censusClass)..") not found"
+ end
+ end
+ end
+ end
+ end
if (not online) then
- _, textR, textG, textB = PC:GetRGBPercent("ItemQuality0")
+ self:TabletSetColorJustifyCheck("ItemQuality0", nil, nil)
elseif (isDead) then
- _, textR, textG, textB = PC:GetRGBPercent("red")
+ self:TabletSetColorJustifyCheck("red", nil, nil)
+ else
+ self:TabletSetColorJustifyCheck(fileName, nil, nil)
end
-
- cat:AddLine(
- 'text', rankSuffix..name,
- 'text2', subgroup,
- 'text3', level,
- 'text4', class,
- 'text5', "??",
- 'text6', zone,
- 'func', function() RaidAgent:FuNameClick(name, rank, raidIndex) end,
- 'justify', "LEFT",
- 'justify2', "LEFT",
- 'justify3', "LEFT",
- 'justify4', "LEFT",
- 'justify5', "LEFT",
- 'justify6', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB,
- 'textR2', textR,
- 'textG2', textG,
- 'textB2', textB,
- 'textR3', textR,
- 'textG3', textG,
- 'textB3', textB,
- 'textR4', textR,
- 'textG4', textG,
- 'textB4', textB,
- 'textR5', textR,
- 'textG5', textG,
- 'textB5', textB,
- 'textR6', textR,
- 'textG6', textG,
- 'textB6', textB,
- 'hasCheck', true,
- 'checked', grouped
- )
+ self:NewTabletLine(
+ rankSuffix..name
+ , subgroup
+ , level
+ , class
+ , specialString
+ , zone
+ , function() RaidAgent:FuNameClick(name, rank, raidIndex) end
+ , grouped
+ )
end
- _, textR, textG, textB = PC:GetRGBPercent("green")
- cat = Tablet:AddCategory(
- 'columns', 1,
- 'hideBlankLine', true
- )
- cat:AddLine(
- 'text', "Hint: Click to toggle (A), Shift-Click to give away (L), Ctrl-Click to give ML, Alt-Click to uninvite",
- 'justify', "LEFT",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
+
+ self:TabletExtraHint("Hint: Click to toggle (A), Shift-Click to give away (L), Ctrl-Click to give ML, Alt-Click to uninvite")
if (self.db.profile.RaidStrength) then
- _, textR, textG, textB = PC:GetRGBPercent("ItemQuality0")
+ self:TabletExtraHeadline(
+ "Raid Strength: "..raidStrengthTotal.." (values based on: http://www.wowwiki.com/Class)"
+ , function() self:RaidMsg("Raid Strength Total: "..raidStrengthTotal.." (values based on: http://www.wowwiki.com/Class)") end
+ )
- cat = Tablet:AddCategory(
- 'columns', 1
- )
- cat:AddLine(
- 'text', "Raid Strength ("..raidStrengthTotal..") Values (based on: http://www.wowwiki.com/Class)",
- 'justify', "CENTER",
- 'textR', textR,
- 'textG', textG,
- 'textB', textB
- )
- cat = Tablet:AddCategory(
- 'columns', 6,
- 'hideBlankLine', true
- )
- cat:AddLine(
- 'text', "DPS",
- 'text2', "AoE",
- 'text3', "Heal",
- 'text4', "Tank",
- 'text5', "CC / Pull / MA",
- 'text6', "Buff / Debuff",
- 'justify', "CENTER",
- 'justify2', "CENTER",
- 'justify3', "CENTER",
- 'justify4', "CENTER",
- 'justify5', "CENTER",
- 'justify6', "CENTER"
- )
- cat:AddLine(
- 'text', raidStrengthValues["DPS"],
- 'text2', raidStrengthValues["AoE"],
- 'text3', raidStrengthValues["Heal"],
- 'text4', raidStrengthValues["Tank"],
- 'text5', raidStrengthValues["CC"].." / "..raidStrengthValues["Pull"].." / "..raidStrengthValues["MA"],
- 'text6', raidStrengthValues["Buff"].." / "..raidStrengthValues["Debuff"],
- 'justify', "CENTER",
- 'justify2', "CENTER",
- 'justify3', "CENTER",
- 'justify4', "CENTER",
- 'justify5', "CENTER",
- 'justify6', "CENTER"
- )
+ self:NewTabletCategory('columns', 6, 'hideBlankLine', true)
+
+ self:TabletSetColorJustifyCheck("orange", nil, nil)
+ self:NewTabletLine(
+ "DPS"
+ , "AoE"
+ , "Heal"
+ , "Tank"
+ , "CC / Pull / MA"
+ , "Buff / Debuff"
+ )
+
+ local raidStrengthString = nil
+ for key, value in pairs(raidStrengthValues) do
+ if (raidStrengthString) then raidStrengthString = raidStrengthString..", " else raidStrengthString = "" end
+ raidStrengthString = raidStrengthString..key..": "..value
+ end
+
+ self:NewTabletLine(
+ raidStrengthValues["DPS"]
+ , raidStrengthValues["AoE"]
+ , raidStrengthValues["Heal"]
+ , raidStrengthValues["Tank"]
+ , raidStrengthValues["CC"].." / "..raidStrengthValues["Pull"].." / "..raidStrengthValues["MA"]
+ , raidStrengthValues["Buff"].." / "..raidStrengthValues["Debuff"]
+ , function() self:RaidMsg("Raid Strengths: "..raidStrengthString.." (values based on: http://www.wowwiki.com/Class)") end
+ )
+ self:TabletExtraHint("Click to report in raid, Shift-Click to report in Officer")
end
else
- local cat = Tablet:AddCategory(
- 'columns', 1
- )
-
- cat:AddLine(
- 'text', "Nothing to display",
- 'justify', "CENTER"
- )
+ self:NewTabletCategory('columns', 1)
+
+ self:TabletSetColorJustifyCheck("ItemQuality6", nil, nil)
+ self:NewTabletLine("Nothing to display")
end
--Tablet:SetHint(L["fubarTabletHint"])
@@ -422,4 +296,104 @@
DemoteAssistant(clickName)
end
end
+end
+
+function RaidAgent:TabletSetColorJustifyCheck(pcColor, justify, hasCheck)
+ if (not self.tabletOptions) then self.tabletOptions = { } end
+ if (type(pcColor) == "string") then self.tabletOptions.pcColor = pcColor end
+ if (type(justify) == "string") then self.tabletOptions.justify = justify end
+ if (type(hasCheck) == "boolean") then self.tabletOptions.hasCheck = hasCheck end
+end
+
+function RaidAgent:NewTabletCategory(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
+ local args = {}
+ tinsert(args, arg1)
+ tinsert(args, arg2)
+ tinsert(args, arg3)
+ tinsert(args, arg4)
+ tinsert(args, arg5)
+ tinsert(args, arg6)
+ tinsert(args, arg7)
+ tinsert(args, arg8)
+ tinsert(args, arg9)
+
+ local info = { }
+ for _, locArg in pairs(args) do
+ if (type(locArg) == "number") then
+ info["columns"] = locArg
+ elseif (type(locArg) == "boolean") then
+ info["hideBlankLine"] = locArg
+ end
+ end
+
+ return info
+end
+
+function RaidAgent:NewTabletCategory(...)
+ TabletCat = Tablet:AddCategory(...)
+end
+
+function RaidAgent:NewTabletLine(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
+ if (not self.tabletOptions) then self.tabletOptions = { } end
+
+ local args = {}
+ tinsert(args, arg1)
+ tinsert(args, arg2)
+ tinsert(args, arg3)
+ tinsert(args, arg4)
+ tinsert(args, arg5)
+ tinsert(args, arg6)
+ tinsert(args, arg7)
+ tinsert(args, arg8)
+ tinsert(args, arg9)
+
+ local info = { }
+ local txtCounter = 1
+ local _, textR, textG, textB = PC:GetRGBPercent(self.tabletOptions.pcColor)
+
+ for _, locArg in pairs(args) do
+ if (type(locArg) == "function") then
+ info["func"] = locArg
+ elseif (type(locArg) == "boolean") then
+ info["isRadio"] = locArg
+ info["checked"] = locArg
+ else
+ local textString = "text"..txtCounter
+ local justifyString = "justify"..txtCounter
+ local textRString = "text"..txtCounter.."R"
+ local textGString = "text"..txtCounter.."G"
+ local textBString = "text"..txtCounter.."B"
+
+ if (txtCounter == 1) then
+ textString = "text"
+ justifyString = "justify"
+ textRString = "textR"
+ textGString = "textG"
+ textBString = "textB"
+ end
+
+ info[textString] = locArg
+ info[justifyString] = self.tabletOptions.justify
+ info[textRString] = textR
+ info[textGString] = textG
+ info[textBString] = textB
+
+ txtCounter = txtCounter + 1
+ end
+ end
+ info["hasCheck"] = self.tabletOptions.hasCheck
+
+ TabletCat:AddLine(info)
+end
+
+function RaidAgent:TabletExtraHint(hint, func)
+ self:TabletSetColorJustifyCheck("green", "LEFT", nil)
+ self:NewTabletCategory('columns', 1, 'hideBlankLine', true)
+ self:NewTabletLine("Hint: "..hint, func)
+end
+
+function RaidAgent:TabletExtraHeadline(headline, func)
+ self:TabletSetColorJustifyCheck("ItemQuality6", "CENTER", nil)
+ self:NewTabletCategory('columns', 1)
+ self:NewTabletLine(headline, func)
end
Modified: trunk/RaidAgent/common/Localization.lua
==============================================================================
--- trunk/RaidAgent/common/Localization.lua (original)
+++ trunk/RaidAgent/common/Localization.lua Sun Dec 24 22:37:00 2006
@@ -12,5 +12,16 @@
["RaidStrength_name"] = "RaidStrength",
["RaidStrength_desc"] = "Calculate RaidStrength",
+ ["display_name"] = "Display",
+ ["display_desc"] = "Choose what to display",
+ --[[ *** CLASSES *** ]]
+ ["WARRIOR"] = "Warrior",
+
+ --[[ *** TALENTS *** ]]
+ ["WR_ISW"] = "Improved Shield Wall",
+ ["WR_LaS"] = "Last Stand",
+ ["WR_Def"] = "Defiance",
+ ["WR_IDS"] = "Improved Defensive Stance",
+ ["WR_Vit"] = "Vitality",
} end)
Modified: trunk/RaidAgent/common/Toolbox.lua
==============================================================================
--- trunk/RaidAgent/common/Toolbox.lua (original)
+++ trunk/RaidAgent/common/Toolbox.lua Sun Dec 24 22:37:00 2006
@@ -2,6 +2,8 @@
local self = RaidAgent
local L = AceLibrary("AceLocale-2.2"):new("RaidAgent")
+self.RaidRankStrings = { [0] = "Raid Member", [1] = "Raid Officer", [2] = "Raid Leader" }
+
function RaidAgent:HexColor(color, expression)
if (not string.find(color, "%x%x%x%x%x%x")) then return end
@@ -50,7 +52,17 @@
end
function RaidAgent:AuthorOwner()
- local rVal = GetAddOnMetadata("RaidAgent", "Author")
+ return self:DoOwnage(GetAddOnMetadata("RaidAgent", "Author"))
+end
+
+function RaidAgent:DoPlural(expression)
+ local rVal = expression
+ if (not string.find(string.lower(rVal), "s", -1)) then rVal = rVal.."s" end
+ return rVal
+end
+
+function RaidAgent:DoOwnage(expression)
+ local rVal = expression
if (string.find(string.lower(self.author), "s", -1)) then rVal = rVal.."'" else rVal = rVal.."'s" end
return rVal
end