Commit 739603d9 authored by Tukz's avatar Tukz

DATATEXT[GUILD]: No Cross Realms, removing guild server name to nicknames.

parent ff9088e3
local T, C, L = select(2, ...):unpack()
local DataText = T["DataTexts"]
local Update = function(self, event)
local Missions = GarrisonMissionFrame.MissionTab.MissionList.inProgressMissions
local Count = 0
C_Garrison.GetInProgressMissions(Missions, LE_FOLLOWER_TYPE_GARRISON_6_0)
for i = 1, #Missions do
if Missions[i].inProgress then
local TimeLeft = Missions[i].timeLeft:match("%d")
if (TimeLeft ~= "0") then
Count = Count + 1
end
end
end
if (Count > 0) then
self.Text:SetText(DataText.ValueColor .. format(GARRISON_LANDING_IN_PROGRESS, Count))
else
self.Text:SetText(DataText.NameColor .. GARRISON_LOCATION_TOOLTIP)
end
end
local OnEnter = function(self)
if (not GarrisonMissionFrame) then
return
end
GameTooltip:SetOwner(self:GetTooltipAnchor())
GameTooltip:ClearLines()
local Missions = GarrisonMissionFrame.MissionTab.MissionList.inProgressMissions
local NumMissions = #Missions
C_Garrison.GetInProgressMissions(Missions, LE_FOLLOWER_TYPE_GARRISON_6_0)
if (NumMissions == 0) then
return
end
GameTooltip:AddLine(GARRISON_MISSIONS)
for i = 1, NumMissions do
local Mission = Missions[i]
local TimeLeft = Mission.timeLeft:match("%d")
if (Mission.inProgress and (TimeLeft ~= "0")) then
GameTooltip:AddDoubleLine(Mission.name, Mission.timeLeft, 1, 1, 1, 1, 1, 1)
end
end
local Available = GarrisonMissionFrame.MissionTab.MissionList.availableMissions
local NumAvailable = #Available
if (NumAvailable > 0) then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(format(GARRISON_LANDING_AVAILABLE, NumAvailable))
end
GameTooltip:Show()
end
local OnLeave = function(self)
GameTooltip:Hide()
end
local Enable = function(self)
if (not GarrisonMissionFrame) then
LoadAddOn("Blizzard_GarrisonUI")
end
self:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
self:RegisterEvent("GET_ITEM_INFO_RECEIVED")
self:RegisterEvent("GARRISON_MISSION_LIST_UPDATE")
self:RegisterEvent("GARRISON_MISSION_STARTED")
self:RegisterEvent("GARRISON_MISSION_FINISHED")
self:RegisterEvent("GARRISON_MISSION_COMPLETE_RESPONSE")
self:SetScript("OnEvent", Update)
self:SetScript("OnMouseDown", GarrisonLandingPage_Toggle)
self:SetScript("OnEnter", OnEnter)
self:SetScript("OnLeave", OnLeave)
self:Update()
end
local Disable = function(self)
self.Text:SetText("")
self:UnregisterAllEvents()
self:SetScript("OnEvent", nil)
self:SetScript("OnMouseDown", nil)
self:SetScript("OnEnter", nil)
self:SetScript("OnLeave", nil)
end
DataText:Register(L.DataText.Garrison, Enable, Disable, Update)
......@@ -20,9 +20,11 @@ local totalOnline = 0
local function BuildGuildTable()
totalOnline = 0
wipe(guildTable)
local _, name, rank, level, zone, note, officernote, connected, status, class, isMobile
local _, name, server, name_server, rank, level, zone, note, officernote, connected, status, class, isMobile
for i = 1, GetNumGuildMembers() do
name, rank, _, level, _, zone, note, officernote, connected, status, class, _, _, isMobile = GetGuildRosterInfo(i)
name_server, rank, _, level, _, zone, note, officernote, connected, status, class, _, _, isMobile = GetGuildRosterInfo(i)
server = string.gsub(GetRealmName("player"), "%s+", "")
name = string.gsub(name_server, "-"..server, "")
if status == 1 then
status = "|cffff0000["..AFK.."]|r"
......@@ -145,13 +147,6 @@ local OnEnter = function(self)
name, rank, level, zone, note, officernote, connected, status, class, isMobile = unpack(guildTable[i])
if connected and name ~= UnitName("player") then
if Count > ((T.ScreenHeight / 10) / 2) then
GameTooltip:AddLine(" ")
GameTooltip:AddLine(format("+ "..INSPECT_GUILD_NUM_MEMBERS, online - Count),ttsubh.r,ttsubh.g,ttsubh.b)
break
end
if GetRealZoneText() == zone then zonec = activezone else zonec = inactivezone end
classc, levelc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class], GetQuestDifficultyColor(level)
......@@ -172,7 +167,8 @@ local OnEnter = function(self)
if Count > MaxOnlineGuildMembersToDisplay then
GameTooltip:AddLine(" ")
GameTooltip:AddLine("...")
GameTooltip:AddLine(format("+ "..INSPECT_GUILD_NUM_MEMBERS, online - Count),ttsubh.r,ttsubh.g,ttsubh.b)
break -- too many members online
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment