/
local mainWindow = TortaParentFrame; |
local startPage = TortaParentFrameStartPage; |
local mainPage = TortaParentFrameMainPage; |
local explorerWindow = TortaParentFrameMainPageExplorerSubWindow; |
local explorerScrollBar = TortaParentFrameMainPageExplorerSubWindowScrollBar; |
local mainWindow = TortaParentFrame; |
local startPage = TortaParentFrameStartPage; |
local mainPage = TortaParentFrameMainPage; |
local explorerWindow = TortaParentFrameMainPageExplorerSubWindow; |
local explorerScrollBar = TortaParentFrameMainPageExplorerSubWindowScrollBar; |
local EXPLORER_LISTBUTTON_HEIGHT = 16; |
local clDisplayWindow = TortaParentFrameMainPageDisplaySubWindow; |
local clScrollBar = TortaParentFrameMainPageDisplaySubWindowScrollBar; |
local noLoadedListText = TortaParentFrameMainPageDisplaySubWindowNoLoadedListText; |
local clTopButton = TortaParentFrameMainPageDisplaySubWindowTaskButton1; |
local taskEditor = TortaParentFrameMainPageTaskEditorSubWindow; |
local taskBar = TortaParentFrameMainPageTaskbar; |
local editTaskEB = TortaParentFrameMainPageTaskEditorSubWindowEditBox; |
local clDisplayWindow = TortaParentFrameMainPageDisplaySubWindow; |
local clScrollBar = TortaParentFrameMainPageDisplaySubWindowScrollBar; |
local noLoadedListText = TortaParentFrameMainPageDisplaySubWindowNoLoadedListText; |
local clTopButton = TortaParentFrameMainPageDisplaySubWindowTaskButton1; |
local taskEditor = TortaParentFrameMainPageTaskEditorSubWindow; |
local taskBar = TortaParentFrameMainPageTaskbar; |
local editTaskEB = TortaParentFrameMainPageTaskEditorSubWindowEditBox; |
local cl3HeaderText = TortaParentFrameMainPageDisplaySubWindowHeaderText; |
local button = (self.clRecycleBin[id] or CreateFrame( |
"Button", |
nil, |
explorerWindow, |
clDisplayWindow, |
"TortaChecklistTaskButton")); |
button:ClearAllPoints(); |
button:SetPoint("TOPLEFT", self.clListButtons[id - 1], "BOTTOMLEFT"); |
lineplusoffset = line + FauxScrollFrame_GetOffset(clScrollBar); |
button = self.clListButtons[line]; |
if lineplusoffset <= #self.data.text then |
button.text:SetText("|cffffd000" .. lineplusoffset .. ".)|r " .. self.data.text[lineplusoffset]); |
-- button.text:SetText("|cffffd000" .. lineplusoffset .. ".)|r " .. self.data.text[lineplusoffset]); |
button.text:SetFormattedText("|cffffd000%i.)|r %s", lineplusoffset, self.data.text[lineplusoffset]); |
button.check:SetChecked(self.data.stat[lineplusoffset]); |
button:SetID(lineplusoffset); |
end |
function Torta.gui:OnManageDialogShow() |
if Torta.cl3:IsEditTaskDialogOpen() then |
taskEditor:Hide(); |
end |
clDisplayWindow:Hide(); |
end |
function Torta.gui:OnManageDialogHide() |
if Torta.cl3:IsEditTaskDialogOpen() then |
taskEditor:Show(); |
end |
clDisplayWindow:Show(); |
end |
FauxScrollFrame_SetOffset(explorerScrollBar, 0); |
FauxScrollFrame_SetOffset(clScrollBar, 0); |
mainWindow:SetMinResize(610, 450); |
mainWindow:SetMinResize(820, 450); |
PanelTemplates_SetNumTabs(mainWindow, 3); |
Torta.gui:OnTabClicked(1); |
</Layer> |
</Layers> |
<Frames> |
<Button name="$parentEnterButton" inherits="UIPanelButtonTemplate" text="Enter"> |
<Button name="$parentCloseButton" inherits="UIPanelButtonTemplate" text="Close"> |
<Size x="100" y="23"/> |
<Anchors> |
<Anchor point="BOTTOMRIGHT"> |
<Offset x="-3" y="3"/> |
<Anchor point="BOTTOMLEFT"> |
<Offset x="5" y="5"/> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick> |
Torta.cl3:HideTaskEditor(); |
</OnClick> |
</Scripts> |
</Button> |
<Button name="$parentEnterButton" inherits="UIPanelButtonTemplate" text="Enter"> |
<Size x="100" y="23"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentCloseButton" relativePoint="RIGHT"/> |
</Anchors> |
<Scripts> |
<OnClick> |
Torta.cl3:ModifyOpenTask(getglobal(self:GetParent():GetName() .. "EditBox"):GetText()); |
getglobal(self:GetParent():GetName() .. "EditBox"):ClearFocus(); |
Torta.gui:UpdateCLScrollBar(); |
<Color r="0.8"/> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset x="5" y="-5"/> |
<Offset x="4" y="-5"/> |
</Anchor> |
<Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> |
<Offset x="-5" y="-20"/> |
<Offset x="-4" y="-20"/> |
</Anchor> |
</Anchors> |
</Texture> |
<!-- UI.xml --> |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<!-- The main window --> |
<Frame name="TortaParentFrame" inherits="TortaTooltipStyleFrameTemplate" parent="UIParent" hidden="true" movable="true" resizable="true"> |
<Size x="800" y="415"/> |
<Anchors> |
<Anchor point="CENTER"/> |
</Anchors> |
<Frames> |
<!-- Purpose: Shields the main window from clicks, making the user focus on a dialog box --> |
<Frame name="TortaClickBlocker" setAllPoints="true" frameStrata="TOOLTIP" enableMouse="true" hidden="true"/> |
<Button name="$parentDragAreaHeaderButton" enableMouse="true"> |
<Anchors> |
<Anchor point="TOPLEFT"> |
</Anchors> |
<Scripts> |
<OnClick> |
Torta.gui:ToggleWindow(TortaManageListsDialog); |
if not TortaManageDialog:IsVisible() then |
TortaManageDialog:Show(); |
else |
TortaManageDialog:Hide(); |
end |
</OnClick> |
</Scripts> |
</Button> |
<Button name="$parentShareButton" inherits="UIPanelButtonTemplate" text="Share"> |
<Button name="$parentShareButton" inherits="UIPanelButtonTemplate" text="Share Stuff!"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentManageButton" relativePoint="RIGHT"/> |
</Anchors> |
</Button> |
<Button name="$parentUncheckAllButton" inherits="UIPanelButtonTemplate" text="Uncheck All"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentShareButton" relativePoint="RIGHT"> |
<Offset x="5"/> |
</Anchor> |
</Anchors> |
</Button> |
<Button name="$parentCheckAllButton" inherits="UIPanelButtonTemplate" text="Check All"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentUncheckAllButton" relativePoint="RIGHT"/> |
</Anchors> |
</Button> |
<Button name="$parentAddTaskButton" inherits="UIPanelButtonTemplate" text="Add A Task"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentCheckAllButton" relativePoint="RIGHT"/> |
</Anchors> |
</Button> |
<Button name="$parentRemoveTaskButton" inherits="UIPanelButtonTemplate" text="Remove Task"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentAddTaskButton" relativePoint="RIGHT"/> |
</Anchors> |
</Button> |
<Button name="$parentCloseButton" inherits="UIPanelButtonTemplate" text="Close"> |
<Size x="100" y="22"/> |
<Anchors> |
</OnClick> |
</Scripts> |
</Button> |
<Button name="$parentStatsButton" text="Stats Button"> |
<NormalFont style="GameFontNormal"/> |
<Size y="22"/> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentRemoveTaskButton" relativePoint="RIGHT"/> |
<Anchor point="RIGHT" relativeTo="$parentCloseButton" relativePoint="LEFT"/> |
</Anchors> |
<Scripts> |
<OnClick> |
</OnClick> |
</Scripts> |
</Button> |
</Frames> |
<!-- END OF TASKBAR BUTTONS --> |
</Frame> |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Frame name="TortaManageListsDialog" inherits="TortaSubWindowTemplate" parent="UIParent" frameStrata="TOOLTIP" hidden="true"> |
<Size x="512" y="400"/> |
<Frame name="TortaManageDialog" inherits="TortaSubWindowTemplate" parent="TortaParentFrameMainPage" hidden="true"> |
<Anchors> |
<Anchor point="CENTER" relativeTo="TortaParentFrame"/> |
<Anchor point="TOPLEFT" relativeTo="$parentExplorerSubWindow" relativePoint="TOPRIGHT"/> |
<Anchor point="BOTTOMRIGHT" relativeTo="$parentTaskbar" relativePoint="TOPRIGHT"/> |
</Anchors> |
<Scripts> |
<OnShow> |
TortaClickBlocker:Show(); |
UIFrameFadeOut(TortaParentFrame, 0.27, TortaParentFrame:GetAlpha(), 0.7); |
Torta.gui:OnManageDialogShow(); |
</OnShow> |
<OnHide> |
TortaClickBlocker:Hide(); |
UIFrameFadeIn(TortaParentFrame, 0.27, TortaParentFrame:GetAlpha(), 1); |
Torta.gui:OnManageDialogHide(); |
</OnHide> |
</Scripts> |
<Layers> |
<Button name="$parentCloseButton" inherits="UIPanelButtonTemplate" text="Close"> |
<Size x="100" y="22"/> |
<Anchors> |
<Anchor point="BOTTOMRIGHT"> |
<Offset x="-5" y="5"/> |
<Anchor point="BOTTOM"> |
<Offset y="7"/> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick> |
Torta.gui:ToggleWindow(self:GetParent()); |
self:GetParent():Hide(); |
</OnClick> |
</Scripts> |
</Button> |
gui.data = nil; |
widgets.cl3HeaderText:SetText("Torta Checklist"); |
gui:UpdateCLScrollBar(); |
Torta.db.profile.cfg.loadedList = false; |
self.openTask = nil; |
else |
widgets.cl3HeaderText:SetText(lists[listID].meta.listName); |
Torta.db.profile.cfg.loadedList = listID; |
self.openTask = nil; |
gui:UpdateCLScrollBar(); |
end |
gui:UpdateCLScrollBar(); |
gui:UpdateExplorerScrollBar(); |
end |
end |
function Checklist3:IsEditTaskDialogOpen() |
return not not self.openTask; |
end |
function Checklist3:ModifyOpenTask(newText) |
assert(type(self.openTask) == "number"); |
local profile = Torta.db.profile; |
dispWnd:SetPoint(unpack(displayWindowPoints)); |
dispWnd:SetPoint("BOTTOMRIGHT", widgets.taskBar, "TOPRIGHT"); |
tEditor:Hide(); |
self.openTask = nil; |
end |
getglobal(tEditor:GetName() .. "HeaderText"):SetText("Task Editor: " .. (taskID or "|cffff0000No task ID|r")) |
end |
function Checklist3:UncheckAll() |
end |
function Checklist3:CheckAll() |
end |