@@ -4,6 +4,7 @@ local name, ns = ...;
44local Config = {}
55ns .Config = Config ;
66
7+ --- @enum TUM_Config_ModifierKeyOptions
78Config .modifierKeyOptions = {
89 always = " always" ,
910 shift = " shift" ,
@@ -12,6 +13,7 @@ Config.modifierKeyOptions = {
1213 never = " never" ,
1314};
1415
16+ --- @enum TUM_Config_AutoConfirmCatalystOptions
1517Config .autoConfirmCatalystOptions = {
1618 never = " never" ,
1719 previousSeason = " previousSeason" ,
@@ -27,34 +29,47 @@ Config.settingKeys = {
2729 warbandCatalystClassList = " warbandCatalystClassList" ,
2830 autoConfirmCatalyst = " autoConfirmCatalyst" ,
2931 debug = " debug" ,
32+ UI_treatOtherItemAsCollected = " UI_treatOtherItemAsCollected" ,
3033};
3134
35+ --- @return TUM_DB
3236function Config :Init ()
33- TransmogUpgradeMasterDB = TransmogUpgradeMasterDB or {};
34- self .db = TransmogUpgradeMasterDB ;
37+ --- @class TUM_DB
3538 local defaults = {
36- [self .settingKeys .hideWhenCollected ] = false ,
37- [self .settingKeys .debug ] = false ,
38- [self .settingKeys .showCollectedModifierKey ] = self .modifierKeyOptions .always ,
39- [self .settingKeys .showCollectedFromOtherItemModifierKey ] = self .modifierKeyOptions .always ,
40- [self .settingKeys .showUncollectedModifierKey ] = self .modifierKeyOptions .always ,
41- [self .settingKeys .showWarbandCatalystInfoModifierKey ] = self .modifierKeyOptions .shift ,
42- [self .settingKeys .warbandCatalystClassList ] = {},
43- [self .settingKeys .autoConfirmCatalyst ] = self .autoConfirmCatalystOptions .previousSeason ,
39+ --- @type boolean
40+ hideWhenCollected = false ,
41+ --- @type boolean
42+ debug = false ,
43+ --- @type TUM_Config_ModifierKeyOptions
44+ showCollectedModifierKey = self .modifierKeyOptions .always ,
45+ --- @type TUM_Config_ModifierKeyOptions
46+ showCollectedFromOtherItemModifierKey = self .modifierKeyOptions .always ,
47+ --- @type TUM_Config_ModifierKeyOptions
48+ showUncollectedModifierKey = self .modifierKeyOptions .always ,
49+ --- @type TUM_Config_ModifierKeyOptions
50+ showWarbandCatalystInfoModifierKey = self .modifierKeyOptions .shift ,
51+ --- @type table<number , boolean> # [classID] = true/false
52+ warbandCatalystClassList = {},
53+ --- @type TUM_Config_AutoConfirmCatalystOptions
54+ autoConfirmCatalyst = self .autoConfirmCatalystOptions .previousSeason ,
55+ --- @type boolean
56+ UI_treatOtherItemAsCollected = false ,
4457 };
58+ TransmogUpgradeMasterDB = TransmogUpgradeMasterDB or {};
59+ self .db = TransmogUpgradeMasterDB ;
4560 for k , v in pairs (defaults ) do
4661 if self .db [k ] == nil then
47- if k == self . settingKeys . showCollectedFromOtherItemModifierKey then
48- self .db [k ] = (self .db [ self . settingKeys . showUncollectedModifierKey ] or v );
62+ if k == " showCollectedFromOtherItemModifierKey" then
63+ self .db [k ] = (self .db . showUncollectedModifierKey or v );
4964 else
5065 self .db [k ] = v ;
5166 end
5267 end
5368 end
5469 for classID = 1 , GetNumClasses () do
55- defaults [ self . settingKeys . warbandCatalystClassList ] [classID ] = true ;
56- if self .db [ self . settingKeys . warbandCatalystClassList ] [classID ] == nil then
57- self .db [ self . settingKeys . warbandCatalystClassList ] [classID ] = true ;
70+ defaults . warbandCatalystClassList [classID ] = true ;
71+ if self .db . warbandCatalystClassList [classID ] == nil then
72+ self .db . warbandCatalystClassList [classID ] = true ;
5873 end
5974 end
6075
@@ -120,7 +135,7 @@ function Config:Init()
120135 local expandInitializer , isExpanded = self :MakeExpandableSection (" Displayed Classes" )
121136
122137 local function isVisible ()
123- return self .db [ self . settingKeys . showWarbandCatalystInfoModifierKey ] ~= self .modifierKeyOptions .never ;
138+ return self .db . showWarbandCatalystInfoModifierKey ~= self .modifierKeyOptions .never ;
124139 end
125140 expandInitializer :AddShownPredicate (isVisible );
126141 layout :AddInitializer (expandInitializer );
@@ -134,9 +149,9 @@ function Config:Init()
134149 category ,
135150 label ,
136151 classID ,
137- defaults [ self . settingKeys . warbandCatalystClassList ] [classID ],
152+ defaults . warbandCatalystClassList [classID ],
138153 tooltip :format (classColor :WrapTextInColorCode (className )),
139- self .db [ self . settingKeys . warbandCatalystClassList ]
154+ self .db . warbandCatalystClassList
140155 );
141156 classCheckbox :SetParentInitializer (showWarbandInfo , isVisible );
142157 classCheckbox :AddShownPredicate (isVisible );
@@ -178,6 +193,19 @@ function Config:Init()
178193 " Reset the Transmog cache. This will cause the addon to re-cache all items, which may take a minute or so. This can fix rare situations when transmog changes are hotfixed in by blizzard."
179194 )
180195
196+ self :MakeButton (
197+ category ,
198+ layout ,
199+ " Open Collections UI" ,
200+ function ()
201+ TUM .UI :ToggleUI ();
202+ end ,
203+ string.format (
204+ " Open the Collections UI, you can also type %s in chat, or click on the Addon Compartment button to open this UI." ,
205+ GREEN_FONT_COLOR :WrapTextInColorCode (" /tum" )
206+ )
207+ )
208+
181209 Settings .RegisterAddOnCategory (category )
182210
183211 return self .db ;
279307--- @class TransmogUpgradeMaster_SettingsButtonControlMixin : SettingsControlMixin
280308TransmogUpgradeMaster_SettingsButtonControlMixin = CreateFromMixins (SettingsControlMixin );
281309do
282- local function InitializeSettingTooltip (initializer )
283- Settings .InitTooltip (initializer :GetName (), initializer :GetTooltip ());
284- end
285-
286310 local mixin = TransmogUpgradeMaster_SettingsButtonControlMixin ;
287311 function mixin :OnLoad ()
288312 SettingsControlMixin .OnLoad (self );
297321 self .Button :SetText (self .data .buttonText );
298322 self .Button :SetScript (" OnClick" , self .data .OnButtonClick );
299323 self .Button :SetScript (" OnEnter" , function (button )
300- GameTooltip :SetOwner (button , " ANCHOR_RIGHT" );
301- InitializeSettingTooltip (initializer );
324+ GameTooltip :SetOwner (button , " ANCHOR_TOP" );
325+ GameTooltip_AddHighlightLine (GameTooltip , initializer :GetName ());
326+ GameTooltip_AddNormalLine (GameTooltip , initializer :GetTooltip ());
302327 GameTooltip :Show ();
303328 end );
304329 self .Button :SetScript (" OnLeave" , function () GameTooltip :Hide (); end );
0 commit comments