-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
executable file
·601 lines (533 loc) · 22.8 KB
/
init.lua
File metadata and controls
executable file
·601 lines (533 loc) · 22.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
-- Keybinding display name (must be global before Bindings.xml loads)
BINDING_NAME_SUAVIUI_TOGGLE_OPTIONS = "Open SuaviUI Options"
---@type table|AceAddon
SuaviUI = LibStub("AceAddon-3.0"):NewAddon("SuaviUI", "AceConsole-3.0", "AceEvent-3.0")
---@type table<string, string>
SuaviUI.L = LibStub("AceLocale-3.0"):GetLocale("SuaviUI")
local L = SuaviUI.L
---@type table
SuaviUI.DF = _G["DetailsFramework"]
SuaviUI.DEBUG_MODE = false
-- Version info
SuaviUI.versionString = C_AddOns.GetAddOnMetadata("SuaviUI", "Version") or "1.42"
---@type table
SuaviUI.defaults = {
global = {
welcomeScreenShown = false, -- Has the welcome screen been shown?
hideWelcomeScreen = false, -- User preference to hide welcome screen
},
char = {
---@type table
debug = {
---@type boolean
reload = false
}
}
}
function SuaviUI:OnInitialize()
---@type AceDBObject-3.0
self.db = LibStub("AceDB-3.0"):New("SuaviUI_DB", self.defaults, "Default")
self:RegisterChatCommand("SUI", "SlashCommandOpen")
self:RegisterChatCommand("suavi", "SlashCommandOpen")
self:RegisterChatCommand("suaviui", "SlashCommandOpen")
self:RegisterChatCommand("rl", "SlashCommandReload")
-- Register our media files with LibSharedMedia
self:CheckMediaRegistration()
end
-- Blizzard EncounterWarnings Edit Mode crash workaround (WoW 12.x)
-- EncounterWarningsViewElements:Init crashes with "attempt to compare a secret value"
-- because Edit Mode placeholder data contains protected nil fields.
-- Fix: noop SetIsEditing on the actual encounter warning frames.
-- Previous attempts failed because they patched a non-existent "EncounterWarnings" global;
-- the real frames are CriticalEncounterWarnings, MediumEncounterWarnings, MinorEncounterWarnings.
do
local names = { "CriticalEncounterWarnings", "MediumEncounterWarnings", "MinorEncounterWarnings" }
local function PatchFrames()
local allDone = true
for _, name in ipairs(names) do
-- WoW 12.0.5: frames may be forbidden. pcall each access.
local ok, frame = pcall(function() return _G[name] end)
if ok and frame then
local hasMethod = pcall(function() return frame.SetIsEditing end)
if hasMethod then
pcall(function() frame.SetIsEditing = function() end end)
end
elseif not ok or not frame then
allDone = false
end
end
return allDone
end
-- Blizzard addons load before third-party, so frames should exist now
if not PatchFrames() then
-- Fallback: wait for the addon to finish loading
local f = CreateFrame("Frame")
f:RegisterEvent("ADDON_LOADED")
f:SetScript("OnEvent", function(self, _, addon)
if addon == "Blizzard_EncounterWarnings" then
PatchFrames()
self:UnregisterAllEvents()
end
end)
end
end
-- Taint prevention notes (WoW 12.x)
-- =====================================
-- 1. Global-function guards (HealPrediction, RangeAlpha, NamePlate): REMOVED.
-- Replacing secure globals with insecure functions taints the entire global
-- table, causing cascading failures (5793+ nameplate crashes).
--
-- 2. ClearTaintedOutOfRange: REMOVED.
-- Writing frame.outOfRange = false from addon (insecure) context *directly*
-- taints the field, even when the intent is to "clear" a tainted value.
-- Any write from addon code is addon-tainted. The root taint source
-- (hooksecurefunc on CompactRaidFrameManager) was fixed with
-- RegisterStateDriver in uihider.lua, so the field should no longer
-- become tainted in the first place.
--
-- 3. The ONLY safe way to hide secure frames is RegisterStateDriver.
-- CooldownViewer secret-value crash recovery (WoW 12.x)
-- Blizzard's RefreshLayout does: ReleaseAll() → Acquire → RefreshData() → Layout().
-- When RefreshData hits a restricted spell (hero talent 442726 / cooldownID 33527),
-- the for-loop crashes. Items after the crash point never get cooldownIDs, AND
-- Layout() never runs — so ALL items (even those set up correctly) have no anchor
-- points and are invisible. Fix: assign cooldownIDs to orphaned items, show them,
-- set icon textures, and run Layout() to position everything.
do
local function IsSafeNumber(val)
if val == nil then return true end
local ok = pcall(function() return val + 0 end)
return ok
end
-- Check if a value is safely comparable (not a secret value)
local function IsSafeBool(val)
local ok = pcall(function() return val == true end)
return ok
end
local function SanitizeFrame(frame)
if not IsSafeNumber(frame.cooldownChargesCount) then frame.cooldownChargesCount = 0 end
if not IsSafeNumber(frame.previousCooldownChargesCount) then frame.previousCooldownChargesCount = 0 end
if not IsSafeNumber(frame.cooldownStartTime) then frame.cooldownStartTime = 0 end
if not IsSafeNumber(frame.cooldownDuration) then frame.cooldownDuration = 0 end
if not IsSafeNumber(frame.cooldownModRate) then frame.cooldownModRate = 1 end
if not IsSafeNumber(frame.availableAlertTriggerTime) then frame.availableAlertTriggerTime = nil end
if not IsSafeBool(frame.cooldownIsActive) then frame.cooldownIsActive = false end
if not IsSafeBool(frame.isOnActualCooldown) then frame.isOnActualCooldown = false end
if not IsSafeBool(frame.allowOnCooldownAlert) then frame.allowOnCooldownAlert = false end
if not IsSafeBool(frame.isActive) then frame.isActive = false end
if not IsSafeBool(frame.cooldownEnabled) then frame.cooldownEnabled = false end
if not IsSafeBool(frame.cooldownChargesShown) then frame.cooldownChargesShown = false end
end
local function RecoverViewer(viewer, category)
if not viewer then return end
-- viewer.itemFramePool is a Lua mixin property on a forbidden table
local okPool, pool = pcall(function() return viewer.itemFramePool end)
if not okPool or not pool then return end
-- Bypass forbidden mixin method: use global data provider directly
local cooldownIDs
if category then
pcall(function()
cooldownIDs = CooldownViewerSettings:GetDataProvider():GetOrderedCooldownIDsForCategory(category)
end)
end
if not cooldownIDs then
pcall(function() cooldownIDs = viewer:GetCooldownIDs() end)
end
for frame in pool:EnumerateActive() do
SanitizeFrame(frame)
-- Assign cooldownID to orphaned items (loop crashed before reaching them).
-- Set minimum state directly instead of calling Blizzard's SetCooldownID
-- to avoid triggering RefreshData in addon context.
if cooldownIDs and frame.layoutIndex and not frame.cooldownID then
local expectedID = cooldownIDs[frame.layoutIndex]
if expectedID then
frame.cooldownID = expectedID
pcall(function()
frame.cooldownInfo =
C_CooldownViewer.GetCooldownInfoByCooldownID(expectedID)
end)
frame.isActive = true
end
end
-- Show items that have a cooldownID but aren't visible
if frame.cooldownID and not frame:IsShown() then
pcall(frame.Show, frame)
end
-- Fix missing icon texture (RefreshSpellTexture never ran due to crash)
if frame.cooldownID and frame.Icon then
pcall(function()
if not frame.Icon:GetTexture() then
local info = frame.cooldownInfo
local sid = info and (info.overrideSpellID or info.spellID)
if sid then
local tex = C_Spell.GetSpellTexture(sid)
if tex then frame.Icon:SetTexture(tex) end
end
end
end)
end
end
-- CRITICAL: Re-run Layout() to set anchor points and position items.
-- RefreshLayout calls Layout() AFTER RefreshData, but if RefreshData crashes,
-- Layout() never runs. All items have cleared anchors (from ReleaseAll) and
-- are invisible even when shown. This one call fixes all positioning.
pcall(function()
local container = viewer.ItemContainer
if not container and viewer.GetItemContainerFrame then
container = viewer:GetItemContainerFrame()
end
if container and container.Layout then
container:Layout()
end
end)
end
local function RecoverAll()
-- Only recover Essential and Utility viewers.
-- BuffIcon and BuffBar use custom containers (Option C Phase 1+2).
local viewers = {
{ _G.EssentialCooldownViewer, Enum.CooldownViewerCategory.Essential },
{ _G.UtilityCooldownViewer, Enum.CooldownViewerCategory.Utility },
}
for _, pair in ipairs(viewers) do RecoverViewer(pair[1], pair[2]) end
end
-- Module-level hook-guard tables. Using frame fields (viewer._SUI_X = true) taints
-- the viewer frame table, causing Blizzard secure code to receive "secret values"
-- when reading any field on that frame. Store guards here instead.
local viewerRefreshDataHooked = {}
local viewerOnEventHooked = {}
local viewerItemEventsHooked = {}
local viewerOnUpdateHooked = {}
-- Proactive sanitization: PRE-hook RefreshData to sanitize BEFORE Blizzard's code runs
-- hooksecurefunc runs AFTER the original function, which is too late.
-- We replace the method with a wrapper that sanitizes first.
local function HookViewerRefreshData(viewer)
if not viewer or not viewer.RefreshData then return end
if viewerRefreshDataHooked[viewer] then return end
viewerRefreshDataHooked[viewer] = true
local originalRefreshData = viewer.RefreshData
viewer.RefreshData = function(self, ...)
-- Sanitize all active frames BEFORE Blizzard's code compares secret values
if self.itemFramePool then
for frame in self.itemFramePool:EnumerateActive() do
SanitizeFrame(frame)
end
end
return originalRefreshData(self, ...)
end
end
-- Hook individual item OnEvent/OnUpdate to sanitize before Blizzard code runs
-- CooldownViewer items share a mixin; their OnEvent calls RefreshData → crashes
local function HookViewerItemEvents(viewer)
if not viewer or viewerItemEventsHooked[viewer] then return end
if not viewer.itemFramePool then return end
-- Hook the OnEvent callback on the viewer to sanitize items beforehand
-- The viewer's OnEvent dispatches SPELL_UPDATE_COOLDOWN to each item's RefreshData
if viewer.OnEvent and not viewerOnEventHooked[viewer] then
viewerOnEventHooked[viewer] = true
local origOnEvent = viewer.OnEvent
viewer.OnEvent = function(self, event, ...)
-- Sanitize before any event processing
if self.itemFramePool then
for frame in self.itemFramePool:EnumerateActive() do
SanitizeFrame(frame)
end
end
return origOnEvent(self, event, ...)
end
end
viewerItemEventsHooked[viewer] = true
end
-- Hook viewer OnUpdate to sanitize isActive before Blizzard's per-item loop
-- CooldownViewerBuffBarItemMixin:OnUpdate does `if self:IsActive()` — crashes
-- when isActive is a secret value. We only check isActive here (not full
-- SanitizeFrame) because the OnUpdate path only gates on that one field.
local function HookViewerOnUpdate(viewer)
if not viewer or not viewer.OnUpdate then return end
if viewerOnUpdateHooked[viewer] then return end
viewerOnUpdateHooked[viewer] = true
local originalOnUpdate = viewer.OnUpdate
viewer.OnUpdate = function(self, elapsed, ...)
if self.itemFramePool then
for frame in self.itemFramePool:EnumerateActive() do
if not IsSafeBool(frame.isActive) then
frame.isActive = false
end
end
end
return originalOnUpdate(self, elapsed, ...)
end
end
-- Hook all CDM viewers on load
local function HookAllViewers()
-- Only hook Essential and Utility viewers.
-- BuffIcon and BuffBar viewers use custom containers (Option C Phase 1+2)
-- and no longer need crash recovery. Wrapping their methods would
-- unnecessarily taint their method tables.
local viewers = {
_G.EssentialCooldownViewer, _G.UtilityCooldownViewer,
}
for _, v in ipairs(viewers) do
if v then
HookViewerRefreshData(v)
HookViewerItemEvents(v)
HookViewerOnUpdate(v)
end
end
-- Also sanitize all currently active item frames
for _, viewer in ipairs(viewers) do
if viewer and viewer.itemFramePool then
for frame in viewer.itemFramePool:EnumerateActive() do
SanitizeFrame(frame)
end
end
end
end
-- CDM crash recovery: DISABLED (WoW 12.0.5 patch)
-- Blizzard made CooldownViewer frame internals forbidden to addon access.
-- Indexing viewer.itemFramePool or frame fields causes
-- "attempted to index a forbidden table" errors (24x per session).
-- The method-replacement approach (RefreshData/OnEvent/OnUpdate wrappers)
-- is also a taint source. BuffBar/BuffIcon have custom containers;
-- Essential/Utility will need monitoring for issues without this recovery.
local DISABLE_CRASH_RECOVERY = true
if not DISABLE_CRASH_RECOVERY then
-- Install proactive hooks immediately
HookAllViewers()
-- Re-hook after ADDON_LOADED in case viewers reload
local hookFrame = CreateFrame("Frame")
hookFrame:RegisterEvent("ADDON_LOADED")
hookFrame:SetScript("OnEvent", function(_, _, addon)
if addon == "Blizzard_CooldownViewer" then
C_Timer.After(0.5, HookAllViewers)
end
end)
local ticker
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_REGEN_DISABLED")
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(_, event)
if event == "PLAYER_REGEN_DISABLED" then
-- Viewer just became visible → RefreshLayout → crash → no Layout()
C_Timer.After(0.05, RecoverAll)
C_Timer.After(0.15, RecoverAll)
C_Timer.After(0.5, RecoverAll)
-- Keep recovering during combat (subsequent event crashes)
if ticker then ticker:Cancel() end
ticker = C_Timer.NewTicker(2.0, RecoverAll)
elseif event == "PLAYER_REGEN_ENABLED" then
if ticker then ticker:Cancel(); ticker = nil end
C_Timer.After(0.5, RecoverAll)
elseif event == "PLAYER_ENTERING_WORLD" then
C_Timer.After(1.0, RecoverAll)
end
end)
end -- if not DISABLE_CRASH_RECOVERY
end
-- Quick Keybind Mode shortcut (/kb)
SLASH_SUIKB1 = "/kb"
SlashCmdList["SUIKB"] = function()
local LibKeyBound = LibStub("LibKeyBound-1.0", true)
if LibKeyBound then
LibKeyBound:Toggle()
elseif QuickKeybindFrame then
-- Fallback to Blizzard's Quick Keybind Mode (no mousewheel support)
ShowUIPanel(QuickKeybindFrame)
else
print("|cff34D399SuaviUI:|r Quick Keybind Mode not available.")
end
end
-- Cooldown Settings shortcut (/cdm)
SLASH_SUAVIUI_CDM1 = "/cdm"
SlashCmdList["SUAVIUI_CDM"] = function()
if CooldownViewerSettings then
CooldownViewerSettings:SetShown(not CooldownViewerSettings:IsShown())
else
print("|cff34D399SuaviUI:|r Cooldown Settings not available. Enable CDM first.")
end
end
-- Edit Mode shortcuts (/em and /ed)
SLASH_SUAVIUI_EM1 = "/em"
SLASH_SUAVIUI_EM2 = "/ed"
SlashCmdList["SUAVIUI_EM"] = function()
if EditModeManagerFrame then
-- Toggle Edit Mode visibility directly
if EditModeManagerFrame:IsShown() then
EditModeManagerFrame:Hide()
else
EditModeManagerFrame:Show()
end
else
print("|cff34D399SuaviUI:|r Edit Mode not available.")
end
end
function SuaviUI:SlashCommandOpen(input)
if input and input == "debug" then
self.db.char.debug.reload = true
SuaviUI:SafeReload()
elseif input and input == "editmode" then
-- Toggle Unit Frames Edit Mode
if _G.SuaviUI_ToggleUnitFrameEditMode then
_G.SuaviUI_ToggleUnitFrameEditMode()
else
print("|cFFFF6AC1SuaviUI:|r Unit Frames module not loaded.")
end
return
end
-- Default: Open custom GUI
if self.GUI then
self.GUI:Toggle()
else
print("|cFFFF6AC1SuaviUI:|r GUI not loaded yet. Try again in a moment.")
end
end
function SuaviUI:SafeReload()
if InCombatLockdown() then
print("|cFFFF6AC1SuaviUI:|r Cannot reload during combat.")
return
end
ReloadUI()
end
function SuaviUI:SlashCommandReload()
SuaviUI:SafeReload()
end
function SuaviUI:OnEnable()
self:RegisterEvent("PLAYER_ENTERING_WORLD")
-- Initialize SUICore (AceDB-based integration)
if self.SUICore then
-- Show intro message if enabled (defaults to true)
if self.db.profile.chat.showIntroMessage ~= false then
print("|cFFFF6AC1Suavi UI|r ready. Type |cFFFFFF00/sui|r to open settings.")
end
end
end
function SuaviUI:PLAYER_ENTERING_WORLD(_, isInitialLogin, isReloadingUi)
SuaviUI:BackwardsCompat()
-- Ensure debug table exists
if not self.db.char.debug then
self.db.char.debug = { reload = false }
end
if not self.DEBUG_MODE then
if self.db.char.debug.reload then
self.DEBUG_MODE = true
self.db.char.debug.reload = false
self:DebugPrint("Debug Mode Enabled")
end
else
self:DebugPrint("Debug Mode Enabled")
end
end
function SuaviUI:DebugPrint(...)
if self.DEBUG_MODE then
self:Print(...)
end
end
---------------------------------------------------------------------------
-- SUAVIUI WHISPERS
-- Random friendly whispers shown on login and periodically during play
---------------------------------------------------------------------------
do
local messages = {
"SuaviUI loves you.",
"Remember to drink water.",
"You're doing great today.",
"Stretch your wrists. They deserve it.",
"Every wipe is a lesson.",
"Good posture = good DPS.",
"Your UI looks amazing, by the way.",
"Take a deep breath. The boss will wait.",
"Today is your day to shine.",
"Eyes off the screen for 20 seconds. Go.",
"You're braver than you believe.",
"Snack break? Snack break.",
"The Loot Council believes in you.",
"Stand up. Walk around. Come back stronger.",
"RNG is temporary. Skill is forever.",
"Your raid group is lucky to have you.",
"Don't forget to have fun.",
"Keyboard clean? Mouse clean? Soul clean?",
"You've got this. Pull the boss.",
"Blinking is a DPS increase. Trust me.",
}
local lastIndex = 0
local function IsEnabled()
local SUICore = _G.SuaviUI and _G.SuaviUI.SUICore
if SUICore and SUICore.db and SUICore.db.profile and SUICore.db.profile.general then
local val = SUICore.db.profile.general.suaviWhispers
if val == nil then return true end -- default on
return val
end
return true
end
local function ShowWhisper()
if not IsEnabled() then return end
local idx
repeat
idx = math.random(1, #messages)
until idx ~= lastIndex or #messages == 1
lastIndex = idx
-- Whisper style: looks like a whisper from "SuaviUI"
local WHISPER_COLOR = "|cffFF6AC1"
local TAG = WHISPER_COLOR .. "[SuaviUI] whispers:|r "
local MSG_COLOR = "|cffEFF0EB"
DEFAULT_CHAT_FRAME:AddMessage(TAG .. MSG_COLOR .. messages[idx] .. "|r")
end
-- Show one on login, then every 30-45 minutes
local loginFrame = CreateFrame("Frame")
loginFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
loginFrame:SetScript("OnEvent", function(self, _, isInitialLogin)
if not isInitialLogin then return end
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
C_Timer.After(15, ShowWhisper)
local interval = 1800 + math.random(0, 900)
C_Timer.NewTicker(interval, ShowWhisper)
end)
end
-- ADDON COMPARTMENT FUNCTIONS --
function SuaviUI_CompartmentClick(addonName, buttonName)
if buttonName == "RightButton" then
-- Right-click context menu
MenuUtil.CreateContextMenu(nil, function(owner, rootDescription)
rootDescription:SetTag("SUAVIUI_COMPARTMENT")
rootDescription:CreateTitle("|cFF30D1FFSuaviUI|r")
rootDescription:CreateButton("SuaviUI Settings", function()
if SuaviUI.GUI then SuaviUI.GUI:Toggle() end
end)
rootDescription:CreateButton("CDM Settings", function()
if CooldownViewerSettings then
CooldownViewerSettings:SetShown(not CooldownViewerSettings:IsShown())
end
end)
rootDescription:CreateButton("Edit Mode", function()
if EditModeManagerFrame then
if EditModeManagerFrame:IsShown() then
EditModeManagerFrame:Hide()
else
EditModeManagerFrame:Show()
end
end
end)
rootDescription:CreateDivider()
rootDescription:CreateButton("|cffff6666Reload UI|r", function()
ReloadUI()
end)
end)
return
end
-- Left click: open options
if SuaviUI.GUI then
SuaviUI.GUI:Toggle()
end
end
local GameTooltip = GameTooltip
function SuaviUI_CompartmentOnEnter(self, button)
GameTooltip:ClearLines()
GameTooltip:SetOwner(type(self) ~= "string" and self or button, "ANCHOR_LEFT")
GameTooltip:AddLine(L["AddonName"] .. " v" .. SuaviUI.versionString)
GameTooltip:AddLine("|cffFFFFFFLeft Click:|r Open Settings", 0.2, 1, 0.2)
GameTooltip:AddLine("|cffFFFFFFRight Click:|r Quick Menu", 0.2, 1, 0.2)
GameTooltip:Show()
end
function SuaviUI_CompartmentOnLeave()
GameTooltip:Hide()
end