File src/Chorus.xml changed (mode: 100644) (index f4b7799..50abb84) |
42 |
42 |
Otherwise, critical runtime failure will occurr. --> |
Otherwise, critical runtime failure will occurr. --> |
43 |
43 |
<Include file="ChorusGroupFrame.xml"/> |
<Include file="ChorusGroupFrame.xml"/> |
44 |
44 |
<Include file="ChorusFrame.xml"/> |
<Include file="ChorusFrame.xml"/> |
|
45 |
|
<Include file="ChorusConfFrame.xml"/> |
45 |
46 |
</Ui> |
</Ui> |
File src/ChorusConfFrame.lua added (mode: 100644) (index 0000000..1fc8ddd) |
|
1 |
|
local function movableEnable(frame) |
|
2 |
|
assert(frame ~= nil) |
|
3 |
|
|
|
4 |
|
frame:SetMovable(true) |
|
5 |
|
frame:EnableMouse(true) |
|
6 |
|
frame:RegisterForDrag('LeftButton', 'RightButton') |
|
7 |
|
frame:SetScript('OnDragStart', frame.StartMoving) |
|
8 |
|
frame:SetScript('OnDragStop', frame.StopMovingOrSizing) |
|
9 |
|
|
|
10 |
|
local n = frame:GetName() |
|
11 |
|
if not n then |
|
12 |
|
return |
|
13 |
|
end |
|
14 |
|
|
|
15 |
|
local background = frame.background or _G[n .. 'Background'] |
|
16 |
|
if background then |
|
17 |
|
background:Show() |
|
18 |
|
end |
|
19 |
|
end |
|
20 |
|
|
|
21 |
|
local function movableDisable(frame) |
|
22 |
|
assert(frame ~= nil) |
|
23 |
|
|
|
24 |
|
frame:SetMovable(false) |
|
25 |
|
frame:EnableMouse(false) |
|
26 |
|
frame:RegisterForDrag(nil) |
|
27 |
|
frame:SetScript('OnDragStart', nil) |
|
28 |
|
frame:SetScript('OnDragStop', nil) |
|
29 |
|
|
|
30 |
|
local n = frame:GetName() |
|
31 |
|
if not n then |
|
32 |
|
return |
|
33 |
|
end |
|
34 |
|
|
|
35 |
|
local background = frame.background or _G[n .. 'Background'] |
|
36 |
|
if background then |
|
37 |
|
background:Hide() |
|
38 |
|
end |
|
39 |
|
end |
|
40 |
|
|
|
41 |
|
local function confApply(confFrame) |
|
42 |
|
assert(confFrame ~= nil) |
|
43 |
|
|
|
44 |
|
local flag = ChorusConfMovableCheckBox:GetChecked() |
|
45 |
|
|
|
46 |
|
if flag then |
|
47 |
|
movableEnable(ChorusSoloFrame) |
|
48 |
|
else |
|
49 |
|
movableDisable(ChorusSoloFrame) |
|
50 |
|
end |
|
51 |
|
end |
|
52 |
|
|
|
53 |
|
function Chorus.confFrameMain(confFrame) |
|
54 |
|
assert(confFrame ~= nil) |
|
55 |
|
|
|
56 |
|
local n = GetAddOnMetadata('chorus', 'Title') or 'chorus' |
|
57 |
|
local ver = GetAddOnMetadata('chorus', 'Version') or '0' |
|
58 |
|
local t = string.format('%s-%s', n, ver) |
|
59 |
|
ChorusConfFrameTitle:SetText(t) |
|
60 |
|
|
|
61 |
|
confFrame.name = n |
|
62 |
|
|
|
63 |
|
confFrame.okay = confApply |
|
64 |
|
|
|
65 |
|
confFrame.cancel = function(self) |
|
66 |
|
ChorusConfMovableCheckBox:SetChecked(false) |
|
67 |
|
confApply(self) |
|
68 |
|
end |
|
69 |
|
|
|
70 |
|
confFrame.default = function(self) |
|
71 |
|
ChorusConfMovableCheckBox:SetChecked(false) |
|
72 |
|
ChorusSoloFrame:ClearAllPoints() |
|
73 |
|
ChorusSoloFrame:SetPoint('CENTER', 0, 0) |
|
74 |
|
confApply(self) |
|
75 |
|
end |
|
76 |
|
|
|
77 |
|
confFrame.refresh = confApply |
|
78 |
|
|
|
79 |
|
InterfaceOptions_AddCategory(confFrame) |
|
80 |
|
end |
File src/ChorusConfFrame.xml added (mode: 100644) (index 0000000..aa64ae3) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusConfFrame.lua"/> |
|
4 |
|
<Frame name="ChorusConfFrame" parent="InterfaceOptionsFramePanelContainer"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="640" y="480"/> |
|
7 |
|
</Size> |
|
8 |
|
<Layers> |
|
9 |
|
<Layer level="ARTWORK"> |
|
10 |
|
<FontString name="$parentTitle" text="Chorus" inherits="GameFontNormalLarge" justifyH="LEFT" justifyV="TOP"> |
|
11 |
|
<Anchors> |
|
12 |
|
<Anchor point="TOPLEFT"> |
|
13 |
|
<Offset> |
|
14 |
|
<AbsDimension x="16" y="-16"/> |
|
15 |
|
</Offset> |
|
16 |
|
</Anchor> |
|
17 |
|
</Anchors> |
|
18 |
|
</FontString> |
|
19 |
|
<FontString name="$parentSubText" text="Chorus subtext paragraph." inherits="GameFontHighlightSmall" nonspacewrap="true" maxLines="3" justifyH="LEFT" justifyV="TOP"> |
|
20 |
|
<Size> |
|
21 |
|
<AbsDimension x="32" y="0"/> |
|
22 |
|
</Size> |
|
23 |
|
<Anchors> |
|
24 |
|
<Anchor point="TOPLEFT" relativeTo="$parentTitle" relativePoint="BOTTOMLEFT"> |
|
25 |
|
<Offset> |
|
26 |
|
<AbsDimension x="0" y="-8"/> |
|
27 |
|
</Offset> |
|
28 |
|
</Anchor> |
|
29 |
|
<Anchor point="RIGHT"> |
|
30 |
|
<Offset> |
|
31 |
|
<AbsDimension x="-32" y="0"/> |
|
32 |
|
</Offset> |
|
33 |
|
</Anchor> |
|
34 |
|
</Anchors> |
|
35 |
|
</FontString> |
|
36 |
|
</Layer> |
|
37 |
|
</Layers> |
|
38 |
|
<Frames> |
|
39 |
|
<!-- See FrameXML/InterfaceOptionsPanels.xml --> |
|
40 |
|
<CheckButton name="ChorusConfMovableCheckBox" inherits="InterfaceOptionsCheckButtonTemplate"> |
|
41 |
|
<Anchors> |
|
42 |
|
<Anchor point="TOPLEFT" relativeTo="$parentSubText" relativePoint="BOTTOMLEFT"> |
|
43 |
|
<Offset> |
|
44 |
|
<AbsDimension x="-2" y="-8"/> |
|
45 |
|
</Offset> |
|
46 |
|
</Anchor> |
|
47 |
|
</Anchors> |
|
48 |
|
<Scripts> |
|
49 |
|
<OnLoad> |
|
50 |
|
ChorusConfMovableCheckBoxText:SetText('Movable') |
|
51 |
|
</OnLoad> |
|
52 |
|
</Scripts> |
|
53 |
|
</CheckButton> |
|
54 |
|
<!-- |
|
55 |
|
<Button name="ChorusConfDragEnableButton" inherits="UIPanelButtonTemplate" text="Drag Enable"> |
|
56 |
|
<Size> |
|
57 |
|
<AbsDimension x="96" y="22"/> |
|
58 |
|
</Size> |
|
59 |
|
<Anchors> |
|
60 |
|
<Anchor point="TOPLEFT"> |
|
61 |
|
<Offset> |
|
62 |
|
<AbsDimension x="12" y="-36"/> |
|
63 |
|
</Offset> |
|
64 |
|
</Anchor> |
|
65 |
|
</Anchors> |
|
66 |
|
</Button> |
|
67 |
|
--> |
|
68 |
|
</Frames> |
|
69 |
|
<Scripts> |
|
70 |
|
<OnLoad>Chorus.confFrameMain(self);</OnLoad> |
|
71 |
|
</Scripts> |
|
72 |
|
</Frame> |
|
73 |
|
</Ui> |
File src/ChorusSoloFrame.xml changed (mode: 100644) (index d2821e0..9dd9051) |
1 |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
2 |
2 |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
3 |
3 |
<Script file="ChorusSoloFrame.lua"/> |
<Script file="ChorusSoloFrame.lua"/> |
4 |
|
<Frame name="ChorusSoloFrame" parent="UIParent"> |
|
|
4 |
|
<Frame name="ChorusSoloFrame" parent="UIParent" movable="true" clampedToScreen="true"> |
5 |
5 |
<Size> |
<Size> |
6 |
|
<AbsDimension x="640" y="300"/> |
|
|
6 |
|
<AbsDimension x="640" y="190"/> |
7 |
7 |
</Size> |
</Size> |
|
8 |
|
<Layers> |
|
9 |
|
<Layer level="BACKGROUND"> |
|
10 |
|
<Texture name="$parentBackground" setAllPoints="true" hidden="true"> |
|
11 |
|
<Color r="0" g="0" b="0" a="0.34"/> |
|
12 |
|
</Texture> |
|
13 |
|
</Layer> |
|
14 |
|
</Layers> |
8 |
15 |
<Anchors> |
<Anchors> |
9 |
16 |
<Anchor point="CENTER"> |
<Anchor point="CENTER"> |
10 |
17 |
<Offset> |
<Offset> |
|
12 |
19 |
</Offset> |
</Offset> |
13 |
20 |
</Anchor> |
</Anchor> |
14 |
21 |
</Anchors> |
</Anchors> |
15 |
|
<!-- |
|
16 |
22 |
<Scripts> |
<Scripts> |
17 |
|
<OnLoad>Chorus.groupFrameMain(self);</OnLoad> |
|
|
23 |
|
<OnLoad>Chorus.soloFrameMain(self);</OnLoad> |
18 |
24 |
</Scripts> |
</Scripts> |
19 |
|
<Frames> |
|
20 |
|
<Frame name="ChorusGroupSecureHandler" inherits="SecureHandlerStateTemplate"/> |
|
21 |
|
</Frames> |
|
22 |
|
--> |
|
23 |
25 |
</Frame> |
</Frame> |
24 |
26 |
</Ui> |
</Ui> |