-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.lua
600 lines (505 loc) · 21.1 KB
/
config.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
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
local _, GuildAssist = ...;
local AceGUI = LibStub("AceGUI-3.0")
local addOnVersion = "4.3.2"
local branding = "GuildAssist3 v"..addOnVersion.." | Design & Development © S3R43o3 2022"
local menuButton = "GameMenuButtonTemplate";
local basicFrame = "BasicFrameTemplateWithInset";
local largeGameFont = "GameFontNormalLarge";
local largeHighlightFont = "GameFontHighlightLarge";
local transparentFrame = "TooltipBackdropTemplate";
local headFont = "Fonts\\MORPHEUS.TTF"
-- Update frame
function GA_CreateUpdateFrame()
local rootFrame = AceGUI:Create("Frame")
rootFrame:SetTitle("GuildAssist3 Patchnotes")
rootFrame:SetHeight(275)
rootFrame:SetWidth(600)
rootFrame:SetLayout("Flow")
rootFrame:SetStatusText(branding)
local header = AceGUI:Create("Label")
header:SetFont(headFont, 30, "THINOUTLINE")
header:SetColor(255, 0, 0)
header:SetFullWidth(true)
header:SetText("Patchnotes Version "..tostring(addOnVersion))
header:SetJustifyH("CENTER")
local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) -- probably?
scrollcontainer:SetLayout("Fill") -- important!
rootFrame:AddChild(header)
rootFrame:AddChild(scrollcontainer)
local scroll = AceGUI:Create("ScrollFrame")
scroll:SetLayout("Flow") -- probably?
scrollcontainer:AddChild(scroll)
for k, v in pairs(_G.GA_Patchnotes) do
local note = AceGUI:Create("Label")
note:SetFont("Fonts\\FRIZQT__.TTF", 14, "THINOUTLINE")
note:SetText(v)
note:SetFullWidth(true)
scroll:AddChild(note)
end
return rootFrame
end
-- function that draws the widgets for the first tab
local function DrawGroup1(container)
local desc = AceGUI:Create("Label")
desc:SetText("This is Tab 1")
desc:SetFullWidth(true)
container:AddChild(desc)
local button = AceGUI:Create("Button")
button:SetText("Tab 1 Button")
button:SetWidth(200)
container:AddChild(button)
end
-- function that draws the widgets for the second tab
local function DrawGroup2(container)
local desc = AceGUI:Create("Label")
desc:SetText("This is Tab 2")
desc:SetFullWidth(true)
container:AddChild(desc)
local button = AceGUI:Create("Button")
button:SetText("Tab 2 Button")
button:SetWidth(200)
container:AddChild(button)
end
-- Callback function for OnGroupSelected
local function SelectGroup(container, event, group)
container:ReleaseChildren()
if group == "tab1" then
DrawGroup1(container)
elseif group == "tab2" then
DrawGroup2(container)
end
end
-- Create Help frame
function GA_CreateHelpFrame()
--local testString = "Lorem ipsum, dolor sit amet consectetur adipisicing elit. Voluptatibus quas dolore adipisci quibusdam fuga tempora, ducimus quo aperiam hic aliquid, provident magnam, tenetur esse vitae. Atque tenetur consectetur minima. Totam saepe rerum sed, ipsa magnam eaque, architecto beatae distinctio sequi atque dicta eum alias id nam, similique maxime accusantium velit."
local rootFrame = AceGUI:Create("Frame")
rootFrame:SetTitle("GuildAssist3 - Help")
rootFrame:SetStatusText(branding)
rootFrame:SetCallback("OnClose", function (widget) AceGUI:Release(widget) end)
rootFrame:SetLayout("Flow")
rootFrame:SetHeight(500)
rootFrame:SetWidth(600)
local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) -- probably?
scrollcontainer:SetLayout("Fill") -- important!
rootFrame:AddChild(scrollcontainer)
local scroll = AceGUI:Create("ScrollFrame")
scroll:SetLayout("Flow") -- probably?
scrollcontainer:AddChild(scroll)
-- add widgets to "scroll"
-- general help
local generalhelpContainer = AceGUI:Create("InlineGroup")
generalhelpContainer:SetFullWidth(true)
generalhelpContainer:SetLayout("Flow")
local generalhelpHeader = AceGUI:Create("Label")
generalhelpHeader:SetFullWidth(true)
generalhelpHeader:SetPoint("CENTER")
generalhelpHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
generalhelpHeader:SetColor(195, 0, 0);
generalhelpHeader:SetJustifyH("CENTER")
generalhelpHeader:SetText("General Help")
generalhelpContainer:AddChild(generalhelpHeader)
for k, v in pairs(GA_HelpCustom) do
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetJustifyH("CENTER")
helpText:SetText(v)
generalhelpContainer:AddChild(helpText)
end
scroll:AddChild(generalhelpContainer)
-- chat command help
local commandContainer = AceGUI:Create("InlineGroup")
commandContainer:SetLayout("List")
local commandHeader = AceGUI:Create("Label")
commandHeader:SetFullWidth(true)
commandHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
commandHeader:SetColor(195, 0, 0);
commandHeader:SetText("Chat Commands")
commandHeader:SetJustifyH("CENTER")
commandContainer:SetFullWidth(true)
commandContainer:AddChild(commandHeader)
for k,v in pairs(GA_HelpStringTable) do
--print("| k: ",k ,"| v: ", v.text)
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetText(v.header.." - "..v.text)
commandContainer:AddChild(helpText)
end
scroll:AddChild(commandContainer)
-- gratulation automatic help
local gratulationContainer = AceGUI:Create("InlineGroup")
gratulationContainer:SetFullWidth(true)
gratulationContainer:SetLayout("Flow")
local gratulationHeader = AceGUI:Create("Label")
gratulationHeader:SetPoint("CENTER")
gratulationHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
gratulationHeader:SetColor(195, 0, 0);
gratulationHeader:SetJustifyH("CENTER")
gratulationHeader:SetText("Gratulation Automatic")
gratulationHeader:SetFullWidth(true)
gratulationContainer:AddChild(gratulationHeader)
for k, v in pairs(GA_HelpGratulation) do
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetText(v)
gratulationContainer:AddChild(helpText)
end
scroll:AddChild(gratulationContainer)
-- discord automatic help
local discordContainer = AceGUI:Create("InlineGroup")
discordContainer:SetFullWidth(true)
discordContainer:SetLayout("Flow")
local discordHeader = AceGUI:Create("Label")
discordHeader:SetFullWidth(true)
discordHeader:SetPoint("CENTER")
discordHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
discordHeader:SetColor(195, 0, 0);
discordHeader:SetJustifyH("CENTER")
discordHeader:SetText("Discord/Teamspeak Automatic")
discordContainer:AddChild(discordHeader)
for k, v in pairs(GA_HelpDiscord) do
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetText(v)
discordContainer:AddChild(helpText)
end
scroll:AddChild(discordContainer)
-- dungeon id tracker help
local trackerContainer = AceGUI:Create("InlineGroup")
trackerContainer:SetFullWidth(true)
trackerContainer:SetLayout("Flow")
local trackerHeader = AceGUI:Create("Label")
trackerHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
trackerHeader:SetColor(195, 0, 0);
trackerHeader:SetFullWidth(true)
trackerHeader:SetJustifyH("CENTER")
trackerHeader:SetText("Dungeon Tracker")
trackerContainer:AddChild(trackerHeader)
for k, v in pairs(GA_HelpDiscord) do
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetText(v)
trackerContainer:AddChild(helpText)
end
scroll:AddChild(trackerContainer)
-- gratulation automatic help
local inviteContainer = AceGUI:Create("InlineGroup")
inviteContainer:SetFullWidth(true)
inviteContainer:SetLayout("Flow")
local inviteHeader = AceGUI:Create("Label")
inviteHeader:SetPoint("CENTER")
inviteHeader:SetFont("Fonts\\MORPHEUS.TTF", 22, "THICKOUTLINE")
inviteHeader:SetColor(195, 0, 0);
inviteHeader:SetJustifyH("CENTER")
inviteHeader:SetText("Partyinvite Automatic")
inviteHeader:SetFullWidth(true)
inviteContainer:AddChild(inviteHeader)
for k, v in pairs(GA_HelpInvite) do
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetFullWidth(true)
helpText:SetText(v)
inviteContainer:AddChild(helpText)
end
scroll:AddChild(inviteContainer)
--[[
local i = 1
repeat
local container = AceGUI:Create("InlineGroup")
container:SetFullWidth(true)
local headingFrame = AceGUI:Create("Label")
headingFrame:SetText("Header No. "..tostring(i))
headingFrame:SetFullWidth(true)
local helpText = AceGUI:Create("Label")
helpText:SetFontObject("GameFontNormal")
helpText:SetText(tostring(i).." "..testString)
helpText:SetFullWidth(true)
container:AddChild(headingFrame)
container:AddChild(helpText)
scroll:AddChild(container)
print("Frame Number "..tostring(i).." created!")
i = i + 1
until i == 10
]]
return rootFrame
end
function GA_CreateWelcomeFrame()
local rootFrame = AceGUI:Create("Frame","welcomeFrame")
rootFrame:SetTitle("Welcome to GuildAssist3")
rootFrame:SetStatusText(branding)
rootFrame:SetWidth(700)
rootFrame:SetHeight(250)
rootFrame:SetPoint("TOP",0, -20)
rootFrame:SetFullWidth(true)
rootFrame:SetFullHeight(true)
rootFrame:SetLayout("Flow")
rootFrame:SetCallback("OnClose", function (widget)
AceGUI:Release(widget)
end)
local header = AceGUI:Create("Label")
header:SetFont("Fonts\\MORPHEUS.TTF", 44, "THINOUTLINE")
header:ClearAllPoints()
header:SetRelativeWidth(1)
header:SetColor(195, 0, 0);
header:SetText("Welcome")
header:SetJustifyH("CENTER")
rootFrame:AddChild(header)
local full_string = ""
for k, v in pairs(GA_WelcomeStringTable) do
full_string = full_string..v
end
local text = AceGUI:Create("Label")
text:SetFont("Fonts\\ARIALN.TTF", 16, "OUTLINE")
text:SetRelativeWidth(1)
text:SetPoint("CENTER")
text:SetJustifyH("CENTER")
text:SetText(full_string)
rootFrame:AddChild(text)
return rootFrame
end
function GA_CreateMenu()
-- create ui frame
local frame = AceGUI:Create("Frame")
frame:SetTitle("GuildAssist3")
frame:SetStatusText(branding)
frame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)
frame:SetLayout("Fill")
-- Create the TabGroup
local tab = AceGUI:Create("TabGroup")
tab:SetLayout("Flow")
-- Setup which tabs to show
tab:SetTabs({{text="Gratulation Options", value="tab1"}, {text="Discord Options", value="tab2"}})
-- Register callback
tab:SetCallback("OnGroupSelected", SelectGroup)
-- Set initial Tab (this will fire the OnGroupSelected callback)
tab:SelectTab("tab1")
-- add to the frame container
frame:AddChild(tab)
--[[
local editbox = AceGUI:Create("EditBox")
editbox:SetLabel("Insert text:")
editbox:SetWidth(200)
frame:AddChild(editbox)
local button = AceGUI:Create("Button")
button:SetText("Click Me!")
button:SetWidth(200)
frame:AddChild(button)
]]
return frame
end
function GA_CreateInstanceTracker()
-- base frame
local uiFrame = CreateFrame("Frame", "GA_CreateInstanceTrackerFrame", _G.UIParent, "HelpFrameContainerFrameTemplate");
--[[
2291 De Other Side
2287 Halls of Atonement
2290 Mists of Tirna Scithe
2289 Plaguefall
2284 Sanguine Depths
2285 Spires of Ascension
2286 The Necrotic Wake
2293 Theater of Pain
2441 Tazavesh the Veiled Market
]]
uiFrame:SetSize(400, 100);
uiFrame:SetPoint("TOPRIGHT", _G.GroupFinderFrame, "TOPRIGHT", 0, 98);
--uiFrame:SetPoint("CENTER", UIParent, "CENTER", 0, 120);
-- window title
uiFrame.title = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.title:SetFontObject("GameFontHighlight");
uiFrame.title:SetPoint("TOPLEFT", _G.GA_CreateInstanceTrackerFrame, "TOPLEFT", 5, 15);
uiFrame.title:SetText("Guild Assist - Instance Tracker");
uiFrame.title:SetTextColor(255, 0, 0);
-- inner Title
uiFrame.innerTitle = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.innerTitle:SetFontObject("GameFontNormal");
uiFrame.innerTitle:SetPoint("CENTER", _G.GA_CreateInstanceTrackerFrame, "CENTER", 0, 38);
uiFrame.innerTitle:SetText("Your free mythic instance are:");
-- DUNGEON STRINGS
-- de other side
uiFrame.otherSide = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.otherSide:SetFontObject("GameFontHighlight");
uiFrame.otherSide:SetPoint("TOPLEFT", _G.GA_CreateInstanceTrackerFrame, "TOPLEFT", 15, -20);
-- halls of atonement
uiFrame.hallsOfAtonement = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.hallsOfAtonement:SetFontObject("GameFontHighlight");
uiFrame.hallsOfAtonement:SetPoint("TOPLEFT", _G.GA_CreateInstanceTrackerFrame, "TOPLEFT", 15, -35);
-- Mists of Tirna Scithe
uiFrame.mistOfTirneScithe = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.mistOfTirneScithe:SetFontObject("GameFontHighlight");
uiFrame.mistOfTirneScithe:SetPoint("TOPLEFT", _G.GA_CreateInstanceTrackerFrame, "TOPLEFT", 15, -50);
uiFrame.plaguefall = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.plaguefall:SetFontObject("GameFontHighlight");
uiFrame.plaguefall:SetPoint("TOPLEFT", _G.GA_CreateInstanceTrackerFrame, "TOPLEFT", 15, -65);
uiFrame.sanguineDepths = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.sanguineDepths:SetFontObject("GameFontHighlight");
uiFrame.sanguineDepths:SetPoint("TOPRIGHT", _G.GA_CreateInstanceTrackerFrame, "TOPRIGHT", -15, -20);
uiFrame.spiresOfAscension = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.spiresOfAscension:SetFontObject("GameFontHighlight");
uiFrame.spiresOfAscension:SetPoint("TOPRIGHT", _G.GA_CreateInstanceTrackerFrame, "TOPRIGHT", -15, -35);
uiFrame.theNecroticWake = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.theNecroticWake:SetFontObject("GameFontHighlight");
uiFrame.theNecroticWake:SetPoint("TOPRIGHT", _G.GA_CreateInstanceTrackerFrame, "TOPRIGHT", -15, -50);
uiFrame.theaterOfPain = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.theaterOfPain:SetFontObject("GameFontHighlight");
uiFrame.theaterOfPain:SetPoint("TOPRIGHT", _G.GA_CreateInstanceTrackerFrame, "TOPRIGHT", -15, -65);
uiFrame.tazavesh = uiFrame:CreateFontString(nil, "OVERLAY");
uiFrame.tazavesh:SetFontObject("GameFontHighlight");
uiFrame.tazavesh:SetPoint("TOP", _G.GA_CreateInstanceTrackerFrame, "TOP", 0, -80);
uiFrame.otherSide:SetText(DungeonNamesDE[5]);
uiFrame.hallsOfAtonement:SetText(DungeonNamesDE[3]);
uiFrame.mistOfTirneScithe:SetText(DungeonNamesDE[1]);
uiFrame.plaguefall:SetText(DungeonNamesDE[4]);
uiFrame.sanguineDepths:SetText(DungeonNamesDE[7]);
uiFrame.spiresOfAscension:SetText(DungeonNamesDE[6]);
uiFrame.theNecroticWake:SetText(DungeonNamesDE[2]);
uiFrame.theaterOfPain:SetText(DungeonNamesDE[8]);
uiFrame.tazavesh:SetText(DungeonNamesDE[9]);
uiFrame.mistOfTirneScithe:SetTextColor(0, 155, 0);
uiFrame.theNecroticWake:SetTextColor(0, 155, 0);
uiFrame.hallsOfAtonement:SetTextColor(0, 155, 0);
uiFrame.theaterOfPain:SetTextColor(0, 155, 0);
uiFrame.plaguefall:SetTextColor(0, 155, 0);
uiFrame.tazavesh:SetTextColor(0, 155, 0);
uiFrame.sanguineDepths:SetTextColor(0, 155, 0);
uiFrame.otherSide:SetTextColor(0, 155, 0);
uiFrame.mistOfTirneScithe:SetTextColor(0, 155, 0);
uiFrame.spiresOfAscension:SetTextColor(0, 155, 0);
uiFrame:Hide()
return uiFrame
end
function GA_ColorTextDungeon(frame)
local lockDun = GA_TrackDungeons()
for i = 1, #lockDun do
if (lockDun[i] == DungeonNamesDE[1]) then
frame.mistOfTirneScithe:SetTextColor(195, 0, 0);
else
frame.mistOfTirneScithe:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[2]) then
frame.theNecroticWake:SetTextColor(195, 0, 0);
else
frame.theNecroticWake:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[3]) then
frame.hallsOfAtonement:SetTextColor(195, 0, 0);
else
frame.hallsOfAtonement:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[4]) then
frame.theaterOfPain:SetTextColor(195, 0, 0);
else
frame.theaterOfPain:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[5]) then
frame.plaguefall:SetTextColor(195, 0, 0);
else
frame.plaguefall:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[6]) then
frame.otherSide:SetTextColor(195, 0, 0);
else
frame.otherSide:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[7]) then
frame.spiresOfAscension:SetTextColor(195, 0, 0);
else
frame.spiresOfAscension:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[8]) then
frame.sanguineDepths:SetTextColor(195, 0, 0);
else
frame.sanguineDepths:SetTextColor(0, 155, 0);
end
if (lockDun[i] == DungeonNamesDE[9]) then
frame.tazavesh:SetTextColor(195, 0, 0);
else
frame.tazavesh:SetTextColor(0, 155, 0);
end
end
end
function GA_TrackDungeons()
local lockedDungeons = {}
local dungeonIDs = GetNumSavedInstances()
-- Get Locked Dungeons
for i = 1, dungeonIDs do
--print(dungeonIDs[i])
local name, id, reset, difficulty, locked, extended, instanceIDMostSig, isRaid, maxPlayers, difficultyName, numEncounters, encounterProgress, extendDisabled = GetSavedInstanceInfo(i)
-- check german names
for j = 1, #DungeonNamesDE do
local dName = DungeonNamesDE[j]
if (name == dName and difficulty == 23 and locked == true) then
--print(name)
table.insert(lockedDungeons, name)
end
end
-- check english names
for k = 1, #DungeonNamesEN do
local eName = DungeonNamesEN[k]
if (name == eName and difficulty == 23 and locked == true) then
--print(name)
table.insert(lockedDungeons, name)
end
end
end
return lockedDungeons;
--print(type(id),name,difficulty,type( locked), locked, instanceIDMostSig , extended)
end
function GA_GratulationMessageFrame(db)
local rootFrame = AceGUI:Create("Window")
rootFrame:SetWidth(400)
rootFrame:SetHeight(450)
local headText = AceGUI:Create("Label")
headText:SetFullWidth(true)
headText:SetFont(headFont, 30, "THICKOUTLINE")
headText:SetText("Message List")
headText:SetJustifyH("CENTER")
headText:SetColor(255, 0, 0);
local infoText = AceGUI:Create("Label")
infoText:SetFontObject("GameFontNormalLarge")
infoText:SetFullWidth(true)
infoText:SetJustifyH("CENTER")
infoText:SetText("Please notice that the removed Message will still show until you re-open this window again.")
infoText:SetColor(155, 15, 0)
local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) -- probably?
scrollcontainer:SetLayout("Fill") -- important!
rootFrame:AddChild(headText)
rootFrame:AddChild(infoText)
rootFrame:AddChild(scrollcontainer)
local scroll = AceGUI:Create("ScrollFrame")
scroll:SetFullWidth(true)
scroll:SetLayout("Flow") -- probably?
scrollcontainer:AddChild(scroll)
for i = 1, #db do
local container = AceGUI:Create("InlineGroup")
container:SetFullWidth(true)
local text = AceGUI:Create("Label")
text:SetFullWidth(true)
text:SetFontObject("GameFontNormal")
text:SetText(db[i])
local deleteButton = AceGUI:Create("Button")
deleteButton:SetText("Delete")
deleteButton:SetCallback("OnClick", function (widget)
for j = 1, #db do
if db[i] == db[j] then
table.remove(db,j)
end
GuildAssist:Print("Message removed from list")
end
end)
container:AddChild(text)
container:AddChild(deleteButton)
scroll:AddChild(container)
end
return rootFrame
end