File choir.lua changed (mode: 100644) (index ba0e991..f995171) |
... |
... |
local function arrangeEveryRaidGroupFrame(raidFrame) |
762 |
762 |
i = i + 1 |
i = i + 1 |
763 |
763 |
local raidGroupFrame = t[i] |
local raidGroupFrame = t[i] |
764 |
764 |
if raidGroupFrame and raidGroupFrame:IsShown() then |
if raidGroupFrame and raidGroupFrame:IsShown() then |
765 |
|
raidGroupFrame:SetPoint('BOTTOMLEFT', 0, y) |
|
|
765 |
|
raidGroupFrame:SetPoint('BOTTOMLEFT', raidFrame, 'BOTTOMLEFT', 0, y) |
766 |
766 |
y = y + raidGroupFrame:GetHeight() + padding |
y = y + raidGroupFrame:GetHeight() + padding |
767 |
767 |
end |
end |
768 |
768 |
end |
end |
|
... |
... |
local function createRaidGroupFrame(raidFrame, groupNumber, unitSetOverride) |
902 |
902 |
end |
end |
903 |
903 |
|
|
904 |
904 |
local function raidFrameEventProcessor(raidFrame) |
local function raidFrameEventProcessor(raidFrame) |
905 |
|
arrangeEveryRaidGroupFrame(raidFrame) |
|
|
905 |
|
if ChoirConfRaidFlag then |
|
906 |
|
raidFrame:Show() |
|
907 |
|
arrangeEveryRaidGroupFrame(raidFrame) |
|
908 |
|
else |
|
909 |
|
raidFrame:Hide() |
|
910 |
|
end |
906 |
911 |
end |
end |
907 |
912 |
|
|
908 |
913 |
local function createRaidFrame(rootFrame, spoilerHolder) |
local function createRaidFrame(rootFrame, spoilerHolder) |
|
... |
... |
local function createRaidFrame(rootFrame, spoilerHolder) |
920 |
925 |
local raidFrame = CreateFrame('FRAME', 'ChoirRaidFrame', rootFrame) |
local raidFrame = CreateFrame('FRAME', 'ChoirRaidFrame', rootFrame) |
921 |
926 |
raidFrame:SetSize(labelWidth + (padding + buttonWidth) * maxPartySize, |
raidFrame:SetSize(labelWidth + (padding + buttonWidth) * maxPartySize, |
922 |
927 |
(padding + buttonHeight) * (maxSubgroupQuantity / 2)) |
(padding + buttonHeight) * (maxSubgroupQuantity / 2)) |
923 |
|
raidFrame:SetPoint('TOPLEFT', 0, -64) |
|
924 |
928 |
|
|
925 |
929 |
--[[ TODO Add any debuff indicator ]]-- |
--[[ TODO Add any debuff indicator ]]-- |
926 |
930 |
local j = 0 |
local j = 0 |
|
... |
... |
local function initConfSpellShortcut(confFrame) |
1373 |
1377 |
return bindingKeyFrame |
return bindingKeyFrame |
1374 |
1378 |
end |
end |
1375 |
1379 |
|
|
1376 |
|
local function initConf(rootFrame) |
|
|
1380 |
|
local function applyConfRaidFrameFactory(raidFrame, confRaidCheckButton, confRaidXEditBox, confRaidYEditBox) |
|
1381 |
|
assert (raidFrame ~= nil) |
|
1382 |
|
assert (confRaidCheckButton ~= nil) |
|
1383 |
|
assert (confRaidXEditBox ~= nil) |
|
1384 |
|
assert (confRaidYEditBox ~= nil) |
|
1385 |
|
|
|
1386 |
|
return function() |
|
1387 |
|
local x = confRaidXEditBox:GetNumber() or 0 |
|
1388 |
|
x = math.min(math.max(0, x), UIParent:GetWidth()) |
|
1389 |
|
|
|
1390 |
|
local y = confRaidYEditBox:GetNumber() or 0 |
|
1391 |
|
y = math.min(math.max(0, y), UIParent:GetHeight()) |
|
1392 |
|
|
|
1393 |
|
local flag = false |
|
1394 |
|
if confRaidCheckButton:GetChecked() then |
|
1395 |
|
flag = true |
|
1396 |
|
end |
|
1397 |
|
|
|
1398 |
|
ChoirConfRaidFlag = flag |
|
1399 |
|
ChoirConfRaidX = x |
|
1400 |
|
ChoirConfRaidY = y |
|
1401 |
|
|
|
1402 |
|
raidFrame:SetPoint('BOTTOMLEFT', x, y) |
|
1403 |
|
if flag then |
|
1404 |
|
raidFrame:Show() |
|
1405 |
|
else |
|
1406 |
|
raidFrame:Hide() |
|
1407 |
|
end |
|
1408 |
|
arrangeEveryRaidGroupFrame(raidFrame) |
|
1409 |
|
end |
|
1410 |
|
end |
|
1411 |
|
|
|
1412 |
|
local function cancelConfRaidFrameFactory(raidFrame, confRaidCheckButton, confRaidXEditBox, confRaidYEditBox) |
|
1413 |
|
assert (raidFrame ~= nil) |
|
1414 |
|
assert (confRaidCheckButton ~= nil) |
|
1415 |
|
assert (confRaidXEditBox ~= nil) |
|
1416 |
|
assert (confRaidYEditBox ~= nil) |
|
1417 |
|
|
|
1418 |
|
return function() |
|
1419 |
|
local x = ChoirConfRaidX or 0 |
|
1420 |
|
x = math.min(math.max(0, x), UIParent:GetWidth()) |
|
1421 |
|
|
|
1422 |
|
local y = ChoirConfRaidY or 0 |
|
1423 |
|
y = math.min(math.max(0, y), UIParent:GetHeight()) |
|
1424 |
|
|
|
1425 |
|
local flag = false |
|
1426 |
|
if ChoirConfRaidFlag then |
|
1427 |
|
flag = true |
|
1428 |
|
end |
|
1429 |
|
|
|
1430 |
|
ChoirConfRaidFlag = flag |
|
1431 |
|
ChoirConfRaidX = x |
|
1432 |
|
ChoirConfRaidY = y |
|
1433 |
|
|
|
1434 |
|
if flag then |
|
1435 |
|
confRaidCheckButton:SetChecked(true) |
|
1436 |
|
else |
|
1437 |
|
confRaidCheckButton:SetChecked(false) |
|
1438 |
|
end |
|
1439 |
|
confRaidXEditBox:SetNumber(x) |
|
1440 |
|
confRaidXEditBox:SetCursorPosition(0) |
|
1441 |
|
confRaidYEditBox:SetNumber(y) |
|
1442 |
|
confRaidYEditBox:SetCursorPosition(0) |
|
1443 |
|
end |
|
1444 |
|
end |
|
1445 |
|
|
|
1446 |
|
|
|
1447 |
|
local function initConfRaidFrame(confFrame, raidFrame) |
|
1448 |
|
assert (confFrame ~= nil) |
|
1449 |
|
assert (raidFrame ~= nil) |
|
1450 |
|
|
|
1451 |
|
local marginBottom = 144 |
|
1452 |
|
local marginLeft = 16 |
|
1453 |
|
local padding = 6 |
|
1454 |
|
|
|
1455 |
|
local confRaidFrame = CreateFrame('FRAME', 'ChoirConfRaidFrame', confFrame) |
|
1456 |
|
confRaidFrame:SetSize(144 * 3, 144) |
|
1457 |
|
confRaidFrame:SetPoint('BOTTOMLEFT', 0, 0) |
|
1458 |
|
|
|
1459 |
|
local n0 = confRaidFrame:GetName() .. 'RaidFlagCheckButton' |
|
1460 |
|
local n0Width = 24 * 6 |
|
1461 |
|
local confRaidCheckButton = CreateFrame('CHECKBUTTON', n0, confRaidFrame, 'ChatConfigCheckButtonTemplate'); |
|
1462 |
|
confRaidCheckButton:SetPoint('BOTTOMLEFT', marginLeft, marginBottom) |
|
1463 |
|
local n0text = _G[n0 .. 'Text'] |
|
1464 |
|
n0text:SetText('Raid Frame') |
|
1465 |
|
|
|
1466 |
|
local n1 = confRaidFrame:GetName() .. 'RaidFrameXEditBox' |
|
1467 |
|
local confRaidXEditBox = CreateFrame('EDITBOX', n1, confRaidFrame, 'InputBoxTemplate') |
|
1468 |
|
confRaidXEditBox:SetSize(12 * 4, 24) |
|
1469 |
|
confRaidXEditBox:SetPoint('BOTTOMLEFT', marginLeft + n0Width + padding, marginBottom) |
|
1470 |
|
confRaidXEditBox:SetAutoFocus(false) |
|
1471 |
|
confRaidXEditBox:SetCursorPosition(0) |
|
1472 |
|
|
|
1473 |
|
local n2 = confRaidFrame:GetName() .. 'RaidFrameYEditBox' |
|
1474 |
|
local confRaidYEditBox = CreateFrame('EDITBOX', n2, confRaidFrame, 'InputBoxTemplate') |
|
1475 |
|
confRaidYEditBox:SetSize(12 * 4, 24) |
|
1476 |
|
local n2x = marginLeft + n0Width + confRaidXEditBox:GetWidth() + padding * 2 |
|
1477 |
|
local n2y = marginBottom |
|
1478 |
|
confRaidYEditBox:SetPoint('BOTTOMLEFT', n2x, n2y) |
|
1479 |
|
confRaidYEditBox:SetAutoFocus(false) |
|
1480 |
|
confRaidYEditBox:SetCursorPosition(0) |
|
1481 |
|
|
|
1482 |
|
local okay = applyConfRaidFrameFactory(raidFrame, confRaidCheckButton, confRaidXEditBox, confRaidYEditBox) |
|
1483 |
|
local cancel = cancelConfRaidFrameFactory(raidFrame, confRaidCheckButton, confRaidXEditBox, confRaidYEditBox) |
|
1484 |
|
|
|
1485 |
|
confFrame.okay = okay |
|
1486 |
|
confFrame.cancel = cancel |
|
1487 |
|
confFrame.refresh = cancel |
|
1488 |
|
local default = function() |
|
1489 |
|
ChoirConfRaidFlag = true |
|
1490 |
|
ChoirConfRaidX = 256 |
|
1491 |
|
ChoirConfRaidY = 768 - 48 * 8 / 2 |
|
1492 |
|
--[[ NOTE Refresh callback is executed implicitly here. ]]-- |
|
1493 |
|
end |
|
1494 |
|
confFrame.default = default |
|
1495 |
|
|
|
1496 |
|
if nil == ChoirConfRaidFlag and nil == ChoirConfRaidX and nil == ChoirConfRaidY then |
|
1497 |
|
default() |
|
1498 |
|
end |
|
1499 |
|
cancel() |
|
1500 |
|
okay() |
|
1501 |
|
|
|
1502 |
|
return confRaidFrame |
|
1503 |
|
end |
|
1504 |
|
|
|
1505 |
|
local function initConf(rootFrame, raidFrame) |
1377 |
1506 |
assert (rootFrame ~= nil) |
assert (rootFrame ~= nil) |
1378 |
1507 |
|
|
1379 |
1508 |
local confFrame = CreateFrame('FRAME', 'ChoirConfFrame', rootFrame) |
local confFrame = CreateFrame('FRAME', 'ChoirConfFrame', rootFrame) |
|
... |
... |
local function initConf(rootFrame) |
1410 |
1539 |
|
|
1411 |
1540 |
InterfaceOptions_AddCategory(confFrame) |
InterfaceOptions_AddCategory(confFrame) |
1412 |
1541 |
|
|
|
1542 |
|
initConfRaidFrame(confFrame, raidFrame) |
|
1543 |
|
|
1413 |
1544 |
local bindingKeyFrame = initConfSpellShortcut(confFrame) |
local bindingKeyFrame = initConfSpellShortcut(confFrame) |
1414 |
1545 |
assert (bindingKeyFrame ~= nil) |
assert (bindingKeyFrame ~= nil) |
1415 |
1546 |
InterfaceOptions_AddCategory(bindingKeyFrame) |
InterfaceOptions_AddCategory(bindingKeyFrame) |
|
... |
... |
local function init(rootFrame) |
1425 |
1556 |
|
|
1426 |
1557 |
rootFrame:UnregisterAllEvents() |
rootFrame:UnregisterAllEvents() |
1427 |
1558 |
|
|
1428 |
|
rootFrame:SetSize(1024, 768) |
|
1429 |
|
rootFrame:SetPoint('CENTER', 0, 0) |
|
|
1559 |
|
rootFrame:SetAllPoints() |
1430 |
1560 |
|
|
1431 |
1561 |
initRangeSpellName(rootFrame) |
initRangeSpellName(rootFrame) |
1432 |
1562 |
local spoilerHolder = initSpoiler(rootFrame) |
local spoilerHolder = initSpoiler(rootFrame) |
1433 |
|
initRaidFrame(rootFrame, spoilerHolder) |
|
1434 |
|
initConf(rootFrame) |
|
|
1563 |
|
local raidFrame = initRaidFrame(rootFrame, spoilerHolder) |
|
1564 |
|
initConf(rootFrame, raidFrame) |
1435 |
1565 |
|
|
1436 |
1566 |
trace('init') |
trace('init') |
1437 |
1567 |
end |
end |