forked from j-blandford/BetterUI
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Globals.lua
106 lines (84 loc) · 2.04 KB
/
Globals.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
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
BUI = {}
BUI.name = "BetterUI"
BUI.version = "2.49"
-- Program Global (scope of BUI, though) variable initialization
BUI.WindowManager = GetWindowManager()
BUI.EventManager = GetEventManager()
-- pseudo-Class definitions
BUI.CONST = {}
--BUI.Lib = {}
BUI.CIM = {}
BUI.GenericHeader = {}
BUI.GenericFooter = {}
BUI.Interface = {}
BUI.Interface.Window = {}
BUI.Store = {
Class = {},
Window = {},
List = {},
Buy = {}
}
BUI.Inventory = {
List = {},
Class = {}
}
BUI.Writs = {
List = {}
}
BUI.GuildStore = {
Browse = {},
BrowseResults = {},
Listings = {},
Sell = {}
}
BUI.Banking = {
Class = {}
}
BUI.Tooltips = {
}
BUI.Player = {
ResearchTraits = {}
}
BUI.Settings = {}
BUI.Helper = {
GamePadBuddy = {},
IokaniGearChanger = {},
AutoCategory = {},
}
BUI.DefaultSettings = {
firstInstall = true,
Modules = {
["*"] = { -- Module setting template
m_enabled = false,
m_setup = function() end,
}
}
}
function ddebug(str)
return d("|c0066ff[BUI]|r "..str)
end
-- Thanks to Bart Kiers for this function :)
function BUI.DisplayNumber(number)
local i, j, minus, int, fraction = tostring(number):find('([-]?)(%d+)([.]?%d*)')
-- reverse the int-string and append a comma to all blocks of 3 digits
int = int:reverse():gsub("(%d%d%d)", "%1,")
-- reverse the int-string back remove an optional comma and put the
-- optional minus and fractional part back
return minus .. int:reverse():gsub("^,", "") .. fraction
end
function Init_ModulePanel(moduleName, moduleDesc)
return {
type = "panel",
name = "|t24:24:/esoui/art/buttons/gamepad/xbox/nav_xbone_b.dds|t "..BUI.name.." ("..moduleName..")",
displayName = "|c0066ffBETTERUI|r :: "..moduleDesc,
author = "prasoc, RockingDice",
version = BUI.version,
slashCommand = "/bui",
registerForRefresh = true,
registerForDefaults = true
}
end
ZO_Store_OnInitialize_Gamepad = function(...) end
-- Imagery, you dont need to localise these strings
ZO_CreateStringId("SI_BUI_INV_EQUIP_TEXT_HIGHLIGHT","|cFF6600<<1>>|r")
ZO_CreateStringId("SI_BUI_INV_EQUIP_TEXT_NORMAL","|cCCCCCC<<1>>|r")