|
1 | 1 | local name, _ = ...; |
| 2 | +local displayName = 'Talent Tree Viewer'; |
2 | 3 |
|
3 | | -if LE_EXPANSION_LEVEL_CURRENT <= LE_EXPANSION_SHADOWLANDS then print(name, 'only works on Dragonflight and later') return; end |
| 4 | +if LE_EXPANSION_LEVEL_CURRENT <= LE_EXPANSION_SHADOWLANDS then print(displayName, 'only works on Dragonflight and later') return; end |
4 | 5 |
|
5 | 6 | --- @class TalentViewerLoader |
6 | 7 | local TVLoader = {}; |
@@ -41,42 +42,42 @@ function TVLoader:OnInitialize() |
41 | 42 | end |
42 | 43 |
|
43 | 44 | local dataObject = LibStub('LibDataBroker-1.1'):NewDataObject( |
44 | | - name, |
| 45 | + displayName, |
45 | 46 | { |
46 | 47 | type = 'launcher', |
47 | | - text = 'Talent Tree Viewer', |
| 48 | + text = displayName, |
48 | 49 | icon = 'interface/icons/inv_inscription_talenttome01.blp', |
49 | 50 | OnClick = function() |
50 | 51 | if IsShiftKeyDown() then |
51 | 52 | self.db.ldbOptions.hide = true; |
52 | | - LibDBIcon:Hide(name); |
| 53 | + LibDBIcon:Hide(displayName); |
53 | 54 | print(L['Minimap button hidden. Use |cffeda55f/tv reset|r to restore.']); |
54 | 55 |
|
55 | 56 | return; |
56 | 57 | end |
57 | 58 | self:ToggleTalentView(); |
58 | 59 | end, |
59 | 60 | OnTooltipShow = function(tooltip) |
60 | | - tooltip:AddLine('Talent Tree Viewer'); |
| 61 | + tooltip:AddLine(displayName); |
61 | 62 | tooltip:AddLine(L['|cffeda55fClick|r to view the talents for any spec.']); |
62 | 63 | tooltip:AddLine(L['|cffeda55fShift-Click|r to hide this button. (|cffeda55f/tv reset|r to restore)']); |
63 | 64 | end, |
64 | 65 | } |
65 | 66 | ); |
66 | | - LibDBIcon:Register(name, dataObject, self.db.ldbOptions); |
67 | | - LibDBIcon:AddButtonToCompartment(name); |
| 67 | + LibDBIcon:Register(displayName, dataObject, self.db.ldbOptions); |
| 68 | + LibDBIcon:AddButtonToCompartment(displayName); |
68 | 69 |
|
69 | 70 | SLASH_TALENT_VIEWER1 = '/tv'; |
70 | 71 | SLASH_TALENT_VIEWER2 = '/talentviewer'; |
71 | 72 | SLASH_TALENT_VIEWER3 = '/talenttreeviewer'; |
72 | 73 | SlashCmdList['TALENT_VIEWER'] = function(message) |
73 | 74 | if message == 'reset' then |
74 | | - wipe(TalentViewer.db.ldbOptions); |
75 | | - TalentViewer.db.ldbOptions.hide = false; |
76 | | - TalentViewer.db.lastSelected = nil; |
| 75 | + wipe(self.db.ldbOptions); |
| 76 | + self.db.ldbOptions.hide = false; |
| 77 | + self.db.lastSelected = nil; |
77 | 78 |
|
78 | | - LibDBIcon:Hide(name); |
79 | | - LibDBIcon:Show(name); |
| 79 | + LibDBIcon:Hide(displayName); |
| 80 | + LibDBIcon:Show(displayName); |
80 | 81 |
|
81 | 82 | return; |
82 | 83 | end |
|
0 commit comments