Repository navigation
Expand file tree
/
Copy pathTestMode.lua
More file actions
125 lines (106 loc) · 4.9 KB
/
Copy pathTestMode.lua
File metadata and controls
125 lines (106 loc) · 4.9 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
-- TestMode.lua: Test mode for previewing arena frames outside of arena
function sArenaMixin:Test()
if (InCombatLockdown()) then return end
local db = self.db
local currTime = GetTime()
local classIcons = sArenaMixin.classIcons
local testData = {
[1] = { hp = 60, absorb = 20 },
[2] = { hp = 80, absorb = 30 },
[3] = { hp = 100, absorb = 30 },
}
for i = 1, 3 do
local frame = self["arena" .. i]
frame:Show()
local data = testData[i]
frame.HealthBar:SetMinMaxValues(0, 100)
frame.HealthBar:SetValue(data.hp)
frame.PowerBar:SetMinMaxValues(0, 100)
frame.PowerBar:SetValue(100)
frame.ClassIcon:SetTexture(classIcons["MAGE"])
frame.SpecIcon:Show()
frame.SpecIcon.Texture:SetTexture(135846)
frame.ClassIconCooldown:SetCooldown(GetTime(), math.random(20, 60))
frame.Name:SetText("arena" .. i)
frame.Name:SetShown(db.profile.showNames)
frame.Trinket.Texture:SetTexture(1322720)
frame.Trinket.Cooldown:SetCooldown(currTime, math.random(20, 60))
local color = RAID_CLASS_COLORS["MAGE"]
if (db.profile.classColors) then
frame.HealthBar:SetStatusBarColor(color.r, color.g, color.b, 1)
else
frame.HealthBar:SetStatusBarColor(0, 1, 0, 1)
end
frame.PowerBar:SetStatusBarColor(0, 0, 1, 1)
frame.CastBar.fadeOut = nil
frame.CastBar:SetMinMaxValues(0, 100)
frame.CastBar:SetValue(70)
frame.CastBar:Show()
frame.CastBar:SetAlpha(1)
frame.CastBar.Icon:SetTexture(136071)
frame.CastBar.Icon:Show()
frame.CastBar:SetStatusBarColor(1, 0.7, 0, 1)
if frame.CastBar.Text then
frame.CastBar.Text:SetFontObject("GameFontHighlightSmall")
frame.CastBar.Text:SetText("Polymorph")
end
-- Show fake DR icons for test mode (Midnight: 2-stack DR system)
if not frame.fakeDRFrames then
frame.fakeDRFrames = {}
local drTextures = { 132298, 136071 } -- Stun, Incap
local layoutName = db.profile.currentLayout
local layoutSettings = db.profile.layoutSettings[layoutName]
local drSize = (layoutSettings and layoutSettings.dr and layoutSettings.dr.size) or 22
local borderColors = { { 0, 1, 0, 1 }, { 1, 0, 0, 1 } } -- green (½), red (%)
local drTexts = { "½", "%" }
for n = 1, 2 do
local fakeDR = CreateFrame("Frame", nil, frame)
fakeDR:SetSize(drSize, drSize)
fakeDR:SetFrameStrata("HIGH")
fakeDR:SetFrameLevel(11)
fakeDR.Icon = fakeDR:CreateTexture(nil, "ARTWORK")
fakeDR.Icon:SetAllPoints()
fakeDR.Icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
fakeDR.Icon:SetTexture(drTextures[n])
fakeDR.Cooldown = CreateFrame("Cooldown", nil, fakeDR, "CooldownFrameTemplate")
fakeDR.Cooldown:SetAllPoints()
fakeDR.Cooldown:SetDrawBling(false)
fakeDR.Cooldown:SetHideCountdownNumbers(false)
fakeDR.Cooldown:SetSwipeColor(0, 0, 0, 0.6)
fakeDR.Border = fakeDR:CreateTexture(nil, "OVERLAY")
fakeDR.Border:SetTexture("Interface\\Buttons\\UI-Quickslot-Depress")
fakeDR.Border:SetPoint("TOPLEFT", -2.5, 2.5)
fakeDR.Border:SetPoint("BOTTOMRIGHT", 2.5, -2.5)
fakeDR.Border:SetVertexColor(unpack(borderColors[n]))
fakeDR.DRTextFrame = CreateFrame("Frame", nil, fakeDR)
fakeDR.DRTextFrame:SetAllPoints(fakeDR)
fakeDR.DRTextFrame:SetFrameStrata("HIGH")
fakeDR.DRTextFrame:SetFrameLevel(27)
fakeDR.DRText = fakeDR.DRTextFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
fakeDR.DRText:SetPoint("BOTTOMRIGHT", 4, -4)
fakeDR.DRText:SetFont("Fonts\\ARIALN.TTF", 14, "OUTLINE")
fakeDR.DRText:SetText(drTexts[n])
fakeDR.DRText:SetTextColor(unpack(borderColors[n]))
frame.fakeDRFrames[n] = fakeDR
end
end
for n = 1, 2 do
frame.fakeDRFrames[n]:Show()
frame.fakeDRFrames[n].Cooldown:SetCooldown(currTime, math.random(12, 25))
end
frame.hideStatusText = false
frame:SetStatusText("player", 100000)
frame:UpdateStatusTextVisible()
end
-- Apply layout settings (respects growth direction, castbar style, etc.)
local layoutName = db.profile.currentLayout
local layoutSettings = db.profile.layoutSettings[layoutName]
if layoutSettings then
if layoutSettings.dr then
self:UpdateDRSettings(layoutSettings.dr)
end
if layoutSettings.castBar then
self:UpdateCastBarSettings(layoutSettings.castBar)
end
end
end