-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgui.lua
More file actions
617 lines (479 loc) · 22.3 KB
/
gui.lua
File metadata and controls
617 lines (479 loc) · 22.3 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
local L = LibStub("AceLocale-3.0"):GetLocale("Prio3", true)
Prio3.lootframe = nil
function Prio3:handleChatCommand(cmd)
if cmd == "config" then
if Prio3.lootframe ~= nil then
Prio3.lootframe:Hide()
end
LibStub("AceConfigDialog-3.0"):Open("Prio3")
elseif (cmd == "help") or (tempty(self.db.profile.priorities)) then
Prio3:guiHelpFrame()
else
Prio3:guiPriorityFrame()
end
end
function Prio3:guiPriorityFrame()
-- if not Prio3.lootframe == nil then
-- Prio3.lootframe:Hide()
-- Prio3.lootframe = nil
-- return
-- end
-- see if we might already have all data
local haveAll = true
-- look through all items ids (but only once)
local tblrequest = {}
for user, prios in pairs(self.db.profile.priorities) do
for prio, itemid in pairs(prios) do
tblrequest[itemid] = itemid;
end
end
for itemid,id2 in pairs(tblrequest) do
if tonumber(itemid) > 0 then
local itemname, itemlink = GetItemInfo(itemid)
if itemlink == nil then haveAll = false end
end
end
if haveAll then
Prio3.lootframe = Prio3:createPriorityFrame()
Prio3.lootframe:Show()
else
if Prio3.db.profile.debug then Prio3:Print("DEBUG: requested window to open after GET_ITEM_INFO_RECEIVED") end
-- queue for handling when GET_ITEM_INFO_RECEIVED event came through
local t = {
needed_itemids = tblrequest,
vars = {},
todo = function(itemlinks,vars)
Prio3.lootframe = Prio3:createPriorityFrame()
Prio3.lootframe:Show()
end,
}
table.insert(Prio3.GET_ITEM_INFO_RECEIVED_TodoList, t)
end
end
function Prio3:createPriorityFrame()
local AceGUI = LibStub("AceGUI-3.0")
if self.db.profile.priorities == nil then
Prio3:Print(L["No priorities defined."])
return;
end
local f = AceGUI:Create("Window")
f:SetTitle(L["Priority List"] .. " " .. strsub(Prio3.versionString, 1, 9))
f:SetStatusText("")
f:SetLayout("Flow")
f:SetWidth(700)
f:SetHeight(500)
f:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
-- close on escape
_G["Prio3.lootframeFrame"] = f.frame
tinsert(UISpecialFrames, "Prio3.lootframeFrame")
local btCfg = AceGUI:Create("Button")
btCfg:SetText("Config / Import")
btCfg:SetRelativeWidth(0.5)
btCfg:SetCallback("OnClick", function()
Prio3.lootframe:Hide()
LibStub("AceConfigDialog-3.0"):Open("Prio3")
end)
f:AddChild(btCfg)
local btHelp = AceGUI:Create("Button")
btHelp:SetText("Help")
btHelp:SetRelativeWidth(0.5)
btHelp:SetCallback("OnClick", function()
Prio3.lootframe:Hide()
Prio3:guiHelpFrame()
end)
f:AddChild(btHelp)
local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) -- probably?
scrollcontainer:SetLayout("Fill") -- important!
f:AddChild(scrollcontainer)
local s = AceGUI:Create("ScrollFrame")
s:SetLayout("Flow") -- probably?
scrollcontainer:AddChild(s)
local function processPrio (prios,prioNumber) -- function to process existing prios
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(prios[prioNumber])
if itemLink then
local lbIcon = AceGUI:Create("Icon")
lbIcon:SetRelativeWidth(0.04)
lbIcon:SetImage(itemTexture)
lbIcon:SetImageSize(15,15)
lbIcon:SetCallback("OnEnter", function(widget)
GameTooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
GameTooltip:SetHyperlink(itemLink)
GameTooltip:Show()
end)
lbIcon:SetCallback("OnLeave", function(widget)
GameTooltip:Hide()
end)
s:AddChild(lbIcon)
local lbPrio = AceGUI:Create("InteractiveLabel")
if (Prio3.db.profile.debug) then
lbPrio:SetText("("..prios[prioNumber]..") " .. itemLink)
else
lbPrio:SetText(itemLink)
end
lbPrio:SetRelativeWidth(0.20)
s:AddChild(lbPrio)
else
local lbIcon = AceGUI:Create("Icon")
lbIcon:SetRelativeWidth(0.04)
lbIcon:SetImage("Interface\\Icons\\ability_vanish")
lbIcon:SetImageSize(15,15)
s:AddChild(lbIcon)
local lbPrio = AceGUI:Create("InteractiveLabel")
lbPrio:SetText("-ERROR: ID-")
lbPrio:SetRelativeWidth(0.20)
s:AddChild(lbPrio)
end
end
local function noPrio(prioNumber) -- function to process missing prios
local lbIcon = AceGUI:Create("Icon")
lbIcon:SetRelativeWidth(0.04)
lbIcon:SetImage("Interface\\Icons\\ability_vanish")
lbIcon:SetImageSize(15,15)
s:AddChild(lbIcon)
local lbPrio = AceGUI:Create("InteractiveLabel")
lbPrio:SetText("-no prio "..prioNumber.." set-")
lbPrio:SetRelativeWidth(0.20)
s:AddChild(lbPrio)
end
local function cellSeperator(columns)
for i=1,columns do
local lbHR = AceGUI:Create("Label")
lbHR:SetText("-----------------------------")
lbHR:SetRelativeWidth(0.24)
s:AddChild(lbHR)
end
end
local sortedUsers = {}
for user, prios in pairs(self.db.profile.priorities) do
table.insert(sortedUsers, user)
end
table.sort(sortedUsers) -- Sorts users alphabetically
for index, user in ipairs(sortedUsers) do
local lbPlayerName = AceGUI:Create("Label")
lbPlayerName:SetText(index.." "..user)
lbPlayerName:SetRelativeWidth(0.24)
s:AddChild(lbPlayerName)
local prios = self.db.profile.priorities[user] -- access prios via user key
if tonumber(prios[1]) > 0 then processPrio(prios,1) else noPrio(1) end
if tonumber(prios[2]) > 0 then processPrio(prios,2) else noPrio(2) end
if tonumber(prios[3]) > 0 then processPrio(prios,3) else noPrio(3) end
cellSeperator(4)
end
return f
end
function Prio3:guiHelpFrame()
if Prio3.helpframe == nil then
Prio3.helpframe = Prio3:createHelpFrame()
Prio3.helpframe:Hide()
end
if Prio3.helpframe:IsShown() then
Prio3.helpframe:Hide()
else
Prio3.helpframe:Show()
end
end
function Prio3:createHelpFrame()
local AceGUI = LibStub("AceGUI-3.0")
local f = AceGUI:Create("Window")
f:SetTitle(L["Prio3 Help"] .. " " .. strsub(Prio3.versionString, 1, 9))
f:SetStatusText("")
f:SetLayout("Flow")
f:SetWidth(700)
f:SetHeight(500)
f:EnableResize(true)
-- do not release! f:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
-- close on escape
_G["Prio3.helpframeFrame"] = f.frame
tinsert(UISpecialFrames, "Prio3.helpframeFrame")
local btCfg = AceGUI:Create("Button")
btCfg:SetText("Config / Import")
btCfg:SetRelativeWidth(0.5)
btCfg:SetCallback("OnClick", function()
Prio3.helpframe:Hide()
LibStub("AceConfigDialog-3.0"):Open("Prio3")
end)
f:AddChild(btCfg)
local btPrio = AceGUI:Create("Button")
btPrio:SetText(L["Priority List"])
btPrio:SetRelativeWidth(0.5)
btPrio:SetCallback("OnClick", function()
Prio3.helpframe:Hide()
Prio3:guiPriorityFrame()
end)
f:AddChild(btPrio)
local tabGroup = AceGUI:Create("TabGroup")
tabGroup:SetFullWidth(true)
tabGroup:SetFullHeight(true)
tabGroup:SetLayout("Fill")
tabGroup:SetTabs({
{ value = "tl;dr", text = L["tl;dr"] },
{ value = "prio3", text = L["Prio3 System"] },
{ value = "manual", text = L["Manual"] },
})
tabGroup:SetCallback("OnGroupSelected", function(widget, event, group) Prio3:HelpFrameTabChange(widget, event, group) end)
tabGroup:SelectTab("tl;dr")
f:AddChild(tabGroup)
return f
end
function Prio3:HelpFrameTabChange(container, event, group)
container:ReleaseChildren()
if group == "tl;dr" then
Prio3:HelpFrameTab_tldr(container)
elseif group == "prio3" then
Prio3:HelpFrameTab_prio3(container)
elseif group == "manual" then
Prio3:HelpFrameTab_manual(container)
end
end
function Prio3:HelpFrameTab_tldr(container)
local AceGUI = LibStub("AceGUI-3.0")
local s = AceGUI:Create("ScrollFrame")
s:SetLayout("Flow") -- probably?
container:AddChild(s)
local function heading(c, txt)
local i = AceGUI:Create("Heading")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
local function label(c, txt)
local i = AceGUI:Create("Label")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
heading(s, L["tl;dr"])
label(s, L["Import Priorities or have people whisper in priorities. Loot corpses and have chosen loot announced in raid chat."])
local sgig = AceGUI:Create("InlineGroup")
sgig:SetRelativeWidth(0.5)
s:AddChild(sgig)
heading(sgig, L["tl;dr In-Game"])
label(sgig, L["Go to /prio3 config, Import, Accept whispers"])
label(sgig, L["For initial round, turn *off* Accept only new"])
label(sgig, L["Start accepting whispers"])
label(sgig, L["You can verify who answered by /prio3"])
label(sgig, L["End accepting whispers if all players entered"])
label(sgig, L["For late joiners, re-enable Accept only new before allowing whispers"])
label(sgig, L["Participants will need to have the Prio3 addon to see current list."])
label(sgig, L["If enabled in config, Participants can use whisper queries to find out who else has their items on prio."])
local sgde = AceGUI:Create("InlineGroup")
sgde:SetRelativeWidth(0.5)
s:AddChild(sgde)
heading(sgde, L["tl;dr German users"])
label(sgde, L["I really encourage you to use sahne-team.de!"])
label(sgde, L["Top left: Priorun, Priorun Erstellen, chose Server, Char and Class."])
label(sgde, L["*Note down the Admin Pin to the top right for yourself, if you get disconnected*."])
label(sgde, L["Go to Raid Ziel, choose instance. Announce Prio PIN from Regeln or Spieler tab to participants (not Admin Pin!)."])
label(sgde, L["Put in your priorities in Spieler tab."])
label(sgde, L["When all have entered, go to Regeln - ANZEIGEN,"])
label(sgde, L["then to Prioliste and download one of the exports on top, e.g. TXT."])
label(sgde, L["Copy&Paste to /prio3 config, Import field"])
label(s, L["You could also gather your raid priorities externally, e.g. using Google Doc."])
label(s, L["Generate loot lists in format Username;Prio1;Prio2;Prio3 per line, using ItemIDs or e.g. wowhead links, and use /prio3 config, Import"])
label(s, L["You could opt to enable sending in priorities by whispers in the same menu, good option also for strugglers or replacement raiders."])
end
function Prio3:HelpFrameTab_prio3(container)
local AceGUI = LibStub("AceGUI-3.0")
local s = AceGUI:Create("ScrollFrame")
s:SetLayout("Flow") -- probably?
container:AddChild(s)
local function heading(c, txt)
local i = AceGUI:Create("Heading")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
local function label(c, txt)
local i = AceGUI:Create("Label")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
heading(s, L["What is Priority 3 Looting?"])
label(s, L["This loot distribution scheme is based on participants choosing up to three items they want to gain priority on when they actually drop."])
label(s, L["It is especially nice for pug raids or raids with a high amount of random fillers, as there is no history, no earning of points, everyone starts the same with every raid. But of course it can also be of value on regular raid groups that do not want the hassle of full DKP tracking or avoid long loot council discussions."])
label(s, L["Side note: Prio 3 does not distinguish between main/need and offspec/greed priorities. It can thus be a good choice if you want to collect offspec gear for your char. (Hint: In order to avoid grief on main spec characters who are interested in the same items, it could be better to announce this intention beforehand.)"])
heading(s, L["So, how does this work now?"])
label(s, L["Before the raid, you will choose (up to) 3 items you want to have priority on."])
label(s, L["Mostly, the raid lead or designated PM is collecting these requests, noting them down. Sometimes a Google Doc is used to post as read only link to users later on."])
label(s, L["Prio3 can also be used to collect these requests in-game. See tl;dr tab for a short intro."])
local sg = AceGUI:Create("InlineGroup")
sg:SetRelativeWidth(1)
s:AddChild(sg)
label(sg, L["sahne-team.de usage: If you are a German user, please try this website! It eases up coordinating Prio loot a lot."])
label(sg, L["You setup a run on the Priorun function to the upper left, select a target instance, and give the Run PIN to your participants."])
label(sg, L["Please remember to note down your admin pin from the upper right corner!"])
label(sg, L["Every user can choose their items, in secret. Even the admin cannot see those."])
label(sg, L["After all participants have chosen their loot, the admin can set the run to be visible for all."])
label(sg, L["For use with the Prio3 addon, you can then use the Exports."])
label(sg, L["Prio3 native would be CSV Short, but the addon can actually read sahne-team.de full CSV and TXT export as well."])
label(s, L["If the loot drops, it will be handled along the priority table, starting with all users that have this on Priority 1."])
label(s, L["If there is only one user: Congrats, you have a new item."])
label(s, L["If there are more users with the same priority, those are asked to roll for the item, highest roll wins."])
label(s, L["Every user will get only one item per priority. If an items drops a second time, it is handled among the others with the highest remaining priority."])
label(s, L["If no one selected that particular item for Prio 1, then Prio 2 will be handled, and afterwards Prio 3. For all items where no one set a Priority, those are usually handled by FFA. Some raids tend to apply main>offspec here."])
label(s, L["Of course choosing which items to put where, that is part of the fun, and risk. Do I put this item on Prio 1, because others may want it too? Or it is unlikely, and I can savely put it on Prio 3?"])
heading(s, L["Where does the Prio3 addon comes into play?"])
label(s, L["Looking up if someone actually has marked down a priority can be a tedious task, and it's easy to miss someone."])
label(s, L["The Prio3 addon will notify you on looting if there are any Priorities set up."])
label(s, L["This way you don't have to switch to your lookup table, e.g. on a website like sahne-team.de or a google doc, or even a handwritten note. It will announce this to the raid (by default), or only to the char using the addon and looting (should normally be the PM)."])
heading(s, L["What is Prio 0?"])
label(s, L["Some groups extended the Prio 3 system by another priorization that takes precedence before Prio 1."])
label(s, L["If you enable the output setting and choose the same item for Prio 1, 2 and 3, it will be used as Prio 0."])
end
function Prio3:HelpFrameTab_manual(container)
local AceGUI = LibStub("AceGUI-3.0")
local s = AceGUI:Create("ScrollFrame")
s:SetLayout("Flow") -- probably?
container:AddChild(s)
local function heading(c, txt)
local i = AceGUI:Create("Heading")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
local function label(c, txt)
local i = AceGUI:Create("Label")
i:SetText(txt)
i:SetRelativeWidth(1)
c:AddChild(i)
end
local function code(c, txt)
local cg = AceGUI:Create("InlineGroup")
cg:SetRelativeWidth(1)
if type(txt) ~= "table" then
txt = {txt}
end
for _,t in pairs(txt) do
local i = AceGUI:Create("Label")
i:SetText(t)
i:SetFont(GameFontGreenSmall:GetFont())
i:SetColor(33,200,0)
i:SetRelativeWidth(1)
cg:AddChild(i)
end
c:AddChild(cg)
end
heading(s, L["IMPORT, or How does the addon know about the priorities?"])
label(s, L["You can import simple CSV strings on the Addon config page (Menu Interfaces, Tab Addon, Prio3)"])
code(s, {"Username;Prio1;Prio2;Prio3", "..."})
label(s, L["where Prio1, 2, 3 can be numeric item Ids, or even strings with the IDs somewhere in (will take first number found), e.g. wowhead links. This is basically the CSV-SHORT export format of sahne-team.de."])
label(s, L["Also accepted format: sahne-team.de CSV normal export, with german header line:"])
code(s, {"Name;Klasse;prio1itemid;prio2itemid;prio3itemid;prio1itemname;prio2itemname;prio3itemname;", "Username;Class;ID1;ID2;ID3;Name1;Name2;Name3;", "..."})
label(s, L["Also accepted format: sahne-team.de TXT export (tab » separated)"])
code(s, {"Username»»Class»»Name1-ID1»Name2-ID2»Name3-ID3", "..."})
label(s, L["If you need further formats, please let me know."])
label(s, L["Players can be informed by whispers about imported priorities (configurable in options)"])
label(s, L["You could opt for accepting priorities by whisper. Go to Menu Interfaces, Tab Addon, Prio3; or type /prio3 config, and to go Import. This is a good option also for late joiners / replacements. See also tl;dr section."])
heading(s, L["OUTPUT, or What happens when loot drops"])
label(s, L["You can choose the output language independent of your client languague. Currently only English and German are supported. If you are interested in helping out with another translation, please let me know on http://github.com/dieck/prio3"])
label(s, L["Announcing to Raid is the main functionality. It will post to raid when it encounters loot where someone has a priority on. It will post one line per Priority (1,2,3), with the chars who have listed it."])
label(s, L["You can also announce if there is No Priority set up for an item."])
label(s, L["Announces will react to the minimum quality setting. Recommendation: Epic for most raids, Rare for AQ20"])
label(s, L["You can also whisper to players if there is loot that they have chosen."])
label(s, L["Prio3 will react to loot events (if you open a loot window)"])
label(s, L["You can configure it to also react to rolls (if e.g. there is no PM and the roll window starts) and to raid warnings (if e.g. someone else does Master Looter). You can also configure to ignore Onyxia Cloaks posted as raid warnings. Special service for BWL Prio3 runs :)"])
label(s, L["In order to avoid multiple posts, e.g. if you loot a corpse twice, there is a mute setting pausing outputs for a defined time."])
label(s, L["For Master Looter, a hint window can be added to the distribution window, showing all priorities for an item"])
label(s, L["Prio 0 enables a 4th priority that is ranked highest, if all 3 priorizations are set to the same item."])
heading(s, L["QUERIES, or How to look up and validate priorities"])
label(s, L["For addon users, /prio3 will open up a priority list"])
label(s, L["There are three options for your raid participants to query for Prio3 entries (can be turned on and off in options):"])
label(s, L["* Whisper 'prio' to get your own priorities. (default: on)"])
label(s, L["* Whisper 'prio USERNAME' to look up another raid member. (default: off)"])
label(s, L["* Whisper 'prio ITEMLINK' to look up priorities on an item. (default: on)"])
label(s, L["(If you don't get an answer at all, ask your Prio3 master if they turned on the options)"])
heading(s, L["SYNC & HANDLER, or How does this work with multiple people"])
label(s, L["Here are two options to handle how the addon talks to other users in the same raid. It is HIGHLY recommended to leave both turned on."])
label(s, L["Sync priorities will sync the list of items between multiple users, on import / end of accepting whispers. Without this option, multiple users could have different priorities, and depending on the next option it might not be clear whose are posted."])
label(s, L["The Resend prios button will send out Prios if needed - normally when someone new with the addon joins the raid, it will be synced automatically. But if the disabled the addon and turns it on later, you can send out your priorities with this."])
label(s, L["Sync item announcements will coordinate between multiple users' addons which user will actually post to raid (depending on output options). This is to avoid multiple posts of the same information. (May still happen though if addon communication is lagging slightly)."])
label(s, L["Also, you can opt to use /prio or /p3 in addition to /prio3 as command line trigger."])
heading(s, L["and more"])
label(s, L["There is a 'Versions' tab in the options, which is basically only there for debugging purposes."])
label(s, L["Users are notified if they have an older version of the application."])
label(s, L["Until now, all addon synchronisation features were backwards compatible. If this changes at some point in time, a comprehensive error message will be put in place"])
end
function Prio3:CreateMasterLootInfoFrame(itemId)
local frame = CreateFrame("Frame", "Prio3MasterLooterHint", UIParent, _G.BackdropTemplateMixin and "BackdropTemplate")
frame:SetBackdrop({
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
edgeSize = 14,
insets = {left = 4, right = 4, top = 4, bottom = 4},
})
frame:EnableMouse(false)
frame:SetPoint("CENTER")
local l = {}
-- build local prio list
local itemprios = {
p1 = {},
p2 = {},
p3 = {}
}
-- iterate over priority table
for user, prios in pairs(Prio3.db.profile.priorities) do
-- table always has 3 elements
if (tonumber(prios[1]) == tonumber(itemId)) then
table.insert(itemprios.p1, user)
end
if (tonumber(prios[2]) == tonumber(itemId)) then
table.insert(itemprios.p2, user)
end
if (tonumber(prios[3]) == tonumber(itemId)) then
table.insert(itemprios.p3, user)
end
end
if getn(itemprios.p1) > 0 then
tinsert(l, "Prio 1")
tinsert(l, "===============")
for k,v in pairs(itemprios.p1) do tinsert(l, v) end
tinsert(l, "===============")
end
if getn(itemprios.p2) > 0 then
tinsert(l, "Prio 2")
tinsert(l, "===============")
for k,v in pairs(itemprios.p2) do tinsert(l, v) end
tinsert(l, "===============")
end
if getn(itemprios.p3) > 0 then
tinsert(l, "Prio 3")
tinsert(l, "===============")
for k,v in pairs(itemprios.p3) do tinsert(l, v) end
end
if getn(l) == 0 then return nil end
frame:SetSize(140, 5+17*getn(l))
frame.text = frame:CreateFontString(nil,"ARTWORK")
frame.text:SetFont("Fonts\\ARIALN.ttf", 16, "OUTLINE")
frame.text:SetPoint("TOPLEFT",5,-5)
frame.text:SetText(table.concat(l, "\n"))
frame:Hide()
function frame:ShowParent(parent)
self:SetParent(parent)
self:ClearAllPoints()
self:SetPoint("TOPLEFT",parent,"TOPRIGHT")
self:Show()
end
function frame:HideParent()
self:SetParent(UIParent)
self:Hide()
end
return frame
end
function Prio3:OPEN_MASTER_LOOT_LIST()
if Prio3.MLF ~= nil then
-- hide old frame. Will still be in memory and attached to Master Looter Frame, so needs to be hidden here
Prio3.MLF:Hide()
Prio3.MLF:SetParent(nil)
end
-- garbage collection will take this up later on
Prio3.MLF = nil
if Prio3.db.profile.showmasterlooterhint then
local itemLink = GetLootSlotLink(LootFrame.selectedSlot);
local itemID = select(3, strfind(itemLink, "item:(%d+)"))
Prio3.MLF = self:CreateMasterLootInfoFrame(itemID)
if Prio3.MLF ~= nil then Prio3.MLF:ShowParent(MasterLooterFrame) end
end
end