Commit 0df6eed5 authored by Tukz's avatar Tukz

Merge branch 'master' into 'master'

Fixes and clean-ups

See merge request !4
parents e97f7c64 9e5e0c4f
......@@ -213,8 +213,8 @@ local AnimMethods = {
move = {
SetOffset = function(self, x, y)
self.XSetting = x or 0
self.YSetting = y or 0
self.XSetting = x or 0
self.YSetting = y or 0
end,
GetOffset = function(self)
......
......@@ -7,8 +7,8 @@ local floor = math.floor
local class = select(2, UnitClass("player"))
local Noop = function() return end
T.Mult = 768/string.match(T.Resolution, "%d+x(%d+)")/C.General.UIScale
T.Scale = function(x) return T.Mult*math.floor(x/T.Mult+.5) end
T.Mult = 768 / string.match(T.Resolution, "%d+x(%d+)") / C.General.UIScale
T.Scale = function(x) return T.Mult * math.floor(x / T.Mult + .5) end
-- [[ API FUNCTIONS ]] --
......@@ -26,11 +26,11 @@ end
local function Point(obj, arg1, arg2, arg3, arg4, arg5)
-- anyone has a more elegant way for this?
if type(arg1)=="number" then arg1 = T.Scale(arg1) end
if type(arg2)=="number" then arg2 = T.Scale(arg2) end
if type(arg3)=="number" then arg3 = T.Scale(arg3) end
if type(arg4)=="number" then arg4 = T.Scale(arg4) end
if type(arg5)=="number" then arg5 = T.Scale(arg5) end
if type(arg1) == "number" then arg1 = T.Scale(arg1) end
if type(arg2) == "number" then arg2 = T.Scale(arg2) end
if type(arg3) == "number" then arg3 = T.Scale(arg3) end
if type(arg4) == "number" then arg4 = T.Scale(arg4) end
if type(arg5) == "number" then arg5 = T.Scale(arg5) end
obj:SetPoint(arg1, arg2, arg3, arg4, arg5)
end
......@@ -70,9 +70,9 @@ local function SetTemplate(f, t, tex)
end
f:SetBackdrop({
bgFile = texture,
edgeFile = C.Medias.Blank,
tile = false, tileSize = 0, edgeSize = T.Mult,
bgFile = texture,
edgeFile = C.Medias.Blank,
tile = false, tileSize = 0, edgeSize = T.Mult,
})
if not f.isInsetDone then
......@@ -545,9 +545,10 @@ local function SkinScrollBar(frame)
end
if frame:GetThumbTexture() then
if not thumbTrim then
--[[if not thumbTrim then -- This is a global lookup
thumbTrim = 3
end
end]]
local thumbTrim = 3
frame:GetThumbTexture():SetTexture(nil)
......
......@@ -27,7 +27,7 @@ Graphic:SetScript("OnEvent", function(self, event)
if not RequireRestart then
Popups.ShowPopup("CLIENT_RESTART")
end
RequireRestart = true
else
local UseUIScale = GetCVar("useUiScale")
......
......@@ -34,9 +34,9 @@ function Install:Step1()
SetCVar("screenshotQuality", 8)
SetCVar("chatMouseScroll", 1)
SetCVar("chatStyle", "im")
SetCVar("WholeChatWindowClickable", 0)
--SetCVar("WholeChatWindowClickable", 0) -- This CVar is removed
--SetCVar("ConversationMode", "inline")
SetCVar("WhisperMode", "inline")
--SetCVar("WhisperMode", "inline") -- This CVar is removed
--SetCVar("BnWhisperMode", "inline")
SetCVar("showTutorials", 0)
SetCVar("autoQuestWatch", 1)
......
......@@ -49,7 +49,7 @@ function Loading:OnEvent(event, addon)
C.General.UIScale = min(2, max(0.32, 768 / string.match(T.Resolution, "%d+x(%d+)")))
end
T.Mult = 768/string.match(T.Resolution, "%d+x(%d+)")/C.General.UIScale
T.Mult = 768 / string.match(T.Resolution, "%d+x(%d+)") / C.General.UIScale
-- PANELS
T["Panels"]:Enable()
......
......@@ -71,7 +71,7 @@ function TukuiActionBars:CreateBar1()
TukuiActionBars:UpdateBar1()
ActionBar1:RegisterEvent("PLAYER_ENTERING_WORLD")
ActionBar1:RegisterEvent("KNOWN_CURRENCY_TYPES_UPDATE")
--ActionBar1:RegisterEvent("KNOWN_CURRENCY_TYPES_UPDATE") -- This event is removed
ActionBar1:RegisterEvent("CURRENCY_DISPLAY_UPDATE")
ActionBar1:RegisterEvent("BAG_UPDATE")
ActionBar1:SetScript("OnEvent", function(self, event, unit, ...)
......@@ -83,7 +83,7 @@ function TukuiActionBars:CreateBar1()
Button:Size(Size)
Button:ClearAllPoints()
Button:SetParent(self)
if (i == 1) then
Button:SetPoint("BOTTOMLEFT", Spacing, Spacing)
else
......
......@@ -18,7 +18,7 @@ end
function TukuiActionBars:SetUpExtraActionButton()
local Holder = CreateFrame("Frame", "TukuiExtraActionButton", UIParent)
Holder:Size(160, 80)
Holder:SetPoint("BOTTOM", 0, 250)
......@@ -26,12 +26,12 @@ function TukuiActionBars:SetUpExtraActionButton()
ExtraActionBarFrame:ClearAllPoints()
ExtraActionBarFrame:SetPoint("CENTER", Holder, "CENTER", 0, 0)
ExtraActionBarFrame.ignoreFramePositionManager = true
ZoneAbilityFrame:SetParent(UIParent)
ZoneAbilityFrame:ClearAllPoints()
ZoneAbilityFrame:SetPoint("CENTER", Holder, "CENTER", 0, 0)
ZoneAbilityFrame.ignoreFramePositionManager = true
ZoneButton:SetTemplate()
ZoneButton:StyleButton()
ZoneButton:SetNormalTexture("")
......
......@@ -55,7 +55,7 @@ function TukuiAuras:OnUpdate(elapsed)
if(TimeLeft <= 0) then
self.TimeLeft = nil
self.Duration:SetText("")
if self.Enchant then
self.Dur = nil
end
......@@ -64,7 +64,7 @@ function TukuiAuras:OnUpdate(elapsed)
else
local Text = T.FormatTime(TimeLeft)
local r, g, b = T.ColorGradient(self.TimeLeft, self.Dur, 0.8, 0, 0, 0.8, 0.8, 0, 0, 0.8, 0)
if self.Enchant then
self.Bar:SetMinMaxValues(0, self.Dur)
end
......@@ -292,7 +292,7 @@ function TukuiAuras:Skin()
end
function TukuiAuras:OnEnterWorld()
for _, Header in next, TukuiAuras.Headers do
for _, Header in pairs(TukuiAuras.Headers) do
local Child = Header:GetAttribute("child1")
local i = 1
while(Child) do
......
......@@ -464,7 +464,7 @@ function TukuiChat:Setup()
ChatConfigFrameDefaultButton:Kill()
ChatFrameMenuButton:Kill()
if T.WoWBuild >= 22881 then
QuickJoinToastButton:Kill()
else
......
......@@ -10,30 +10,30 @@ local CopyFrame
function TukuiChat:GetLines(frame)
local Count = 0
for i = 1, frame:GetNumMessages() do
local Message, R, G, B = frame:GetMessageInfo(i)
Count = Count + 1
Lines[Count] = Message
end
return Count
end
function TukuiChat:CopyText(chatframe)
local _, Size = FCF_GetChatWindowInfo(chatframe:GetID())
if Size < 10 then
Size = 12
end
FCF_SetChatWindowFontSize(chatframe, chatframe, 0.01)
local LineCount = self:GetLines(chatframe)
local Text = table.concat(Lines, "\n", 1, LineCount)
FCF_SetChatWindowFontSize(chatframe, chatframe, Size)
if CopyFrame:IsVisible() then
......
......@@ -43,12 +43,12 @@ function TukuiChat:EnableURL()
ChatFrame_AddMessageEventFilter("CHAT_MSG_PARTY_LEADER", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_RAID", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_RAID_LEADER", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND_LEADER", TukuiChat.FindURL)
--ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND", TukuiChat.FindURL) -- This event is removed
--ChatFrame_AddMessageEventFilter("CHAT_MSG_BATTLEGROUND_LEADER", TukuiChat.FindURL) -- This event is removed
ChatFrame_AddMessageEventFilter("CHAT_MSG_SAY", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_WHISPER", TukuiChat.FindURL)
ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_CONVERSATION", TukuiChat.FindURL)
--ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_CONVERSATION", TukuiChat.FindURL) -- This event is removed
local CurrentLink = nil
local SetHyperlink = ItemRefTooltip.SetHyperlink
......
......@@ -191,11 +191,11 @@ function TukuiDT:ResetGold()
end
function TukuiDT:Save()
if (not TukuiData[GetRealmName()][UnitName("Player")]) then
TukuiData[GetRealmName()][UnitName("Player")] = {}
if (not TukuiData[GetRealmName()][UnitName("player")]) then
TukuiData[GetRealmName()][UnitName("player")] = {}
end
local Data = TukuiData[GetRealmName()][UnitName("Player")]
local Data = TukuiData[GetRealmName()][UnitName("player")]
if (not Data.Texts) then
Data.Texts = {}
......@@ -209,16 +209,16 @@ function TukuiDT:Save()
end
function TukuiDT:AddDefaults()
TukuiData[GetRealmName()][UnitName("Player")].Texts = {}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Guild] = {true, 1}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Durability] = {true, 2}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Friends] = {true, 3}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.FPSAndMS] = {true, 4}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Memory] = {true, 5}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Gold] = {true, 6}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Power] = {true, 7}
TukuiData[GetRealmName()][UnitName("Player")].Texts[L.DataText.Time] = {true, 8}
TukuiData[GetRealmName()][UnitName("player")].Texts = {}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Guild] = {true, 1}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Durability] = {true, 2}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Friends] = {true, 3}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.FPSAndMS] = {true, 4}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Memory] = {true, 5}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Gold] = {true, 6}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Power] = {true, 7}
TukuiData[GetRealmName()][UnitName("player")].Texts[L.DataText.Time] = {true, 8}
end
function TukuiDT:Reset()
......@@ -234,8 +234,8 @@ function TukuiDT:Reset()
self:AddDefaults()
if (TukuiData[GetRealmName()][UnitName("Player")] and TukuiData[GetRealmName()][UnitName("Player")].Texts) then
for Name, Info in pairs(TukuiData[GetRealmName()][UnitName("Player")].Texts) do
if (TukuiData[GetRealmName()][UnitName("player")] and TukuiData[GetRealmName()][UnitName("player")].Texts) then
for Name, Info in pairs(TukuiData[GetRealmName()][UnitName("player")].Texts) do
local Enabled, Num = Info[1], Info[2]
if (Enabled and (Num and Num > 0)) then
......@@ -246,7 +246,7 @@ function TukuiDT:Reset()
self.Anchors[Num]:SetData(Object)
else
T.Print("DataText '" .. Name .. "' not found. Removing from cache.")
TukuiData[GetRealmName()][UnitName("Player")].Texts[Name] = {false, 0}
TukuiData[GetRealmName()][UnitName("player")].Texts[Name] = {false, 0}
end
end
end
......@@ -256,16 +256,16 @@ end
function TukuiDT:Load()
self:CreateAnchors()
if (not TukuiData[GetRealmName()][UnitName("Player")]) then
TukuiData[GetRealmName()][UnitName("Player")] = {}
if (not TukuiData[GetRealmName()][UnitName("player")]) then
TukuiData[GetRealmName()][UnitName("player")] = {}
end
if (not TukuiData[GetRealmName()][UnitName("Player")].Texts) then
if (not TukuiData[GetRealmName()][UnitName("player")].Texts) then
TukuiDT:AddDefaults()
end
if (TukuiData[GetRealmName()][UnitName("Player")] and TukuiData[GetRealmName()][UnitName("Player")].Texts) then
for Name, Info in pairs(TukuiData[GetRealmName()][UnitName("Player")].Texts) do
if (TukuiData[GetRealmName()][UnitName("player")] and TukuiData[GetRealmName()][UnitName("player")].Texts) then
for Name, Info in pairs(TukuiData[GetRealmName()][UnitName("player")].Texts) do
local Enabled, Num = Info[1], Info[2]
if (Enabled and (Num and Num > 0)) then
......@@ -277,7 +277,7 @@ function TukuiDT:Load()
self.Anchors[Num]:SetData(Object)
else
T.Print("DataText '" .. Name .. "' not found. Removing from cache.")
TukuiData[GetRealmName()][UnitName("Player")].Texts[Name] = {false, 0}
TukuiData[GetRealmName()][UnitName("player")].Texts[Name] = {false, 0}
end
end
end
......
......@@ -16,13 +16,13 @@ local Update = function(self)
local BaseMissChance, LevelDifference, Avoidance
if TargetLevel == -1 then
BaseMissChance = (5 - (3*.2)) --Boss Value
BaseMissChance = (5 - (3 * .2)) --Boss Value
LevelDifference = 3
elseif TargetLevel > PlayerLevel then
BaseMissChance = (5 - ((TargetLevel - PlayerLevel)*.2)) --Mobs above player level
BaseMissChance = (5 - ((TargetLevel - PlayerLevel) * .2)) --Mobs above player level
LevelDifference = (TargetLevel - PlayerLevel)
elseif TargetLevel < PlayerLevel and TargetLevel > 0 then
BaseMissChance = (5 + ((PlayerLevel - TargetLevel)*.2)) --Mobs below player level
BaseMissChance = (5 + ((PlayerLevel - TargetLevel) * .2)) --Mobs below player level
LevelDifference = (TargetLevel - PlayerLevel)
else
BaseMissChance = 5 --Sets miss chance of attacker level if no target exists, lv80=5, 81=4.2, 82=3.4, 83=2.6
......
......@@ -128,7 +128,7 @@ end
local Enable = function(self)
self:RegisterEvent("LFG_UPDATE_RANDOM_INFO")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:SetScript("OnEvent", OnEvent)
self:SetScript("OnEvent", OnEvent) -- This is a global call here!
self:SetScript("OnMouseDown", OnMouseDown)
self:SetScript("OnEnter", OnEnter)
self:SetScript("OnLeave", OnLeave)
......
......@@ -11,10 +11,10 @@ local worldOfWarcraftString = "World of Warcraft"
local battleNetString = "Battle.NET"
local wowString = "WoW"
local totalOnlineString = L.DataText.Online .. "%s/%s"
local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3}
local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65}
local tthead, ttsubh, ttoff = {r = 0.4, g = 0.78, b = 1}, {r = 0.75, g = 0.9, b = 1}, {r = .3, g = 1, b = .3}
local activezone, inactivezone = {r = 0.3, g = 1.0, b = 0.3}, {r = 0.65, g = 0.65, b = 0.65}
local statusTable = { "|cffff0000[AFK]|r", "|cffff0000[DND]|r", "" }
local groupedTable = { "|cffaaaaaa*|r", "" }
local groupedTable = { "|cffaaaaaa*|r", "" }
local friendTable, BNTable = {}, {}
local totalOnline, BNTotalOnline = 0, 0
local BNGetGameAccountInfo = BNGetGameAccountInfo
......@@ -27,7 +27,7 @@ Popups.Popup["BROADCAST"] = {
Answer2 = CANCEL,
Function1 = function(self)
local Parent = self:GetParent()
BNSetCustomMessage(Parent.EditBox:GetText())
end,
EditBox = true,
......@@ -36,12 +36,12 @@ Popups.Popup["BROADCAST"] = {
local menuFrame = CreateFrame("Frame", "TukuiFriendRightClickMenu", UIParent, "UIDropDownMenuTemplate")
local menuList = {
{ text = OPTIONS_MENU, isTitle = true, notCheckable=true},
{ text = INVITE, hasArrow = true, notCheckable=true, },
{ text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable=true, },
{ text = PLAYER_STATUS, hasArrow = true, notCheckable=true,
{ text = OPTIONS_MENU, isTitle = true, notCheckable = true},
{ text = INVITE, hasArrow = true, notCheckable = true, },
{ text = CHAT_MSG_WHISPER_INFORM, hasArrow = true, notCheckable = true, },
{ text = PLAYER_STATUS, hasArrow = true, notCheckable = true,
menuList = {
{ text = "|cff2BC226"..AVAILABLE.."|r", notCheckable=true, func = function()
{ text = "|cff2BC226"..AVAILABLE.."|r", notCheckable = true, func = function()
if IsChatAFK() then
SendChatMessage("", "AFK")
elseif IsChatDND() then
......@@ -49,20 +49,20 @@ local menuList = {
end
end },
{ text = "|cffE7E716"..DND.."|r", notCheckable=true, func = function()
{ text = "|cffE7E716"..DND.."|r", notCheckable = true, func = function()
if not IsChatDND() then
SendChatMessage("", "DND")
end
end },
{ text = "|cffFF0000"..AFK.."|r", notCheckable=true, func = function()
{ text = "|cffFF0000"..AFK.."|r", notCheckable = true, func = function()
if not IsChatAFK() then
SendChatMessage("", "AFK")
end
end },
},
},
{ text = BN_BROADCAST_TOOLTIP, notCheckable=true, func = function()
{ text = BN_BROADCAST_TOOLTIP, notCheckable = true, func = function()
Popups.ShowPopup("BROADCAST")
end },
}
......@@ -79,7 +79,7 @@ end
local function RemoveTagNumber(tag)
local symbol = string.find(tag, "#")
if (symbol) then
return string.sub(tag, 1, symbol - 1)
else
......@@ -89,7 +89,7 @@ end
local function inviteClick(self, arg1, arg2, checked)
menuFrame:Hide()
if type(arg1) ~= ("number") then
InviteUnit(arg1)
else
......@@ -99,7 +99,7 @@ end
local function whisperClick(self,name,bnet)
menuFrame:Hide()
if bnet then
ChatFrame_SendSmartTell(name)
else
......@@ -150,7 +150,7 @@ local function UpdateFriendTable(total)
end
end
-- get the correct index in our table
-- get the correct index in our table
local index = GetTableIndex(friendTable, 1, name)
-- we cannot find a friend in our table, so rebuild it
......@@ -210,7 +210,7 @@ local function UpdateBNTable(total)
end
end
-- get the correct index in our table
-- get the correct index in our table
local index = GetTableIndex(BNTable, 1, presenceID)
-- we cannot find a BN member in our table, so rebuild it
......@@ -533,8 +533,8 @@ local OnEnter = function(self)
end
GameTooltip:Show()
else
GameTooltip:Hide()
else
GameTooltip:Hide()
end
end
......@@ -560,12 +560,12 @@ end
local Enable = function(self)
self:RegisterEvent("BN_FRIEND_ACCOUNT_ONLINE")
self:RegisterEvent("BN_FRIEND_ACCOUNT_OFFLINE")
self:RegisterEvent("BN_FRIEND_TOON_ONLINE")
self:RegisterEvent("BN_FRIEND_TOON_OFFLINE")
self:RegisterEvent("BN_TOON_NAME_UPDATED")
--self:RegisterEvent("BN_FRIEND_TOON_ONLINE") -- This event is removed
--self:RegisterEvent("BN_FRIEND_TOON_OFFLINE") -- This event is removed
--self:RegisterEvent("BN_TOON_NAME_UPDATED") -- This event is removed
self:RegisterEvent("FRIENDLIST_UPDATE")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("FRIENDLIST_SHOW")
--self:RegisterEvent("FRIENDLIST_SHOW") -- This event is removed
self:RegisterEvent("IGNORELIST_UPDATE")
self:RegisterEvent("MUTELIST_UPDATE")
self:RegisterEvent("PLAYER_FLAGS_CHANGED")
......
......@@ -3,8 +3,8 @@ local T, C, L = select(2, ...):unpack()
local DataText = T["DataTexts"]
local format = format
local tthead, ttsubh, ttoff = {r=0.4, g=0.78, b=1}, {r=0.75, g=0.9, b=1}, {r=.3,g=1,b=.3}
local activezone, inactivezone = {r=0.3, g=1.0, b=0.3}, {r=0.65, g=0.65, b=0.65}
local tthead, ttsubh, ttoff = {r = 0.4, g = 0.78, b = 1}, {r = 0.75, g = 0.9, b = 1}, {r = .3, g = 1, b = .3}
local activezone, inactivezone = {r = 0.3, g = 1.0, b = 0.3}, {r = 0.65, g = 0.65, b = 0.65}
local displayString = string.join("", "%s: ", "%d")
local guildInfoString = "%s [%d]"
local guildInfoString2 = "%s: %d/%d"
......@@ -44,7 +44,7 @@ local function BuildGuildTable()
end
local function UpdateGuildXP()
local currentXP, remainingXP = UnitGetGuildXP("player")
local currentXP, remainingXP = UnitGetGuildXP("player") -- This API is removed!
local nextLevelXP = currentXP + remainingXP
if nextLevelXP == 0 or maxDailyXP == 0 then return end
......@@ -222,7 +222,7 @@ local Update = function(self)
end
local Enable = function(self)
self:RegisterEvent("GUILD_ROSTER_SHOW")
--self:RegisterEvent("GUILD_ROSTER_SHOW") -- This event is removed
self:RegisterEvent("GUILD_ROSTER_UPDATE")
self:RegisterEvent("PLAYER_GUILD_UPDATE")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
......
......@@ -12,21 +12,21 @@ local CurrentCharSpecName
local Update = function(self)
local CurrentLootSpec = GetLootSpecialization()
local CurrentSpec = GetSpecialization()
CurrentLootSpecName = CurrentLootSpec and select(2, GetSpecializationInfoByID(CurrentLootSpec))
CurrentCharSpecName = CurrentSpec and select(2, GetSpecializationInfo(CurrentSpec))
if (CurrentLootSpec ~=0 and CurrentLootSpecName == nil) or CurrentCharSpecName == nil then
self.Text:SetText("+--+")
return
end
if CurrentLootSpec == 0 then
CurrentLootSpecName = CurrentCharSpecName
end
self.Text:SetText(CurrentLootSpecName)
end
......@@ -37,10 +37,10 @@ end
local OnEnter = function(self)
self:Update()
GameTooltip:SetOwner(self:GetTooltipAnchor())
GameTooltip:ClearLines()
GameTooltip:AddDoubleLine(LOOT..": ", CurrentLootSpecName, 1, 1, 1, 0, 1, 0)
GameTooltip:AddDoubleLine(SPECIALIZATION..": ", CurrentCharSpecName, 1, 1, 1, 0, 1, 0)
......@@ -51,21 +51,21 @@ local Enable = function(self)
self:RegisterEvent("PLAYER_TALENT_UPDATE")
self:RegisterEvent("PLAYER_LOOT_SPEC_UPDATED")
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:SetScript("OnEvent", Update)
self:SetScript("OnEnter", OnEnter)
self:SetScript("OnLeave", OnLeave)
self:Update()
end
local Disable = function(self)
self:UnregisterAllEvents()
self:SetScript("OnEvent", nil)
self:SetScript("OnEnter", nil)
self:SetScript("OnLeave", nil)
self.Text:SetText("")
end
......
......@@ -11,7 +11,7 @@ local percentageString = "%.2f%%"
local FormatMemory = function(memory)
if (memory > 999) then
local Memory = ((memory/1024) * Mult) / Mult
local Memory = ((memory / 1024) * Mult) / Mult
return string.format(MegabyteString, Memory)
else
local Memory = (memory * Mult) / Mult
......
......@@ -44,7 +44,7 @@ local OnEnter = function(self)
local PVPType, IsSubZonePvP, FactionName = GetZonePVPInfo()
local X, Y = GetPlayerMapPosition("player")
local XText, YText, Label, Location, Color
if not GetPlayerMapPosition("player") then
X = 0
Y = 0
......
......@@ -352,7 +352,7 @@ function Bags:CreateContainer(storagetype, ...)
CloseAllBags()
CloseBankBagFrames()
CloseBankFrame()
if (T.WoWBuild >= 24904) then
PlaySound(SOUNDKIT.IG_BACKPACK_CLOSE)
else
......@@ -563,20 +563,20 @@ function Bags:SlotUpdate(id, button)
end
local ItemLink = GetContainerItemLink(id, button:GetID())
local Texture, Count, Lock, quality, _, _, _, _, _, ItemID = GetContainerItemInfo(id, button:GetID())
local IsNewItem = C_NewItems.IsNewItem(id, button:GetID())
if IsNewItem ~= true and button.Animation and button.Animation:IsPlaying() then
button.Animation:Stop()
end
if (button.ItemID == ItemID) then
return
end
button.ItemID = ItemID
local IsQuestItem, QuestId, IsActive = GetContainerItemQuestInfo(id, button:GetID())
local IsBattlePayItem = IsBattlePayItem(id, button:GetID())
local NewItem = button.NewItemTexture
......@@ -612,7 +612,7 @@ function Bags:SlotUpdate(id, button)
button.Animation:Play()
end
end
if IsQuestItem then
button:SetBackdropBorderColor(1, 1, 0)
elseif ItemLink then
......@@ -634,7 +634,7 @@ function Bags:BagUpdate(id)
if not Button:IsShown() then
Button:Show()
end
self:SlotUpdate(id, Button)
end
end
......@@ -863,7 +863,7 @@ function Bags:CloseAllBags()
end
CloseAllBags()
if (T.WoWBuild >= 24904) then
PlaySound(SOUNDKIT.IG_BACKPACK_CLOSE)
else
......@@ -912,21 +912,21 @@ function Bags:OnEvent(event, ...)
self:BagUpdate(...)
elseif (event == "BAG_CLOSED") then
-- This is usually where the client find a bag swap in character or bank slots.
local Bag = ... + 1
-- We need to hide buttons from a bag when closing it because they are not parented to the original frame
local Container = _G["ContainerFrame"..Bag]
local Size = Container.size
for i = 1, Size do
local Button = _G["ContainerFrame"..Bag.."Item"..i]
if Button then
Button:Hide()
end
end
-- We close to refresh the all in one layout.
self:CloseAllBags()
self:CloseAllBankBags()
......