This repository has been archived by the owner on Apr 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUberInventory_globals.lua
executable file
·253 lines (221 loc) · 10.4 KB
/
UberInventory_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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
--[[ =================================================================
Description:
All globals used within UberInventory.
================================================================= --]]
-- Colors used within UberInventory
C_GOLD = "|cFFFFD700";
C_SILVER = "|cFFC7C7CF";
C_COPPER = "|cFFEDA55F";
C_GREEN = "|cFF00FF00";
C_WHITE = "|cFFFFFFFF";
C_BLUE = "|cFF3366FF";
C_RED = "|cFFFF5533";
C_YELLOW = "|cFFFFFF00";
C_GREY = "|cFFAAAAAA";
C_CLOSE = "|r";
-- Image path
UBI_IMG_PATH = "Interface\\AddOns\\UberInventory\\artwork\\";
-- Custom textures
UBI_SIGMA_ICON = "|T"..UBI_IMG_PATH.."sigma:0|t";
-- Events tracked by UBI
UBI_TRACKED_EVENTS = { -- Startup events
"PLAYER_LOGIN",
"PLAYER_LOGOUT",
"ADDON_LOADED",
-- Character event (equipped items)
"UNIT_INVENTORY_CHANGED",
-- Bank events
"BANKFRAME_OPENED",
"BANKFRAME_CLOSED",
"PLAYERBANKSLOTS_CHANGED",
"PLAYERBANKBAGSLOTS_CHANGED",
-- Guildbank events
"GUILDBANKFRAME_OPENED",
"GUILDBANKFRAME_CLOSED",
"GUILDBANK_UPDATE_MONEY",
-- "GUILDBANK_UPDATE_WITHDRAWMONEY",
-- Mailbox events
"MAIL_SHOW",
"MAIL_INBOX_UPDATE",
"MAIL_SUCCESS",
-- Player events
"PLAYER_ENTERING_WORLD",
"PLAYER_LEAVING_WORLD",
-- Chat events
"CHAT_MSG_ADDON",
-- Currency events
"PLAYER_MONEY",
"CURRENCY_DISPLAY_UPDATE",
-- Miscellaneous events
"PLAYER_LEVEL_UP",
-- Void Storage
"VOID_STORAGE_OPEN",
"VOID_STORAGE_CLOSE",
"VOID_STORAGE_UPDATE",
"VOID_TRANSFER_DONE",
"VOID_STORAGE_CONTENTS_UPDATE",
-- Pandarian toon has selected faction
"NEUTRAL_FACTION_SELECT_RESULT",
-- Reagents
"REAGENTBANK_UPDATE",
"PLAYERREAGENTBANKSLOTS_CHANGED",
};
-- Drop rates
UBI_Droprates = { "1%-2%" , -- Extremely low
"3%-14%" , -- Very low
"15%-24%" , -- Low
"25%-50%" , -- Medium
"51%-99%" , -- High
"100%" }; -- Guaranteed
-- Global variables
UBI = _G["UBI"]; -- AddOn object itself
UBI_NAME = GetAddOnMetadata( "UberInventory", "Title" );
UBI_VERSION = GetAddOnMetadata( "UberInventory", "Version" );
UBI_NAME_VERSION = UBI_NAME.." - "..UBI_VERSION;
UBI_TOKEN = TOKENS.." (%s)";
UBI_REALM = GetRealmName();
UBI_PLAYER = UnitName( "player" );
UBI_PLAYER_CLASS = UnitClass( "player" );
UBI_PLAYER_RACE = UnitRace( "player" );
UBI_GUILD = nil;
UBI_FACTION = UnitFactionGroup( "player" );
UBI_EMPTY_TEXT = "---";
UBI_MAILBOX_OPEN = false; -- Is the mailbox open?
UBI_BANK_OPEN = false; -- Is the bank open?
UBI_GUILDBANK_VIEWACCESS = true; -- View access to all guildbank tabs?
UBI_GUILDBANK_OPENED = false; -- Has the guildbank been opened during current session
UBI_GUILDBANK_FORCED = false; -- Force receiving of guildbank data (when requesting data manually)
UBI_SEC_IN_DAY = 60 * 60 * 24; -- The number of seconds in a day
UBI_VERSION_WARNING = false; -- Received version warning
UBI_TooltipItem = nil; -- Filled from main inventory frame (used to show correct counts when showing alt information)
UBI_TooltipLocation = nil; -- Filled from main inventory frame (used to hide alt if the alt is viewed)
UBI_CHECK_DATE = date( "%Y%m%d" ); -- Date when last daily check has been performed
UBI_PROCESSING_GB = false; -- Currently processing/saving GB data
UBI_MINIMAP_ANGLE = nil; -- Current angle for the minimap
UBI_ACTIVE = true;
UBI_BATTLEPET_CLASS = GetItemClassInfo(17);
-- Alts and Guildbanks
UBI_Characters = {}; -- Used for list of alt characters
UBI_Guildbanks = {}; -- Used for list of guildbanks
UBI_Guildbank = {}; -- Shortcut for guildbank data for current realm
UBI_LocationList = {}; -- Used to track all locations combined
UBI_LocationCounter = 0; -- Used to track the number of items in location dropdownbox
-- Globals for receiving guildbank data
UBI_GBData = {}; -- Array for receiving guildbank data through the guild chat channel
UBI_GBSender = nil; -- Who is sending guildbank data (only the latest player is tracked)
-- Days between collection events before message is displayed to visit mailbox, bank or guildbank
UBI_MAILBOX_VISIT_INTERVAL = 21; -- in days
UBI_BANK_VISIT_INTERVAL = 30; -- in days
UBI_GUILDBANK_VISIT_INTERVAL = 14; -- in days
-- When should expiring mail be reported
UBI_MAIL_EXPIRE_WARNING = 5; -- in days
-- Filter settings
UBI_FILTER_TEXT = ""; -- Default no search string
UBI_FILTER_LOCATIONS = 3; -- Default all items
UBI_FILTER_QUALITY = 1; -- Default all qualities
UBI_FILTER_CLASSES = 1; -- Default all classes
UBI_FILTER_SUBCLASSES = 0; -- Default no subclass
UBI_FILTER_USABLE = false; -- Only show usable items
UBI_SCAN_DATE = time(); -- Latest inventory scan
UBI_Filter = { text = nil,
location = nil,
quality = nil,
class = nil,
subclass = nil,
usable = nil,
date = nil }; -- Track current search settings
-- Equip slots
UBI_EQUIP_SLOTS = { "HeadSlot",
"NeckSlot",
"ShoulderSlot",
"BackSlot",
"ChestSlot",
"ShirtSlot",
"TabardSlot",
"WristSlot",
"HandsSlot",
"WaistSlot",
"LegsSlot",
"FeetSlot",
"Finger0Slot",
"Finger1Slot",
"Trinket0Slot",
"Trinket1Slot",
"MainHandSlot",
"SecondaryHandSlot" }; -- AmmoSlot is excluded, counts as 1 regardless number of arrows/bullets are linked
-- Container objects
UI_CONTAINER_OBJECTS = { [-1] = BankFrame,
[0] = MainMenuBarBackpackButton,
[1] = CharacterBag0Slot,
[2] = CharacterBag1Slot,
[3] = CharacterBag2Slot,
[4] = CharacterBag3Slot,
[5] = BankSlotsFrame["Bag1"],
[6] = BankSlotsFrame["Bag2"],
[7] = BankSlotsFrame["Bag3"],
[8] = BankSlotsFrame["Bag4"],
[9] = BankSlotsFrame["Bag5"],
[10] = BankSlotsFrame["Bag6"],
[11] = BankSlotsFrame["Bag7"]
};
UBI_Highlights = {};
-- Quality names (using Blizzards localized strings) and colors
UBI_QUALITY = { ITEM_QUALITY0_DESC,
ITEM_QUALITY1_DESC,
ITEM_QUALITY2_DESC,
ITEM_QUALITY3_DESC,
ITEM_QUALITY4_DESC,
ITEM_QUALITY5_DESC,
ITEM_QUALITY6_DESC,
ITEM_QUALITY7_DESC,
ITEM_QUALITY8_DESC };
ITEM_QUALITY_COLORS[-1] = ITEM_QUALITY_COLORS[6]; -- Set color for 'All qualities'
-- Location texture (Guildbank image dynamic based on faction)
UBI_LOCATION_TEXTURE = { UBI_IMG_PATH.."bag",
UBI_IMG_PATH.."bank",
UBI_IMG_PATH.."mail",
UBI_IMG_PATH.."equipped",
UBI_IMG_PATH.."voidstorage",
UBI_IMG_PATH.."reagents",
UBI_IMG_PATH..string.lower( UBI_FACTION ) };
-- Frame/tooltip related options
UBI_NUM_ITEMBUTTONS = 16;
UBI_NUM_TOKENBUTTONS = 20;
UBI_MAX_RECIPE_INFO = 10;
-- Saved variable
UBI_Data = {}; -- Main data structure for UberInventory (items, prices, options)
-- Inventory items (Sorted and filtered)
UBI_Sorted = {};
UBI_Track = {};
UBI_Inventory_count = 0;
UBI_Items_Work = {};
-- Tooltip hook related stuff
currentItemCount = 0;
currentItemId = nil;
UBI_Hooks = {};
UBI_Hooks["OnTooltipSetItem"] = {};
UBI_Hooks["OnTooltipCleared"] = {};
UBI_Hooks["ReturnInboxItem"] = {};
UBI_Hooks["SendMail"] = {};
-- Mail transfer
UBI_Mail_Transfer = {};
-- Default settings
UBI_Defaults = { ["show_money"] = true,
["show_balance"] = false,
["show_tooltip"] = true,
["show_item_count"] = true,
["show_highlight"] = true,
["show_sell_prices"] = false,
["show_recipe_prices"] = true,
["show_recipe_reward"] = true,
["show_recipe_drop"] = true,
["show_minimap"] = true,
["minimap"] = 315,
["alpha"] = 1,
["take_money"] = false,
["track_gb_data"] = true,
["send_gb_data"] = true,
["receive_gb_data"] = true,
["warn_mailexpire"] = true,
["#_data"] = "vendor",
};