Commit fe8fe8d0 authored by Simpy's avatar Simpy 🐹

readd the shows inside of OnEnter so all tooltips can resize correctly if needed

parent 017fa0d3
......@@ -22,7 +22,6 @@ end
local function OnEnter()
DT.tooltip:ClearLines()
DT.tooltip:AddLine(L["Mitigation By Level: "])
DT.tooltip:AddLine(' ')
......@@ -37,6 +36,8 @@ local function OnEnter()
local armorReduction = PaperDollFrame_GetArmorReduction(effectiveArmor, lv)
DT.tooltip:AddDoubleLine(lv, format(chanceString, armorReduction),1,1,1)
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -100,6 +100,7 @@ local function OnEnter()
DT.tooltip:AddLine(' ')
DT.tooltip:AddDoubleLine(L["Unhittable:"], (unhittable > 0 and '+' or '')..format(chanceString, unhittable), 1, 1, 1, (unhittable < 0 and 1 or 0), (unhittable > 0 and 1 or 0), 0)
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -62,6 +62,8 @@ local function OnEnter()
DT.tooltip:AddDoubleLine(format(iconString, icon, name), count, 1, 1, 1, 1, 1, 1)
end
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -83,6 +83,8 @@ function DT:HoverBattleStats() -- OnEnter
DT.tooltip:AddDoubleLine(name, GetBattlefieldStatData(myIndex, i), 1,1,1)
end
end
DT.tooltip:Show()
end
end
end
......
......@@ -84,7 +84,6 @@ E.valueColorUpdateFuncs[ValueColorUpdate] = true
local function OnEnter()
DT.tooltip:ClearLines()
enteredFrame = true
local numCTA = 0
......@@ -145,6 +144,8 @@ local function OnEnter()
if tankReward or healerReward or dpsReward then numCTA = numCTA + 1 end
end
end
DT.tooltip:Show()
end
local updateInterval = 10
......
......@@ -19,7 +19,6 @@ end
local function OnEnter()
DT.tooltip:ClearLines()
DT.tooltip:AddDoubleLine(L["Left Click:"], L["Toggle Configuration"], 1, 1, 1)
DT.tooltip:AddDoubleLine(L["Hold Shift + Right Click:"], reloadText, 1, 1, 1)
......@@ -34,6 +33,8 @@ local function OnEnter()
end
end
end
DT.tooltip:Show()
end
local function Click(_, button)
......
......@@ -44,6 +44,7 @@ local function OnEnter()
DT.tooltip:AddDoubleLine(text, nil, 1, 1, 1)
DT.tooltip:AddLine(tooltip, nil, nil, nil, true)
DT.tooltip:Show()
end
local function OnEvent(self)
......
......@@ -70,7 +70,6 @@ end
local faction = (E.myfaction == 'Alliance' and 1717) or 1716
local function OnEnter()
DT.tooltip:ClearLines()
DT.tooltip:AddDoubleLine(L["Gold"]..':', goldText, nil, nil, nil, 1, 1, 1)
DT.tooltip:AddLine(' ')
......@@ -105,6 +104,8 @@ local function OnEnter()
end
end
end
DT.tooltip:Show()
end
DT:RegisterDatatext('Currencies', nil, {'PLAYER_MONEY', 'SEND_MAIL_MONEY_CHANGED', 'SEND_MAIL_COD_CHANGED', 'PLAYER_TRADE_MONEY', 'TRADE_MONEY_CHANGED', 'CHAT_MSG_CURRENCY', 'CURRENCY_DISPLAY_UPDATE'}, OnEvent, nil, OnClick, OnEnter, nil, _G.CURRENCY)
......@@ -46,6 +46,7 @@ local function OnEnter(self)
local index = CurrencyListNameToIndex[self.name]
if not index then return end
DT.tooltip:SetCurrencyToken(index)
DT.tooltip:Show()
end
local function AddCurrencyNameToIndex(name)
......
......@@ -124,8 +124,6 @@ function DT:OnEnter()
for _, func in ipairs(self.MouseEnters) do
func(self)
end
DT.tooltip:Show()
end
DT.MouseEnter(self)
......
......@@ -121,12 +121,12 @@ end
local function OnEnter()
DT.tooltip:ClearLines()
DT.tooltip:SetText(L["Current Difficulties:"])
DT.tooltip:AddLine(' ')
DT.tooltip:AddLine(format('%s %s', DungeonTexture, DiffLabel[DungeonDifficultyID]), 1, 1, 1)
DT.tooltip:AddLine(format('%s %s', RaidTexture, DiffLabel[RaidDifficultyID]), 1, 1, 1)
DT.tooltip:AddLine(format('%s %s', LegacyTexture, DiffLabel[LegacyRaidDifficultyID]), 1, 1, 1)
DT.tooltip:Show()
end
DT:RegisterDatatext('Difficulty', nil, {'CHAT_MSG_SYSTEM', 'LOADING_SCREEN_DISABLED'}, OnEvent, nil, OnClick, OnEnter, nil, 'Difficulty')
......@@ -80,6 +80,8 @@ local function OnEnter()
DT.tooltip:AddLine(" ")
DT.tooltip:AddDoubleLine(REPAIR_COST, GetMoneyString(totalRepairCost), .6, .8, 1, 1, 1, 1)
end
DT.tooltip:Show()
end
DT:RegisterDatatext('Durability', nil, {"UPDATE_INVENTORY_DURABILITY", "MERCHANT_SHOW"}, OnEvent, nil, Click, OnEnter, nil, DURABILITY)
......@@ -71,6 +71,8 @@ local function OnEnter()
if rested then
DT.tooltip:AddDoubleLine(L["Rested:"], format('+%d (%d%%)', rested, E:Round(rested / max * 100)), 1, 1, 1)
end
DT.tooltip:Show()
end
DT:RegisterDatatext('Experience', nil, {'PLAYER_XP_UPDATE', 'DISABLE_XP_GAIN', 'ENABLE_XP_GAIN', 'UPDATE_EXHAUSTION'}, OnEvent, nil, nil, OnEnter, nil, _G.COMBAT_XP_GAIN)
......@@ -449,13 +449,11 @@ end
local function OnEnter()
DT.tooltip:ClearLines()
lastTooltipXLineHeader = nil
local onlineFriends = C_FriendList_GetNumOnlineFriends()
local numberOfFriends = C_FriendList_GetNumFriends()
local totalBNet, numBNetOnline = BNGetNumFriends()
local totalonline = onlineFriends + numBNetOnline
-- no friends online, quick exit
......@@ -546,6 +544,8 @@ local function OnEnter()
end
end
end
DT.tooltip:Show()
end
local function OnEvent(self, event, message)
......
......@@ -184,6 +184,7 @@ local function OnEnter()
DT.tooltip:AddLine(' ')
DT.tooltip:AddLine(resetCountersFormatter)
DT.tooltip:AddLine(resetInfoFormatter)
DT.tooltip:Show()
end
DT:RegisterDatatext('Gold', nil, {"PLAYER_MONEY", "SEND_MAIL_MONEY_CHANGED", "SEND_MAIL_COD_CHANGED", "PLAYER_TRADE_MONEY", "TRADE_MONEY_CHANGED"}, OnEvent, nil, Click, OnEnter, nil, L["Gold"])
......@@ -279,6 +279,8 @@ local function OnEnter(_, _, noUpdate)
if not noUpdate then
C_GuildInfo_GuildRoster()
end
DT.tooltip:Show()
end
local function OnEvent(self, event, ...)
......
......@@ -35,18 +35,19 @@ local OnEnter = function()
local haste = GetHaste()
local hasteFormatString
if (haste < 0 and not GetPVPGearStatRules()) then
if haste < 0 and not GetPVPGearStatRules() then
hasteFormatString = RED_FONT_COLOR_CODE.."%s"..FONT_COLOR_CODE_CLOSE
else
hasteFormatString = "%s"
end
if (not classTooltip) then
if not classTooltip then
classTooltip = STAT_HASTE_TOOLTIP
end
DT.tooltip:AddLine(HIGHLIGHT_FONT_COLOR_CODE..format(PAPERDOLLFRAME_TOOLTIP_FORMAT, STAT_HASTE).." ".. format(hasteFormatString, format("%.2F%%", haste))..FONT_COLOR_CODE_CLOSE)
DT.tooltip:AddLine(classTooltip..format(STAT_HASTE_BASE_TOOLTIP, BreakUpLargeNumbers(GetCombatRating(rating)), GetCombatRatingBonus(rating)))
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -52,6 +52,7 @@ local function OnEnter(self)
end
lastPanel = self
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -25,6 +25,7 @@ local function OnEnter()
DT.tooltip:AddDoubleLine(text, nil, 1, 1, 1)
DT.tooltip:AddLine(tooltip, nil, nil, nil, true)
DT.tooltip:Show()
end
local function OnEvent(self)
......
......@@ -19,13 +19,16 @@ local function OnEnter()
DT.tooltip:ClearLines()
local senders = { GetLatestThreeSenders() }
if #senders > 0 then
DT.tooltip:AddLine(HasNewMail() and HAVE_MAIL_FROM or MAIL_LABEL, 1, 1, 1)
DT.tooltip:AddLine(' ')
for _, sender in pairs(senders) do
DT.tooltip:AddLine(sender)
end
if not next(senders) then return end
DT.tooltip:AddLine(HasNewMail() and HAVE_MAIL_FROM or MAIL_LABEL, 1, 1, 1)
DT.tooltip:AddLine(' ')
for _, sender in pairs(senders) do
DT.tooltip:AddLine(sender)
end
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -18,6 +18,7 @@ local function OnEvent(self)
end
lastPanel = self
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -28,6 +28,8 @@ local function OnEnter()
DT.tooltip:AddLine(" ")
DT.tooltip:AddSpellByID(masterySpell2)
end
DT.tooltip:Show()
end
end
......
......@@ -294,6 +294,8 @@ local function OnEnter()
DT.tooltip:AddLine(' ')
DT.tooltip:AddLine("Hold Shift - Show Previous Expansion", .66, .66, .66)
end
DT.tooltip:Show()
end
local function OnClick(self)
......
......@@ -30,6 +30,7 @@ local function OnEvent(self)
self.text:SetFormattedText(displayString, movementSpeedText, speed/BASE_MOVEMENT_SPEED*100)
lastPanel = self
DT.tooltip:Show()
end
local function ValueColorUpdate(hex)
......
......@@ -26,6 +26,8 @@ local function OnEnter()
for name, activity in pairs(quickJoin) do
DT.tooltip:AddDoubleLine(name, activity, nil, nil, nil, 1, 1, 1)
end
DT.tooltip:Show()
end
local function Update(lastPanel)
......
......@@ -103,6 +103,8 @@ local function OnEnter()
if reaction ~= _G.MAX_REPUTATION_REACTION or C_Reputation_IsFactionParagon(factionID) then
DT.tooltip:AddDoubleLine(REPUTATION..':', format('%d / %d (%d%%)', value - min, max - min, (value - min) / ((max - min == 0) and max or (max - min)) * 100), 1, 1, 1)
end
DT.tooltip:Show()
end
end
......
......@@ -124,6 +124,7 @@ local function OnEnter()
DT.tooltip:AddLine(L["|cffFFFFFFLeft Click:|r Change Talent Specialization"])
DT.tooltip:AddLine(L["|cffFFFFFFShift + Left Click:|r Show Talent Specialization UI"])
DT.tooltip:AddLine(L["|cffFFFFFFRight Click:|r Change Loot Specialization"])
DT.tooltip:Show()
end
local function OnClick(self, button)
......
......@@ -25,6 +25,7 @@ local function OnEnter()
DT.tooltip:AddDoubleLine(text, nil, 1, 1, 1)
DT.tooltip:AddLine(tooltip, nil, nil, nil, true)
DT.tooltip:Show()
end
local function OnEvent(self)
......
......@@ -92,7 +92,6 @@ end
local infoDisplay, ipTypes = {}, {"IPv4", "IPv6"}
local function OnEnter(_, slow)
DT.tooltip:ClearLines()
enteredFrame = true
local _, _, homePing, worldPing = GetNetStats()
......@@ -211,6 +210,7 @@ local function OnEnter(_, slow)
DT.tooltip:AddLine(L["(Hold Shift) Memory Usage"])
end
DT.tooltip:AddLine(L["(Modifer Click) Collect Garbage"])
DT.tooltip:Show()
end
local function OnLeave()
......
......@@ -18,6 +18,8 @@ end
local function OnEnter(self)
DT.tooltip:ClearLines()
-- code goes here
DT.tooltip:Show()
end
--[[
......
......@@ -276,6 +276,8 @@ local function OnEnter()
else
DT.tooltip:AddDoubleLine(E.db.datatexts.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, format(ukDisplayFormat_nocolor, Hr, Min, APM[AmPm]), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b)
end
DT.tooltip:Show()
end
local function OnEvent(self, event)
......
......@@ -29,6 +29,7 @@ local function OnEnter()
DT.tooltip:AddDoubleLine(text, nil, 1, 1, 1)
DT.tooltip:AddLine(tooltip, nil, nil, nil, true)
DT.tooltip:Show()
end
local function OnEvent(self)
......
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