@@ -57,6 +57,21 @@ UPM:SetScript('OnEvent', function(self, event, ...)
5757end );
5858UPM :RegisterEvent (' ADDON_LOADED' );
5959
60+ do
61+ function UnifiedProfileManager_OnAddonCompartmentClick ()
62+ UPM :OpenConfigUI ();
63+ end
64+ function UnifiedProfileManager_OnAddonCompartmentEnter (_ , button )
65+ GameTooltip :SetOwner (button , ' ANCHOR_RIGHT' );
66+ GameTooltip :SetText (' Unified Profile Manager' );
67+ GameTooltip :AddLine (CreateAtlasMarkup (' NPE_LeftClick' , 18 , 18 ) .. ' to manage your profiles' , 1 , 1 , 1 );
68+ GameTooltip :Show ();
69+ end
70+ function UnifiedProfileManager_OnAddonCompartmentLeave ()
71+ GameTooltip :Hide ();
72+ end
73+ end
74+
6075function UPM :ADDON_LOADED ()
6176 if NumyProfiler then
6277 --- @type NumyProfiler
@@ -92,24 +107,26 @@ function UPM:ADDON_LOADED()
92107
93108 _G .SLASH_UNIFIED_PROFILE_MANAGER1 = ' /upm' ;
94109 _G .SLASH_UNIFIED_PROFILE_MANAGER2 = ' /profiles' ;
95- SlashCmdList [' UNIFIED_PROFILE_MANAGER' ] = function ()
96- AceConfig :RegisterOptionsTable (name , self :GetOptionsTable ());
97- AceConfigDialog :Open (name );
98- local container = AceConfigDialog .OpenFrames [name ];
99- if not container or not container .frame then return ; end
100- container :SetTitle (' Unified Profile Manager' );
101- container .SetTitle = nop ;
102- local frame = container .frame ;
103- frame :SetMovable (true );
104- frame :SetScript (' OnMouseDown' , function (self )
105- self :StartMoving ();
106- end );
107- frame :SetScript (' OnMouseUp' , function (self )
108- self :StopMovingOrSizing ();
109- end );
110- frame .ClearAllPoints = nop ;
111- frame .SetPoint = nop ;
112- end ;
110+ SlashCmdList [' UNIFIED_PROFILE_MANAGER' ] = function () UPM :OpenConfigUI (); end ;
111+ end
112+
113+ function UPM :OpenConfigUI ()
114+ AceConfig :RegisterOptionsTable (name , self :GetOptionsTable ());
115+ AceConfigDialog :Open (name );
116+ local container = AceConfigDialog .OpenFrames [name ];
117+ if not container or not container .frame then return ; end
118+ container :SetTitle (' Unified Profile Manager' );
119+ container .SetTitle = nop ;
120+ local frame = container .frame ;
121+ frame :SetMovable (true );
122+ frame :SetScript (' OnMouseDown' , function (self )
123+ self :StartMoving ();
124+ end );
125+ frame :SetScript (' OnMouseUp' , function (self )
126+ self :StopMovingOrSizing ();
127+ end );
128+ frame .ClearAllPoints = nop ;
129+ frame .SetPoint = nop ;
113130end
114131
115132UPM .resultCache = {};
0 commit comments