-
Notifications
You must be signed in to change notification settings - Fork 2
/
PersonalPlayerNotesUtils.lua
58 lines (47 loc) · 1.8 KB
/
PersonalPlayerNotesUtils.lua
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
local personalPlayerNotes = ...
local L = LibStub("AceLocale-3.0"):GetLocale(personalPlayerNotes, true)
function PersonalPlayerNotes:GetVersion()
return tostring(C_AddOns.GetAddOnMetadata(personalPlayerNotes, "Version")) or L["PPN_NA"];
end
function PersonalPlayerNotes:GetTitle()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "Title") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetAuthor()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "Author") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetNotes()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "Notes") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetLocalizations()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "X-Localizations") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetCategory()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "X-Category") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetWebsite()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "X-Website") or L["PPN_NA"];
end
function PersonalPlayerNotes:GetLicense()
return C_AddOns.GetAddOnMetadata(personalPlayerNotes, "X-License") or L["PPN_NA"];
end
function PersonalPlayerNotes:AceGUIDefaults()
local aceGUI = LibStub("AceGUI-3.0"):Create("Frame")
aceGUI:SetCallback("OnClose", function(widget) aceGUI:Release() end)
aceGUI:SetLayout("Fill")
aceGUI:SetStatusText(nil)
aceGUI.statustext:Hide()
aceGUI.statustext:GetParent():Hide()
aceGUI:Hide()
return aceGUI
end
function PersonalPlayerNotes:Print(...)
if (self.db and self.db.profile.debug) then
return print(L["PPN_DEBUG"], ...)
end
return print(L["PPN_PRINT"], ...)
end
function PersonalPlayerNotes:PrintDebug(...)
if (self.db and self.db.profile.debug) then
self:Print(...)
end
end